-
Notifications
You must be signed in to change notification settings - Fork 449
[Dist][Release] Use one wheel for different CUDA version #1826
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
Open
oraluben
wants to merge
20
commits into
tile-ai:main
Choose a base branch
from
oraluben:update-nvruntime-stubs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+120
−116
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
617f25b
use nvrtc/cudart come with torch
oraluben 0df5a83
remove cuda 13 job
oraluben 6a81fdc
add assert
oraluben baf67ac
update error message
oraluben 3ba309b
resolve issues
oraluben 128b8c9
vibe doc
oraluben 342de95
Refactor CUDART and NVRTC API creation by removing null handle checks…
oraluben ea6e350
lint
oraluben 1b44c67
Merge branch 'main' into update-nvruntime-stubs
oraluben b4b9e6c
add env back
oraluben b1c7925
Add test against nightly torch
oraluben afe0d42
fix
oraluben 29c74fc
test with other torch
oraluben 60d4f6f
fix
oraluben 51e3975
fix
oraluben 74e8e57
fix
oraluben e41ae91
Print all version check at end
oraluben b8e0c3a
fix tvm
oraluben 9dec36b
Refactor CUDA and NVRTC stubs to improve version compatibility and la…
oraluben e4280b0
lint
oraluben File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # CUDA/CUDART/NVRTC Stubs | ||
|
|
||
| This document describes the stub mechanism in TileLang for CUDA-related libraries. | ||
|
|
||
| ## Purpose | ||
|
|
||
| 1. **CUDA Driver (`cuda`)**: Allows TileLang to be imported on systems without a GPU (e.g., CI/compilation nodes) by lazy-loading `libcuda.so` only when needed. | ||
| 2. **Runtime & Compiler (`cudart`, `nvrtc`)**: Resolves SONAME versioning mismatches, enabling a single build to work across different CUDA versions. This is achieved by reusing the existing CUDA runtime loaded by frameworks like PyTorch. | ||
|
|
||
| ## Implementation | ||
|
|
||
| The stubs in `src/target/stubs/` implement a lazy-loading mechanism: | ||
|
|
||
| - **Lazy Loading**: Libraries are loaded via `dlopen` only upon the first API call. | ||
| - **Global Symbol Reuse**: For `cudart` and `nvrtc`, the stubs first check the global namespace (`RTLD_DEFAULT`) to use any already loaded symbols (e.g., from PyTorch). | ||
| - **Versioning Support**: Handles ABI differences between CUDA versions (e.g., `cudaGraphInstantiate` changes in CUDA 12). | ||
|
|
||
| ## Build Option | ||
|
|
||
| `TILELANG_USE_CUDA_STUBS` (Default: `ON`) controls this behavior. When enabled, TileLang links against these stubs instead of the system CUDA toolkit. |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.