Skip to content

fix(tilelib_relu): pass generated call_<decl> kernel names to link_ltoir - #1766

Merged
nihalpasham merged 3 commits into
NVIDIA:mainfrom
nihalpasham:fix/tilelib-relu-expected-kernels
Nov 9, 2026
Merged

nihalpasham merged 3 commits into
NVIDIA:mainfrom
nihalpasham:fix/tilelib-relu-expected-kernels

Conversation

@nihalpasham

@nihalpasham nihalpasham commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

What This PR Does

Passes the generated call_<decl> kernel entry names (call_relu, call_scale_in_place, call_warp_sum) to LtoLinker::link_ltoir in examples/tilelib_relu and ignores *.kernels sidecars in cuda-oxide/.gitignore:

  1. Expected Kernel List (crates/rustc-codegen-cuda/examples/tilelib_relu/src/main.rs)
  2. Sidecar Ignore Rule (cuda-oxide/.gitignore)

1. Matching caller.cu's Generated Entry Names in tilelib_relu

caller_source in tilelib_relu generates one __global__ wrapper kernel per callable #[tile_export] named call_<decl>. Passing exports.iter().map(|desc| format!("call_{}", desc.decl)) to LtoLinker::link_ltoir matches the actual cubin entry table:

BEFORE (#1367):
  link_ltoir(..., &["caller"])
  ──► fails at runtime: `missing expected kernel(s) ["caller"] (3 entry point(s) present)`

AFTER:
  expected_kernels = ["call_relu", "call_scale_in_place", "call_warp_sum"]
  ──► `link_ltoir` verifies all 3 generated wrapper kernels in the linked cubin

Verification

  • cargo oxide run tilelib_relu --emit-nvvm-ir --arch sm_100: PASS (3/3 tile exports verified through the native ABI)
  • cargo clippy --manifest-path cuda-oxide/crates/rustc-codegen-cuda/examples/tilelib_relu/Cargo.toml --all-targets -- -D warnings: PASS
  • rustfmt --check --edition 2024 cuda-oxide/crates/rustc-codegen-cuda/examples/tilelib_relu/src/main.rs: PASS

PR NVIDIA#1367 added expected-kernel verification to `LtoLinker::link_ltoir`,
but hardcoded `&["caller"]` in `tilelib_relu` based on the `caller.ltoir`
filename. `caller_source` actually emits one `__global__` entry point per
callable `#[tile_export]` named `call_<decl>` (`call_relu`,
`call_scale_in_place`, `call_warp_sum`), causing `link_ltoir` to reject
the linked Cubin for missing `"caller"`.

Build the expected kernel list from `exports` (`call_<decl>`) and also
ignore generated `*.kernels` sidecar files in `cuda-oxide/.gitignore`.

Signed-off-by: nihalpasham <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Nov 9, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@nihalpasham nihalpasham added cuda-oxide SIMT programming model: rustc backend, cargo oxide, cuda-device, cuda-host, book bug Something isn't working tests Adds or improves test coverage labels Nov 9, 2026
@nihalpasham

Copy link
Copy Markdown
Collaborator Author

/ok to test 3660422

@nihalpasham

Copy link
Copy Markdown
Collaborator Author

/ok to test aef7138

@nihalpasham
nihalpasham merged commit a0a4dc7 into NVIDIA:main Nov 9, 2026
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda-oxide SIMT programming model: rustc backend, cargo oxide, cuda-device, cuda-host, book tests Adds or improves test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant