-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[Compile] accelerate compilation speed using NVRTC #18519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
yzh119
reviewed
Dec 5, 2025
| Environment Variables | ||
| --------------------- | ||
| TVM_CUDA_COMPILE_MODE : str | ||
| Compiler backend: "nvcc" (default) or "nvrtc" |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not default to nvrtc?
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should cross check the speed diff and once confirmed, we can switch to nvrtc default
spectrometerHBH
approved these changes
Jan 8, 2026
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.
This PR supports NVRTC as an alternative to NVCC for faster, device-side JIT compilation of CUDA kernels, in favor of the PR apache/tvm-ffi#283.
It enhances the CUDA compilation backend by:
Users can choose the compilation backend using an environment variable
TVM_CUDA_COMPILE_MODE, choosing from "nvcc" and "nvrtc". For example,TVM_CUDA_COMPILE_MODE=nvrtc python3 your_program.pyHere is a short benchmark of the compilation speed of kernels in
test_target_codegen_cuda.py.NVCC vs NVRTC Compilation Time Comparison (Python-side Call)
test_crossthread_reduction1test_cuda_bf16_vectorize_addtest_cuda_const_float_to_halftest_cuda_device_func_calltest_cuda_float_const_hex_formattest_cuda_floordiv_with_vectorizationtest_cuda_inf_nantest_cuda_tensormaptest_cuda_thread_sync_inside_conditiontest_cuda_vectorize_addtest_cuda_vectorize_loadtest_device_host_call_same_functest_vectorized_intrin1NVSHMEM Support
Currently, NVSHMEM is not supported via NVRTC.
TVM_CUDA_COMPILE_MODEis set to nvrtc.