feat: add CUDA 13.2 support via cudarc 0.19.4#312
Merged
Conversation
Fixes luminal-ai#291 Changes: - Upgrade cudarc from 0.18.2 to 0.19.4 - Remove get_global call for __constant__ memory tracking Rationale: cudarc 0.19.0 changed get_global to return CudaViewMut instead of CudaSlice to prevent double-free of __constant__ memory managed by the CUDA module. The old code worked around this by storing the CudaSlice and calling std::mem::forget on cleanup. With the new API, the view's lifetime is tied to the module borrow, making the workaround unnecessary. Since the constants HashMap was only used for this workaround and never accessed otherwise, we now return an empty HashMap. CUDA 13.2 support was added in cudarc 0.19.4.
The cudarc 0.18→0.19 bump removed get_global, but simply dropping the call left __constant__ memory declared-but-never-written, producing wrong results for models with dynamic-shape embeddings. Migrate to the same dyn_dims parameter + #define pattern every other kernel uses.
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
dyn_dimsbuffer instead of per-operation allocations, aligning with cudarc 0.19.4 API changesFixes #291
Test plan