vllm-project / vllm-project/vllm

[Bug]: activation override in test_flashinfer_cutedsl_fp4_moe silently tests RELU2 for every parametrize case

Open
#56,504 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
91.8k
Forks
22.2k
PR merge metrics
PR metrics pending

Description

### Description

`tests/kernels/moe/test_flashinfer_cutedsl_nvfp4_moe.py::test_flashinfer_cutedsl_fp4_moe` is parametrized over `_ACT_CASES` (`silu`, `silu-clamp`, `relu2_no_mul`, `swigluoai`, `swigluoai_uninterleave`), but line 196 unconditionally overwrites the activation before it's used anywhere downstream:

```python
def test_flashinfer_cutedsl_fp4_moe(..., activation: MoEActivation, ...):
...
activation = MoEActivation.RELU2_NO_MUL # <-- overwrites the parametrized value
moe_config = FusedMoEConfig(..., activation=activation, ...)
fake_layer = SimpleNamespace(activation=activation, moe_config=moe_config)
...
# later:
...apply(..., activation=activation, ...) # kernel call
..._reference_activation(activation, alpha, beta, limit) # reference comparison
```

Every downstream use of `activation` -- the kernel invocation and the reference comparison -- reads this overwritten value, not the parametrized one. So every parametrize case actually exercises `RELU2_NO_MUL`, regardless of its test ID.

### Root cause

Introduced in #48355 ("feat: extended EPLB support for Mistral Large 3 and additional MoE backends"), which moved the `moe_config` construction earlier in the function (so `fake_layer.moe_config` is available sooner) and added this line alongside it. `activation` was already in scope as the function's own parametrized argument -- the reassignment appears to be leftover local-debugging code that wasn't needed for the refactor and was never removed before merge.

### Impact

Since #48355 landed, every case other than `relu2_no_mul` (`silu`, `silu-clamp`, `swigluoai`, `swigluoai_uninterleave`) provides **zero actual coverage** for its claimed activation -- it silently runs RELU2_NO_MUL instead.

### Verification

Confirmed by removing the override line and re-running all 5 parametrize cases: each one now exercises its own distinct activation and produces its own distinct, correct result, instead of all 4 non-`relu2_no_mul` cases converging on the same `relu2_no_mul` behavior/error as before the fix.

### Suggested fix

Delete the `activation = MoEActivation.RELU2_NO_MUL` line at 196 -- `activation` is already correctly bound from the function's `@pytest.mark.parametrize`.

---
*Found and root-caused with AI assistance (Claude Code) while investigating an unrelated test failure.*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.