feat(ds4): add external ROCTX phase markers - #554
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
90ac4e5 to
3aaf9b1
Compare
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Carry semantic phase by value through ROCTX scopes and mixed-layer IPC so remote Halo shard markers label decode correctly instead of unspecified.
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
Summary
libroctx64.sofallbackThis replaces the superseded historical in-process HIP-event profiler on current
main. The old implementation recorded on a null/default stream and synchronized events, which could fence unrelated streams and distort the two-owner overlap being measured. This rewrite intentionally performs no internal GPU timing.Behavior contract
DFLASH_DS4_ROCTX=1enables balanced semantic ranges for correlation with an external rocprof kernel/copy trace. The marker layer:ROCTX span lengths are host-side semantic intervals. They are not GPU kernel-duration measurements.
Demonstrated loader defect and fix
Real rocprofv3 validation found that the previous handle-scoped
dlopen("libroctx64.so")plusdlsym(handle, ...)path bypassed rocprof's preloaded ROCTX interposer: a normally linked ROCTX smoke test traced, while the equivalent dynamic-loader smoke test and server did not.Commit
e028bb22b136695bf4ef89f1677ed4670eae95eeadds a regression that fails with the old lookup, then prefers a complete process-globalroctxRangePushA/roctxRangePoppair throughdlopen(nullptr). It preserves the original library fallback and does not change Windows behavior or add synchronization.Current-main build and test validation
Validated as a no-commit synthetic merge with upstream/main
4fa8937c69aa68658a14ec3cab16e1da22886dd0.-Wall -Wextra -WerrorROCTX/protocol test: passedgit diff --check: passed0aec3941088ae348df62c8a5fc8d9eedbb4599fdre-executes the real loader regression in an isolated child process so neitherDFLASH_DS4_ROCTXnor the process-scoped callback cache leaks into the parent suite; HIP-defined strict, HIP ASan/UBSan, non-HIP strict, and the CUDA-configured repository test pass7c87686bad02bb1a1c5b96c2986ad37d3c27fa63bounds the child to approximately five seconds withWNOHANG, terminates and reaps only that owned child on timeout, and reports signal termination explicitly; the same strict, sanitizer, non-HIP, and repository tests passRepresentative commands:
Real gfx1151 rocprof capture
Environment:
gfx1151dflash_serverSHA-256:2e545e9d4205773c679bb88b2f1058bac9768f241331d63d816023130fdbacd6The enabled speculative request captured 21 balanced marker intervals:
ds4.prefill mode=exactenclosing 11 exact leafds4.layer_rangeintervalsds4.spec_decode mode=batchedenclosing 8 verify leafds4.layer_rangeintervalsA separate target-only request captured 27 intervals:
mode=decodeleaf layer rangesAll intervals had sane ordering and intelligible request nesting. Unset and explicit
DFLASH_DS4_ROCTX=0real-request controls produced no DS4 marker rows and no marker CSV.Profiler command form:
Alternating disabled/enabled perturbation
The comparison used fresh processes, cache slots disabled, the same binary/models/prompt/placement, two warmups per mode, then five measured
off,onpairs.Measured median change: +0.72% in this bounded sample.
Correctness parity was exact across all ten measured requests:
39bcfb8d666171e8f833154fef4a6f70918ffb7458e4c8b32813b865e94abb67(prompt, completion, total)token counts:(11, 28, 39)1.0throughoutClocks were not administratively pinned; alternating pairs were used to limit temporal drift. This result is instrumentation-perturbation evidence for this setup, not a general performance claim.
Remaining merge gates
7c87686bad02bb1a1c5b96c2986ad37d3c27fa63Disclosed hardware follow-ups
These unavailable local cells are not assumed to pass and are not presented as evidence. They are follow-up hardware coverage rather than blockers for this HIP-only marker-loader correction: the CUDA build and CUDA-configured host regression pass, while exact-head repository CI remains the cross-platform merge gate.
The PR is locally hardware-qualified for the available gfx1151 paths, but it is not genuinely merge-ready until exact-head CI and maintainer approval complete.
Stack
Independent current-main PR. It does not depend on #548 or the #569/#575/#577 performance stack. #575 may provide a useful external rocprof collection wrapper, but it is not a code prerequisite.