Repository navigation
feat(iket): add semantic in-kernel event tracing integration - #716
Conversation
Signed-off-by: Zihua Wu <[email protected]>
Signed-off-by: Zihua Wu <[email protected]>
Signed-off-by: Zihua Wu <[email protected]>
Signed-off-by: Zihua Wu <[email protected]>
d27ffb7 to
0e52f59
Compare
- smoketest: add an IKET_EXAMPLES category for iket_trace. On CC >= 9.0 hosts it runs with an explicit --arch matching the host and must print the SUCCESS marker; on GPU-less or pre-9.0 hosts (and in --compile-only CI) it builds for the pinned sm_90 floor and must emit the device artifact. The contract check now lists IKET_EXAMPLES and raises its array-count self-test floor. - iket_trace: make the final success line start with SUCCESS: so the case-sensitive smoketest marker grep matches it. - pipeline: key IKET materialization off the finally-resolved target. When IKET ops are present and only a device hint is available, the hint is promoted to the pipeline's explicit target; both the PTX and NVVM resolvers honor an explicit target exactly (validate and fail loudly, never raise), so the placeholder shape can no longer diverge from the target the module is compiled for. - pipeline: CUDA_OXIDE_IKET=off now strips the semantic annotation ops before the full-debug preparation gate, so a disabled build of an annotated kernel compiles under --device-debug. The strip also removes the pre-mem2reg memory-form token plumbing (store/load/alloca), which the SSA-form eraser could not reach. - iket-lower: document the placeholder's reserved-region safety argument (sm_120 hardware-verified; sm_90 and the cluster-rank sm_100/sm_110 variants rely on the same argument, unverified).
|
Thanks for the PR. Nice work. I probed an unpatched-placeholder question on hardware and pushed a couple of (CI + compiler) related fixes; here's where things stand. What I verified: on sm_120, an annotated kernel sharing its block with live What I couldn't verify here: I don't have sm_90 or sm_100/110 hardware. sm_90 uses offset 0x3f0 and the sm_100/110 variants address by cluster rank; both rely on the same reserved-region argument but haven't been probed. If you (or anyone reading) can run the equivalent check there, that closes the last safety question; until then the code comment marks them as pending. The fixes pushed:
About the default:
Reviewer note: This is an experimental feature tracking an experimental external format, so (as discussed) it'll need to be iterated on. |
Summary
Add initial CUDA In-Kernel Event Tracing (IKET) support to cuda-oxide.
This change introduces:
iketcompiler dialect;CUBIN materialization, typed payloads, and long-name globals; and
run-iket.Design
The compiler pipeline keeps source intent separate from the physical IKET
encoding:
The semantic dialect contains no cursor, buffer-address, elected-lane, or
capture-session policy. Those details belong to IKET lowering and profiling.
The annotation surface provides:
iket::mark!;iket::range_start!/iket::range_end!; andiket::range_push!/iket::range_pop!.Payload kind and width remain explicit through the semantic pipeline. Typed
range tokens prevent pairing an end operation with a different start site.
Instrumentation method selection
CUDA_OXIDE_IKET=autois used when IKET operations are present:NativeDump;ExtendedNativeDump;native,extended, andoffare available as explicit controls. A forcedmethod fails rather than silently selecting another method.
The count is over unique names in the compiler root, not dynamic event count
or static call-site count. Range-pop uses its reserved IKET event ID.
Names are measured in UTF-8 bytes. Names that do not fit the 31-byte inline
field use the IKET-compatible hash representation and a device-global copy of
the complete string.
Example and profiler dependency
iket_traceexercises a point event, a typed range, au32payload, and aname longer than the inline field:
cargo oxide build iket_trace --materialize-cubin --arch sm_120 uv venv --python 3.12 .venv uv pip install --python .venv/bin/python nvidia-cutlass-dsl==4.7.0 .venv/bin/run-iket --output-dir /tmp/iket-trace --clobber \ profile --postprocess all -- \ "$PWD/crates/rustc-codegen-cuda/examples/iket_trace/target/release/iket_trace"The current public profiling workflow depends on
nvidia-cutlass-dsl, whichprovides the
run-iketcommand. This is a profiler-time dependency: cuda-oxidedoes not link it into the generated application or vendor profiling binaries.
The default
run-iketflow performs a tracker pass, chooses the timestamp andcontext-buffer budgets, then captures the application in a second pass. The
example does not enable cluster launch or cluster filtering.
Validation
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacecargo oxide build iket_trace --materialize-cubin --arch sm_120__iket_meta_infoand the complete long event namerun-iket profile --postprocess allon an SM120 GPUThe capture contains one launch, 64 markers, 32 ranges, 32 warp lifetimes,
32 locations, and the complete long event name. It produces JSON, Perfetto,
compressed Perfetto, and HTML outputs.