fix(aiter): use tuned GEMM for unquantized linear with torchao compatibility guard#20889
Closed
michaelzhang-ai wants to merge 1 commit intosgl-project:mainfrom
Closed
fix(aiter): use tuned GEMM for unquantized linear with torchao compatibility guard#20889michaelzhang-ai wants to merge 1 commit intosgl-project:mainfrom
michaelzhang-ai wants to merge 1 commit intosgl-project:mainfrom
Conversation
…ibility guard Add aiter's tuned_gemm (tgemm.mm) for unquantized linear operations on AMD HIP GPUs, guarded by a strict type check so it only activates on plain tensors. Torchao-quantized weights (AffineQuantizedTensor) fall through to F.linear, preventing NotImplementedError on aiter.gemm_a16w16.
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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.
Motivation
AMD CI sets
SGLANG_USE_AITER=1globally for all tests. When aiter'stgemm.mm(which callsaiter.gemm_a16w16) is used for unquantized linear operations, it crashes on models quantized by torchao (e.g.int4wo-128,fp8wo) becauseAffineQuantizedTensordoesn't support theaiter.gemm_a16w16dispatch:This was surfaced by PR #20392 (shard 10:
test_torchao.pyfailure in CI run).Modifications
tgemmfromaiter.tuned_gemmwhenSGLANG_USE_AITER=1tgemm.mmfast path inUnquantizedLinearMethod.applyfor AMD GPUs, guarded bytype(layer.weight.data) is torch.Tensorto ensure it only activates on plain tensorsAffineQuantizedTensor, atorch.Tensorsubclass) will fail the stricttype()check and correctly fall through toF.linearChecklist