Repository navigation
Conversation
cutile picks tileiras from CUDA_TOOLKIT_PATH (then CUDA_HOME, then the
default install locations), but tileiras itself loads libNVVM and ptxas
through CUDA_HOME / CUDA_PATH. With CUDA_TOOLKIT_PATH naming one CUDA
release and an inherited CUDA_HOME another, a 13.4 tileiras ran against
the older libNVVM, and kernels with tcgen05 MMA aborted in LLVM's
verifier ("Intrinsic has incorrect argument type!").
When the binary being run is the one resolved through a toolkit root,
spawn it with CUDA_HOME set to that root and CUDA_PATH removed. A
CUTILE_TILEIRAS_PATH override and a bare PATH lookup keep the inherited
environment, since cutile does not know which toolkit they belong to.
Refs NVIDIA#1635
Signed-off-by: 0z5a <dezhen.lu@student.uni-tuebingen.de>
This branch has not been deployed
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.
Summary
cutile picks
tileirasfromCUDA_TOOLKIT_PATH(thenCUDA_HOME, then the default install locations), buttileirasloads libNVVM andptxasthroughCUDA_HOME/CUDA_PATH. WhenCUDA_TOOLKIT_PATHnames one CUDA release and an inheritedCUDA_HOMEnames another, the selectedtileirasruns against the other release's libNVVM. Kernels with tcgen05 MMA then abort in LLVM's verifier (#1635). This PR runs a toolkit-resolvedtileiraswithCUDA_HOMEset to the toolkit it came from andCUDA_PATHremoved.Refs #1635 (this is fix 1 from the issue; the docs note, fix 3, is not included).
Changes
cutile-compiler/src/cuda_tile_runtime_utils.rs:toolkit_root_for(tileiras)returns the toolkit root that the current environment resolvestileirasthrough, but only when the binary about to run is that resolved binary.tileiras_command(tileiras, toolkit)setsCUDA_HOME=<root>and removesCUDA_PATHwhen a root is known.run_tileiras_atuses it for the compile invocation.CUTILE_TILEIRAS_PATHoverride, a barePATHlookup, and a binary from an earlier environment keep the inherited environment unchanged. For those, cutile does not know which toolkit the binary belongs to.--versionand--list-versionsprobes do not load libNVVM and are unchanged. The fallback compile probes for assemblers without--list-versionsare also unchanged.tileiras_command_sets_cuda_home_only_for_a_toolkit_binary: inspectsCommand::get_envs.toolkit_tileiras_compiles_against_its_own_toolkit: a fake toolkit'stileirasrecords theCUDA_HOME/CUDA_PATHit sees. WithCUDA_TOOLKIT_PATH=<toolkit>,CUDA_HOME=<other>andCUDA_PATH=<other>, it gets<toolkit>|unset. Through aCUTILE_TILEIRAS_PATHoverride it gets the caller's<other>|<other>.Testing
End to end, the
gemmbenchmark binary (--features smoke-test), withCUTILE_TILEIRAS_PATHunset andCUDA_TOOLKIT_PATHpointing at a 13.4 tile toolchain (tileiras,ptxasand libNVVM 13.4.92). Before = main, after = this branch:On GH200 (aarch64):
cargo fmt --all --check: clean.cargo clippy -p cutile-compiler --all-targets -- -D warnings: clean.cargo clippy --workspace --exclude cuda-tile-rs --all-targets(the CI command): exit 0. No warnings in the changed file; the two warnings it prints are in other files and predate this change.cargo test -p cutile-compiler --lib: 149 passed (147 + 2 new).With only the call site reverted to the inherited environment, the new end-to-end test fails as expected:
just -f cuda-oxide/Justfile checkpasses (cutile-only change; ran the cutile fmt/clippy/tests above instead)the gemm benchmark passes on B300 and GH200 after the change (it failed before, as shown above)
New example added (not applicable)
Checklist
git commit -s)