[Bugfix][NPU] Fix MiniMax-H3 INT8 quantization dispatch (#6876)
Signed-off-by: KrystalRay <keeleiray@gmail.com> Co-authored-by: KrystalRay <keeleiray@gmail.com>
This commit is contained in:
1 parent
9b6a308914
commit
7be014bce6
3 files changed
+28
-1
No files matched your search
@@ -49,3 +49,29 @@ def test_qwen3_vl_npu_swiglu_matches_two_projection_reference() -> None:
|
||||
atol=2e-2,
|
||||
rtol=2e-2,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skipif(not current_omni_platform.is_npu(), reason="requires Ascend NPU")
|
||||
def test_qwen3_vl_npu_swiglu_forward_uses_projection_module(mocker) -> None:
|
||||
from vllm_omni.platforms.npu.models import minimax_h3
|
||||
from vllm_omni.platforms.npu.models.minimax_h3 import (
|
||||
_forward_minimax_h3_qwen3vl_text_mlp_npu,
|
||||
)
|
||||
|
||||
x = torch.randn(1, 16, 128, device="npu", dtype=torch.bfloat16)
|
||||
packed = torch.randn(1, 16, 256, device="npu", dtype=torch.bfloat16)
|
||||
activated = torch.randn(1, 16, 128, device="npu", dtype=torch.bfloat16)
|
||||
gate_up_proj = mocker.Mock(return_value=packed)
|
||||
down_proj = mocker.Mock(side_effect=lambda value: value)
|
||||
mlp = mocker.Mock(gate_up_proj=gate_up_proj, down_proj=down_proj)
|
||||
swiglu = mocker.patch.object(minimax_h3, "npu_swiglu_from_packed", return_value=activated)
|
||||
|
||||
output = _forward_minimax_h3_qwen3vl_text_mlp_npu(mlp, x)
|
||||
|
||||
gate_up_proj.assert_called_once()
|
||||
assert gate_up_proj.call_args.args[0] is x
|
||||
swiglu.assert_called_once()
|
||||
assert swiglu.call_args.args[0] is packed
|
||||
down_proj.assert_called_once()
|
||||
assert down_proj.call_args.args[0] is activated
|
||||
assert output is activated
|
||||
Reference in new issue
Block a user