fix: detect GPU arch automatically for kernel building#169
Open
Dogacel wants to merge 2 commits into
Open
Conversation
Signed-off-by: Doğaç Eldenk <dogacel@gmail.com>
cc66eee to
b738115
Compare
borontion
reviewed
May 17, 2026
| for cap in caps: | ||
| cap = cap.strip() | ||
| if cap: | ||
| archs.add(self._normalize_cuda_arch(cap + "a")) |
Contributor
There was a problem hiding this comment.
why there is a suffix "a" here - cap + "a". shouldn't it be handled by _normalize_cuda_arch?
Author
There was a problem hiding this comment.
I am a bit confused, it seems like we can remove.
The goal was to get sm100a, sm90a, sm120a etc. The normalize does,
suffix = "a" if has_suffix or major >= 9 else ""
return f"{major}{minor}{suffix}"
So it will always has "a", BUT when I tried to compile tokenspeed on sm80, I never succeeded so I couldn't test.
So just removing it should result in identical code for supported architectures, I'll do that.
Contributor
There was a problem hiding this comment.
Hi we don’t plan to support sm80
Signed-off-by: Doğaç Eldenk <dogacel@gmail.com>
aa04d70 to
9044eb1
Compare
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
Detect GPU architecture automatically while building
tokenspeed-kernel.Test Plan
[ts] RuntimeError: Check failed: (status == cudaSuccess) is false: BatchQKApplyRotaryPosIdsCosSinCacheEnhanced failed with error code no kernel image is available for execution on the devicewhile running gpt-oss-20b.pip install -e tokenspeed-kernel/python/ --no-build-isolation. The GPU architecture is automatically detected without settingFLASHINFER_CUDA_ARCH_LISTorTOKENSPEED_CUDA_ARCH(which also fixes the issue).