Repository navigation
Expose ptxas resource diagnostics from native finalization - #756
Merged
Merged
Conversation
This was referenced Aug 9, 2026
uurl
force-pushed
the
feat/ptxas-resource-report-708
branch
2 times, most recently
from
August 9, 2026 10:41
eb68a24 to
8a00bfc
Compare
Signed-off-by: Raul Estrada <[email protected]>
uurl
force-pushed
the
feat/ptxas-resource-report-708
branch
from
August 9, 2026 10:51
8a00bfc to
f02d68c
Compare
…OPTION Expose NvJitLinkError::is_unrecognized_option() so callers passing optional, non-semantic options can detect an older nvJitLink that predates them and retry without them. The result code is checked live against the installed toolkit by a new ignored test that feeds nvJitLinkCreate a bogus option. Signed-off-by: Nihal Pasham <[email protected]>
…inated kernel names Capture the 'N bytes stack frame' figure that sits on the same ptxas 'Function properties' line as the spill counters: local-memory frame size is distinct from spill traffic and issue NVIDIA#707's census needs it. Also unwrap kernel names in log shapes that terminate the line with a colon after a quoted name ("Function properties for '_Z3fooPi':"), which previously left a stray ': suffix on the parsed name. Signed-off-by: Nihal Pasham <[email protected]>
…nized diagnostic options Early 12.x nvJitLink versions reject options they do not know with NVJITLINK_ERROR_UNRECOGNIZED_OPTION, which would fail the whole link just because the caller asked for a best-effort report. When the with-report link fails that way, retry once without the diagnostic flags and return the linked image with an empty report. The retry runs inside the same revalidated-tool-identity window as the first attempt, and the plain link path is unaffected. Signed-off-by: Nihal Pasham <[email protected]>
…ecting a resource report Observed live on CUDA 13.3: a warm nvJitLink link serves the cubin from its own JIT cache, skips ptxas entirely, and replays no info log, so link_ltoir_with_report silently returned an empty resource report on every repeat link. Add -no-cache to the cubin diagnostic option set so the report always observes a real compile. The produced image bytes are identical, and the flag stays out of artifact digests with the other reporting options. Signed-off-by: Nihal Pasham <[email protected]>
…t format Add an ignored live test in the crate's live_tests style: build legacy-dialect NVVM IR for a kernel that must spill (64 mutually entangled live floats under a maxnreg=32 cap), compile it to LTOIR, link with link_ltoir_with_report, and assert the info log is present and parses to plausible register, stack-frame, and spill figures. The generated IR anchors the kernel with @llvm.used exactly as cuda-oxide's NVVM exporter does; without it nvJitLink dead-strips the kernel and the log carries no resource lines. On this host (CUDA 13.3, sm_86 target) the log reads: ptxas info : Compiling entry function 'spill_kernel' for 'sm_86' ptxas info : Function properties for spill_kernel ptxas . 360 bytes stack frame, 476 bytes spill stores, 584 bytes spill loads ptxas info : Used 32 registers, ... and parses to registers=32, stack_frame=360, spills=476/584. Signed-off-by: Nihal Pasham <[email protected]>
Collaborator
|
Gist: this is the right layer for a build-time resource report. I pushed five commits on top:
Verified here with CUDA 13.3:
Merging. Partially addresses #708, the warning itself lands with #757; related to #707. Follow-up we'll file: the crate's pre-existing live test has been validating an empty module all along, its NVVM IR lacks |
nihalpasham
approved these changes
Aug 10, 2026
nihalpasham
added a commit
to lucifer1004/cuda-oxide
that referenced
this pull request
Aug 10, 2026
Resolves the overlap with NVIDIA#756's resource-diagnostics refactor: the PTX route now threads input_type through main's run_link core, so the unrecognized-option fallback and LinkReport plumbing cover both input kinds, and run_link selects the LTOIR or PTX option set by input type. The diagnostic-separation test asserts against both option sets. Validated: crate + nvjitlink-sys unit tests, all live tests on RTX 5090 / CUDA 13.3 (including the PTX pipeline and the spilling-kernel resource report), fmt, clippy -D warnings. Signed-off-by: nihalpasham <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #708
Summary
Adds structured access to
ptxasresource diagnostics produced during nvJitLink finalization.This is the first part of #708. It provides the resource-reporting infrastructure needed for a later change to warn when kernels compiled with
#[launch_bounds]spill registers.Changes
preserve the nvJitLink informational log alongside linked cubin/PTX output;
request verbose nvJitLink /
ptxasreporting when resource diagnostics are explicitly collected;parse per-kernel:
expose the parsed resource data through
LinkReport;keep diagnostic-only nvJitLink options separate from semantic link options so they do not affect provenance or artifact cache keys.
Existing
finish,finish_ptx, and normal finalization APIs retain their previous behavior.Testing
Added unit coverage for:
Validated with:
All checks pass.