Repository navigation
[Online quantization] Support activation quant key override - #51808
fxmarty-amd wants to merge 13 commits 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.
There was a problem hiding this comment.
Fixed in 7846c2061c808d9757b550d3d2358ff9694fb40e
| """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?
There was a problem hiding this comment.
Do you mean why does None represent unquantized activation? Not certain about this, there has historically been no QuantKey as kUnquantized for example.
This would indeed allow to represent "unset" as None, rather. But I think it'd be a broader refactor as current vLLM codebase considers None to be unquantized.
There was a problem hiding this comment.
oh I was thinking to add the enum kUnset, for kernel to use for their default behavior. So they don't clobber with None. Not sure if that's good idea. Let's raise this in next sig meeting.
|
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.
|
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
…antiation, as different layers may have different act key Signed-off-by: Felix Marty <Felix.Marty@amd.com>
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
|
This pull request has merge conflicts that must be resolved before it can be |
|
will wait for #51392 first. |
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
|
Hi @fxmarty-amd, the pre-commit checks have failed. Please run: uv pip install pre-commit>=4.5.1
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, |
Signed-off-by: Felix Marty <Felix.Marty@amd.com>
|
This pull request has merge conflicts that must be resolved before it can be |
BowenBao
left a comment
There was a problem hiding this comment.
LGTM, missed the approval stamp last time.
Purpose
Support activation quant key override in online quantization as e.g.:
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
TODO in an other PR:
__str__method to QuantKey directly.Test Plan
pytest tests/quantization/test_quantization_config_args.py -s -vvvvvpytest tests/quantization/test_online.py -s -vvvvvExample usage on MI350:
VLLM_ROCM_USE_AITER=1 vllm serve Qwen/Qwen3.5-35B-A3B \ --quantization online \ --quantization-config.targets '{"*experts*":{"weight":"mxfp4","activation":null}}' \ --tensor-parallel-size 1showing:
Test Result
Passing on MI350