[ROCm][Perf] Use flydsl moe with Minimax-M3 mxfp8 weights on gfx950 and implemented moe-backend selection - #46184
Conversation
|
the backend selection test result: Smoke prompt
|
|
working to get ep support. |
|
can you try fixing this test? CI #73688 |
|
Taking a closer look, this PR will break existing code as |
| # Re-tag the preshuffled weights: replace_parameter drops the | ||
| # is_shuffled flag, without which aiter picks a broken CK kernel. | ||
| w1.is_shuffled = True | ||
| w2.is_shuffled = True |
There was a problem hiding this comment.
Is it really the correct place to do that?
There was a problem hiding this comment.
Should it not be the role of a function similar to
.There was a problem hiding this comment.
Thanks for pointing this out. I am current revising the existing design to see how we could best address this in vLLM framework.
Regarding to this, historically we do not need to modify the property of the parameter tensors.
So, if you look at the convert_to_nvfp4_moe_kernel_format and other variant of conversion functions, the kernels are returning tensors. Then in the last step of the weight loading process, we are copying the tensors back into a new set of tensor object torch.Parameters . So current abstraction is not fully bullet proof. There are a few PRs has been mentioning that tensor properties and even layout information are discarded and missing at the end of the parameter instantiation. So, for now, the safest place is to add this w1.is_shuffled = True here in function itself of mxfp8 path specifically.
| @@ -0,0 +1,170 @@ | |||
| # SPDX-License-Identifier: Apache-2.0 | |||
There was a problem hiding this comment.
I think having a new experts class is fine.
It seems up to now https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/layers/fused_moe/experts/rocm_aiter_moe.py was already eventually calling into rocm_aiter_ops.fused_moe through some if/elif/else.
the PR bumping aiter to v0.1.16.post2 #46692 has landed |
|
I have run the unit tests locally for the amd-kernels-quantization-test-1-mi325-1 and amd-kernels-quantization-test-2-mi325-1, which are all passed. Don't think there is anything blocking this PR from merged. cc @tjtanaa |
Signed-off-by: Hongxia Yang <hongxia.yang@amd.com>
Head branch was pushed to by a user without write access
Co-authored-by: Tan Pin Siang <tanpinsiang@gmail.com> Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com>
…nd implemented moe-backend selection (vllm-project#46184) Signed-off-by: Hongxia Yang <hongxia.yang@amd.com> Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: TJian <tunjian.tan@embeddedllm.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Tan Pin Siang <tanpinsiang@gmail.com>
…nd implemented moe-backend selection (vllm-project#46184) Signed-off-by: Hongxia Yang <hongxia.yang@amd.com> Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: TJian <tunjian.tan@embeddedllm.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Tan Pin Siang <tanpinsiang@gmail.com>
…nd implemented moe-backend selection (vllm-project#46184) Signed-off-by: Hongxia Yang <hongxia.yang@amd.com> Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: TJian <tunjian.tan@embeddedllm.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Tan Pin Siang <tanpinsiang@gmail.com> Signed-off-by: Ayushman Paul <ayushman@HP.>
…nd implemented moe-backend selection (vllm-project#46184) Signed-off-by: Hongxia Yang <hongxia.yang@amd.com> Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: TJian <tunjian.tan@embeddedllm.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Tan Pin Siang <tanpinsiang@gmail.com> Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
…nd implemented moe-backend selection (vllm-project#46184) Signed-off-by: Hongxia Yang <hongxia.yang@amd.com> Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: TJian <tunjian.tan@embeddedllm.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Tan Pin Siang <tanpinsiang@gmail.com>
…nd implemented moe-backend selection (vllm-project#46184) Signed-off-by: Hongxia Yang <hongxia.yang@amd.com> Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: TJian <tunjian.tan@embeddedllm.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Tan Pin Siang <tanpinsiang@gmail.com>
…nd implemented moe-backend selection (vllm-project#46184) Signed-off-by: Hongxia Yang <hongxia.yang@amd.com> Signed-off-by: tjtanaa <tunjian.tan@embeddedllm.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: TJian <tunjian.tan@embeddedllm.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: Tan Pin Siang <tanpinsiang@gmail.com>
Purpose
[ROCm][Perf] Use flydsl moe with Minimax-M3 mxfp8 weights on gfx950
aiter's flydls moe has shown perf improvement on various scenrios on mxfp8 serving on gfx950. This PR is to integrate the
support, and also have the capability to fall back to triton mxfp8 dot-scaled implementation.
Implementation and usability decisions:
Reused moe-backend aiter and triton, and refactored the moe selection logic.
Gating (the usability decision): enable FlyDSL via
Reason is the AITER master flag can cause lots of env needing to be disabled.
For the triton backend, added support to choose triton-native dot-scaled backend via:
--moe-backend triton-native
Added ep support in the flydsl backend as well.
Note: To invoke this aiter's flydsl moe backend, it needs to have aiter to include flydsl commit (ROCm/aiter#3811).
Thanks for the feedback from Bowen and TJ.
Test Plan
use nightly as base, updated aiter.
run benchmarking and accuracy.
regression:
use nightly which does not have aiter's flydsl, make sure regression works.
added a unit test for expected backend selection behavior.
Test Result
Sample vllm serve command:
8k-in / 1k-out, sweep concurrency
**1k-in / 1k-out (decode-weighted) **
eval
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.