[Online quantization] Support activation quant key override - #51808
[Online quantization] Support activation quant key override#51808fxmarty-amd wants to merge 1 commit into
Conversation
|
Documentation preview: https://vllm--51808.org.readthedocs.build/en/51808/ |
BowenBao
left a comment
There was a problem hiding this comment.
Nice. Left some questions / comments. Overall looks good
| checkpoint-specific; today this is wired up for MXFP4 MoE checkpoints | ||
| (gpt-oss) where you can opt into FP8 activations: |
There was a problem hiding this comment.
Probably offtopic, does this only support gpt-oss for now? if not let's extend the description here with other mxfp4 models (kimi k3, deepseek v4) and other quantizers (quark, etc)
There was a problem hiding this comment.
Updated, this should read as "weight quantization dtype specific" (weight quant key), this previous doc is outdated.
Note however that some linear/MOE oracles do NOT support activation quant key, see e.g.
| ) -> Mxfp8LinearKernel: | ||
| """Select and instantiate the best MXFP8 linear kernel for the | ||
| current platform.""" | ||
| if activation_quant_key not in (None, kMxfp8Dynamic): |
There was a problem hiding this comment.
Is it sound to use None as no change to default? Not sure if other places use None to represent BF16.
There was a problem hiding this comment.
also how is the default activation quant key for each quant method documented / decided?
There was a problem hiding this comment.
This is a good point. Historically, None represents "no quantization"/BF16, see:
vllm/vllm/config/quantization.py
Lines 25 to 36 in 75dde08
However we do need to distinguish between a default None (currently on main):
vllm/vllm/config/quantization.py
Lines 65 to 73 in 75dde08
and user-set --quantization-config {"linear": {"activation": "null"}}, this is why weight: QuantKeyField = _UNSET, activation: QuantKeyField = _UNSET is introduced in this PR, and used in https://github.com/fxmarty-amd/vllm/blob/7846c2061c808d9757b550d3d2358ff9694fb40e/vllm/config/quantization.py#L97-L110
There was a problem hiding this comment.
any reason not to create a dedicated enum for unset?
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
2531578 to
6e18cbc
Compare
|
✅ @fxmarty-amd, CI is now available for this PR.
|
BowenBao
left a comment
There was a problem hiding this comment.
LG overall. I have some small comments and a question about UNSET and default.
| ) -> Mxfp8LinearKernel: | ||
| """Select and instantiate the best MXFP8 linear kernel for the | ||
| current platform.""" | ||
| if activation_quant_key not in (None, kMxfp8Dynamic): |
There was a problem hiding this comment.
any reason not to create a dedicated enum for unset?
There was a problem hiding this comment.
merge issue? unrelated changes and many other files with log2_lse_to_ln function
| weight_key: "QuantKey | None" = None, | ||
| activation_key: "QuantKey | None" = None, | ||
| activation_key: "QuantKey | None", | ||
| weight_key: "QuantKey", |
|
This pull request has merge conflicts that must be resolved before it can be |
Purpose
Support
--quantization online --quantization-config.moe.activation xyzAPI.Currently, activation override for online quantization raises a
NotImplementedError, but overriding the activation quant key is truly needed to dispatch on preferred MOE backends (e.g.AITER_MXFP4_BF16,AITER_MXFP4_MXFP4,AITER_MXFP4_FP8) that can not be selected in any other way.More context at #52167
Test Plan
pytest tests/quantization/test_quantization_config_args.py -s -vvvvvpytest tests/quantization/test_online.py -s -vvvvvTest Result
Passing on MI350