Repository navigation
Conversation
The classic cuBLAS handle could abort during destruction when a host process loaded cuBLAS and cuBLASLt from different builds. Use the stream's cuBLASLt handle for f32 output and retain the 32 MiB workspace per stream. On L20, the f32 GEMM, pinned algorithm and FP8 tests passed. In a torch process without the compatibility symlinks, the baseline aborted while dropping the Qwen3-4B runtime and the new build exited successfully.
Use fixed-size arrays for the little-endian float reads so the test passes the chunks_exact_to_as_chunks lint on current stable Clippy.
xiaguan
self-requested a review
November 22, 2026 12:26
Contributor
|
Thanks for the clean change and thorough tests! Removing the classic For the underlying mixed-library / duplicate-mapping issue (where the process can still map two versions of Merging this now. |
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
When PyTorch has already loaded cuBLASLt 13.1 from its Python environment, kern can load the system's classic cuBLAS 13.0. With this mixed pair, destroying a classic handle bound to a non-default stream can free the same allocation twice and abort the host process.
Run
extern:cublas_bf16_tn_f32through the stream's existing cuBLASLt handle with FP32 output layouts and a 32 MiB workspace per stream. This removes classic cuBLAS handle creation and destruction from kern. In the tested environment, the process can still map both versions of cuBLASLt.Validation
On an NVIDIA L20 with PyTorch 2.14.0+cu130, both builds loaded the same Qwen3-4B
kern.Runtimeinside a PyTorch process. With the system CUDA library directory onLD_LIBRARY_PATH, and again withLD_LIBRARY_PATHempty, the baseline aborted during teardown with exit code 134. The patched build exited normally in both cases. Both builds exited normally with the compatibility symlinks in use.kern-runtimetests passed on Linux.K3 end-to-end numerical validation is pending.