Support concat mode in token aligner in dump comparator (#19599)

This commit is contained in:
fzyzcjy
2026-03-01 10:35:50 +08:00
committed by GitHub
parent e78f1283f7
commit b0b26a7ef1
26 changed files with 1017 additions and 63 deletions
@@ -14,7 +14,7 @@ from sglang.srt.debug_utils.comparator.aligner.entrypoint.types import (
AlignerPerStepPlan,
AlignerPlan,
)
from sglang.srt.debug_utils.comparator.aligner.token_aligner.types import (
from sglang.srt.debug_utils.comparator.aligner.token_aligner.smart.types import (
TokenAlignerPlan,
TokenLocator,
)
@@ -234,6 +234,7 @@ class TestExecuteAlignerPlanWithTokenDim:
x=[self._make_step_plan(step=0, indices=[0])],
y=[self._make_step_plan(step=0, indices=[0])],
),
token_aligner_mode="smart",
token_aligner_plan=token_plan,
)
@@ -285,6 +286,7 @@ class TestExecuteAlignerPlanWithTokenDim:
x=[self._make_step_plan(step=0, indices=[0])],
y=[self._make_step_plan(step=0, indices=[0])],
),
token_aligner_mode="smart",
token_aligner_plan=token_plan,
)
@@ -143,6 +143,7 @@ class TestComputeAlignerPlan:
plan: AlignerPlan = compute_aligner_plan(
metas_pair=Pair(x=metas_x, y=metas_y),
token_aligner_mode=None,
token_aligner_plan=None,
)
@@ -151,7 +152,7 @@ class TestComputeAlignerPlan:
assert plan.token_aligner_plan is None
def test_preserves_token_aligner_plan(self) -> None:
from sglang.srt.debug_utils.comparator.aligner.token_aligner.types import (
from sglang.srt.debug_utils.comparator.aligner.token_aligner.smart.types import (
TokenAlignerPlan,
TokenLocator,
)
@@ -166,10 +167,12 @@ class TestComputeAlignerPlan:
plan: AlignerPlan = compute_aligner_plan(
metas_pair=Pair(x=[_make_meta()], y=[_make_meta()]),
token_aligner_mode="smart",
token_aligner_plan=ta_plan,
)
assert plan.token_aligner_plan is ta_plan
assert plan.token_aligner_mode == "smart"
class TestComputePerStepSubPlansThd: