From 8cea0473ea5299bc04885f8f6ba71269415a39b5 Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Tue, 2 Jun 2026 15:50:45 +0800 Subject: [PATCH] Fix dp-attention token alignment in the dumper comparator e2e test (#26996) --- .../debug_utils/test_engine_dumper_comparator_e2e.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/registered/debug_utils/test_engine_dumper_comparator_e2e.py b/test/registered/debug_utils/test_engine_dumper_comparator_e2e.py index 98ef9d7a0..383da8aa2 100644 --- a/test/registered/debug_utils/test_engine_dumper_comparator_e2e.py +++ b/test/registered/debug_utils/test_engine_dumper_comparator_e2e.py @@ -195,6 +195,14 @@ class TestSourcePatcherE2ESGLang: step has tokens on both DP ranks, which breaks the dp:=attn_dp single-rank assumption and causes comparator errors. + The ``concat_steps`` token aligner is required because dp-attention + gathers tokens across DP ranks before the dump point, so the + non-empty rank's buffer holds the real tokens plus padding tokens + contributed by the empty DP rank (with a single request one DP + rank is always empty). The aligner reconstructs the real per-step + token sequence from the dumped seq-lens, trimming that padding so + the target lines up with the un-padded TP baseline. + mlp_output is allowed to fail because the FusedMoE dispatcher combine path may include an implicit all-reduce that makes the dumped value differ from the raw partial expert output. All @@ -208,6 +216,8 @@ class TestSourcePatcherE2ESGLang: extra_target_server_args=["--dp", "2", "--enable-dp-attention"], target_patch_config_yaml=PATCH_CONFIG_DP_ATTENTION_YAML, extra_comparator_args=[ + "--token-aligner", + "concat_steps", "--end-step", "0", "--allow-failed-pattern",