Skip to content

Commit 0a7f629

Browse files
committed
[None][test] Add stock Qwen3.8-Flash-Next accuracy cases for FP8 and NVFP4 KV caches
Cover the two layouts where a K/V page is the size of a QSA index-K page: TEP4 with an FP8 KV cache (one KV head per rank) and attention-DP ADP4 with an NVFP4 KV cache (two KV heads per rank), both on the NVFP4 checkpoint without MTP. The cases go into the QA function list only. GSM8K and MMLU references were measured on GB300 with TRTLLM_ACCURACY_NO_REFERENCE=1: 95.49/87.33 for TEP4 FP8 KV and 96.02/87.21 for ADP4 NVFP4 KV. Signed-off-by: Wanli Jiang <35160485+Wanli-Jiang@users.noreply.github.com>
1 parent 9413aa0 commit 0a7f629

4 files changed

Lines changed: 66 additions & 0 deletions

File tree

‎tests/integration/defs/accuracy/references/gsm8k.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,16 @@ Qwen/Qwen3.8-Flash-Next:
311311
kv_cache_quant_algo: NVFP4
312312
spec_dec_algo: MTP
313313
accuracy: 95.26
314+
# FP8 KV cache, measured on the built-in implementation: TEP4 on GB300, no MTP,
315+
# TRTLLM MoE, bf16 Mamba SSM cache.
316+
- quant_algo: MIXED_PRECISION
317+
kv_cache_quant_algo: FP8
318+
accuracy: 95.49
319+
# NVFP4 KV cache, measured on the built-in implementation: ADP4 on GB300, no MTP,
320+
# TRTLLM MoE, bf16 Mamba SSM cache.
321+
- quant_algo: MIXED_PRECISION
322+
kv_cache_quant_algo: NVFP4
323+
accuracy: 96.02
314324
moonshotai/Kimi-K2.5:
315325
- quant_algo: NVFP4
316326
kv_cache_quant_algo: FP8

‎tests/integration/defs/accuracy/references/mmlu.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ Qwen/Qwen3.8-Flash-Next:
136136
- quant_algo: MIXED_PRECISION
137137
spec_dec_algo: MTP
138138
accuracy: 87.57
139+
# FP8 KV cache, measured on the built-in implementation: TEP4 on GB300, no MTP,
140+
# TRTLLM MoE, bf16 Mamba SSM cache.
141+
- quant_algo: MIXED_PRECISION
142+
kv_cache_quant_algo: FP8
143+
accuracy: 87.33
144+
# NVFP4 KV cache, measured on the built-in implementation: ADP4 on GB300, no MTP,
145+
# TRTLLM MoE, bf16 Mamba SSM cache.
146+
- quant_algo: MIXED_PRECISION
147+
kv_cache_quant_algo: NVFP4
148+
accuracy: 87.21
139149
Qwen/Qwen3.5-397B-A17B:
140150
- quant_algo: NVFP4
141151
kv_cache_quant_algo: FP8

‎tests/integration/defs/accuracy/test_llm_api_pytorch.py‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6043,6 +6043,50 @@ def test_nvfp4_adp4_megamoe_cutedsl_ple_offload(
60436043
moe_expert_parallel_size=4,
60446044
enable_attention_dp=True)
60456045

6046+
@skip_pre_blackwell
6047+
@pytest.mark.skip_less_device(4)
6048+
@pytest.mark.skip_less_device_memory(70000)
6049+
@pytest.mark.skip_less_host_memory(131072)
6050+
def test_nvfp4_tep4_fp8kv_trtllm_ple_offload(
6051+
self, monkeypatch: pytest.MonkeyPatch, mocker) -> None:
6052+
"""NVFP4 with TEP4 and an FP8 KV cache.
6053+
6054+
Each rank holds one KV head, so an FP8 K/V page is the size of a QSA
6055+
index-K page.
6056+
"""
6057+
self._run_evals(f"{llm_models_root()}/Qwen3.8-Flash-Next-NVFP4",
6058+
tensor_parallel_size=4,
6059+
moe_backend="TRTLLM",
6060+
max_draft_len=None,
6061+
expected_quant_algo=QuantAlgo.MIXED_PRECISION,
6062+
monkeypatch=monkeypatch,
6063+
mocker=mocker,
6064+
moe_expert_parallel_size=4,
6065+
kv_cache_dtype="fp8")
6066+
6067+
@skip_pre_blackwell
6068+
@pytest.mark.skip_less_device(4)
6069+
@pytest.mark.skip_less_device_memory(70000)
6070+
@pytest.mark.skip_less_host_memory(131072)
6071+
def test_nvfp4_adp4_nvfp4kv_trtllm_ple_offload(
6072+
self, monkeypatch: pytest.MonkeyPatch, mocker) -> None:
6073+
"""NVFP4 on four GPUs with attention DP and an NVFP4 KV cache.
6074+
6075+
Each rank holds both KV heads, so an NVFP4 K/V page is the size of a
6076+
QSA index-K page. QSA attention runs on the regular backend for an
6077+
NVFP4 KV cache.
6078+
"""
6079+
self._run_evals(f"{llm_models_root()}/Qwen3.8-Flash-Next-NVFP4",
6080+
tensor_parallel_size=4,
6081+
moe_backend="TRTLLM",
6082+
max_draft_len=None,
6083+
expected_quant_algo=QuantAlgo.MIXED_PRECISION,
6084+
monkeypatch=monkeypatch,
6085+
mocker=mocker,
6086+
moe_expert_parallel_size=4,
6087+
enable_attention_dp=True,
6088+
kv_cache_dtype="nvfp4")
6089+
60466090

60476091
@pytest.mark.skip_less_device_memory(80000)
60486092
class TestQwen3_8_27B(LlmapiAccuracyTestHarness):

‎tests/integration/test_lists/qa/llm_function_core.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ accuracy/test_llm_api_pytorch.py::TestQwen3_8_Flash_Next::test_fp8_adp4_mtp3_pre
610610
accuracy/test_llm_api_pytorch.py::TestQwen3_8_Flash_Next::test_nvfp4_1gpu_cutedsl_ple_offload
611611
accuracy/test_llm_api_pytorch.py::TestQwen3_8_Flash_Next::test_nvfp4_adp4_mtp3_trtllm_ple_offload
612612
accuracy/test_llm_api_pytorch.py::TestQwen3_8_Flash_Next::test_nvfp4_adp4_megamoe_cutedsl_ple_offload
613+
accuracy/test_llm_api_pytorch.py::TestQwen3_8_Flash_Next::test_nvfp4_adp4_nvfp4kv_trtllm_ple_offload
614+
accuracy/test_llm_api_pytorch.py::TestQwen3_8_Flash_Next::test_nvfp4_tep4_fp8kv_trtllm_ple_offload
613615
accuracy/test_llm_api_pytorch.py::TestSeedOss_36B::test_auto_dtype
614616
accuracy/test_llm_api_pytorch.py::TestStep3p7SpeculativeDecoding::test_guided_decoding TIMEOUT (60)
615617
accuracy/test_llm_api_pytorch.py::TestStep3p7SpeculativeDecoding::test_step3p7_mtp TIMEOUT (60)

0 commit comments

Comments
 (0)