[None][fix] Pin kimiK3AttnRes to the sm_100 family - #17085
Merged
brnguyen2 merged 1 commit intoJul 30, 2026
Conversation
attnResFwd.cu guards its tcgen05/TMEM code paths with `__CUDA_ARCH__ >= 1000`,
which also admits sm_120. The target inherited the global architecture list, so
builds that include sm_120f emitted tcgen05 PTX for it and ptxas rejected it:
Instruction 'tcgen05.st' not supported on .target 'sm_120f'
Feature '.32x32b' not supported on .target 'sm_120f'
Pin the object target to the sm_100 family with set_cuda_architectures(), the
same pattern other architecture-specific kernel targets use, and tighten the
Torch-op capability check from major >= 10 to major == 10 so unsupported
devices get a clear error instead of a missing-kernel-image launch failure.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
Collaborator
Author
|
/bot run |
Collaborator
|
PR_Github #62871 [ ] completed with state |
1 task
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.
@coderabbitai summary
Description
The x86_64 wheel build fails for any build whose CUDA architecture list includes
sm_120f:cpp/tensorrt_llm/kernels/kimiK3AttnRes/attnResFwd.cuis warp-specialized for the sm_100 (datacenter Blackwell) family and usestcgen05/TMEM PTX. Its code paths are guarded with__CUDA_ARCH__ >= 1000, which also admits sm_120 (__CUDA_ARCH__ == 1200), so those instructions are emitted for an architecture that does not support them. Because the object target inherited the global architecture list rather than declaring its own, every build containing sm_120f hit this. Architectures below sm_100 were unaffected: the guards exclude the tcgen05 paths entirely, so the helpers are never emitted.This blocks the build for all pull requests targeting
feat/kimi_k3.Two changes:
cpp/tensorrt_llm/kernels/kimiK3AttnRes/CMakeLists.txt— pin the object target withset_cuda_architectures(kimi_k3_attn_res_src 100f), the same mechanism other architecture-specific kernel targets use (for examplefp4_gemm_src,marlin_src). On a build with no sm_100-family architecture the helper falls back to its placeholder path, which is safe here because the guards already exclude the tcgen05 code.cpp/tensorrt_llm/thop/attnResOp.cpp— the kernel binary now exists only for the sm_100 family, so the capability check requires compute capability major== 10rather than>= 10. An sm_120 device now gets a clearTORCH_CHECKmessage instead of a missing-kernel-image launch failure. The helper is renamedis_sm100_family()to match its meaning.Test Coverage
Compiled
attnResFwd.cudirectly with CUDA 13.2 across an architecture matrix, before and after the change:sm_80sm_90sm_100fsm_120ftcgen05.st/.32x32brejected)The compile matrix was run on an aarch64 host; device-side PTX generation and
ptxasvalidation are independent of the host architecture, so this reproduces the failure seen in x86_64 builds. The CI build on this PR exercises the full x86_64 wheel path.PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.