Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
618 commits
Select commit Hold shift + click to select a range
079cf62
fix: use realistic single-rank and moe_dp scenarios in E2E tests
fzyzcjy Feb 28, 2026
80804f4
refactor: use Pair.map for dp filter step in bundle_comparator
fzyzcjy Feb 28, 2026
4d4687a
refactor: consolidate parse_dims + extract_dp_group_alias into DimsSpec
fzyzcjy Feb 28, 2026
bfca658
more
fzyzcjy Feb 28, 2026
6830bfd
refactor: use # instead of // as dims declaration separator
fzyzcjy Feb 28, 2026
86842a9
replace --forbid-skip with --allow-skip-pattern for fine-grained skip…
fzyzcjy Feb 28, 2026
9d67f89
style: black formatting for test_entrypoint.py
fzyzcjy Feb 28, 2026
00a6245
feat(comparator): add ReportSink for unified JSONL report output
fzyzcjy Feb 28, 2026
5fe2d8f
style: black formatting for entrypoint.py
fzyzcjy Feb 28, 2026
56e400b
add ReportPathRecord, remove --no-report in favor of --report-path ''
fzyzcjy Feb 28, 2026
6a6c808
more
fzyzcjy Feb 28, 2026
8a7ef20
simplify e2e test: use --allow-skip-pattern, remove JSONL parsing wor…
fzyzcjy Feb 28, 2026
eb7d99c
more
fzyzcjy Feb 28, 2026
93aceb2
fix: restore no_report check in _resolve_report_path and _make_args d…
fzyzcjy Feb 28, 2026
a4ef8e0
fix: restore --no-report CLI argument removed by linter
fzyzcjy Feb 28, 2026
69208d3
refactor: replace --no-report with --report-path '' to disable report
fzyzcjy Feb 28, 2026
42976e6
fix: remove linter-injected ReportPathRecord, use stderr for report path
fzyzcjy Feb 28, 2026
13fe398
style: remove extra blank line
fzyzcjy Feb 28, 2026
abbffc1
Merge branch 'ac8420/26' into ac8420/27
fzyzcjy Feb 28, 2026
4b3fe94
Merge branch 'ac8420/27' into ac8420/28
fzyzcjy Feb 28, 2026
ae70e87
Merge branch 'ac8420/28' into worktree/dumper_sglang_run
fzyzcjy Feb 28, 2026
2bb0162
temp
fzyzcjy Feb 28, 2026
b98439a
fix: add explicit parentheses for set operator precedence in load_thd…
fzyzcjy Feb 28, 2026
33d0e54
test: add unit tests for load_thd_seq_lens_only
fzyzcjy Feb 28, 2026
80e9070
test: add concat + THD CP zigzag integration test
fzyzcjy Feb 28, 2026
cccd2eb
refactor: rename "concat" to "concat_steps", move load_thd_seq_lens_o…
fzyzcjy Feb 28, 2026
91267fa
fix: break circular import by importing thd_seq_lens_loader directly
fzyzcjy Feb 28, 2026
b4b55ce
fix: correct double-suffixed function name in test_concat_steps.py
fzyzcjy Feb 28, 2026
1c19b4f
fix: update mock target path after moving load_thd_seq_lens_only
fzyzcjy Feb 28, 2026
6fd811f
fix formatting (black)
fzyzcjy Feb 28, 2026
13166ea
merge ac8420/12 (formatting fix)
fzyzcjy Feb 28, 2026
257f013
merge ac8420/13
fzyzcjy Feb 28, 2026
e223327
merge ac8420/14
fzyzcjy Feb 28, 2026
125197c
merge ac8420/15a
fzyzcjy Feb 28, 2026
2020aa2
merge ac8420/15b
fzyzcjy Feb 28, 2026
0af87c3
merge ac8420/16
fzyzcjy Feb 28, 2026
fc984c4
merge ac8420/17
fzyzcjy Feb 28, 2026
f88eefa
more
fzyzcjy Feb 28, 2026
a45cfa7
more
fzyzcjy Feb 28, 2026
df4f747
refactor: move TestLoadThdSeqLensOnly to test_thd_seq_lens_loader.py
fzyzcjy Feb 28, 2026
d1c8c30
Merge remote-tracking branch 'upstream/main' into ac8420/18
fzyzcjy Feb 28, 2026
3f7d331
Merge branch 'ac8420/25' into ac8420/26
fzyzcjy Feb 28, 2026
03f8a4c
Merge branch 'ac8420/26' into ac8420/27
fzyzcjy Feb 28, 2026
86c2d5d
Merge branch 'ac8420/27' into ac8420/28
fzyzcjy Feb 28, 2026
1c4f7b4
Merge branch 'ac8420/28' into worktree/dumper_sglang_run
fzyzcjy Feb 28, 2026
21b663b
Revert "fix: replace --forbid-skip with JSONL summary parsing in e2e …
fzyzcjy Feb 28, 2026
6d07753
replace --forbid-skip with --allow-skip-pattern 'input_ids|positions'…
fzyzcjy Feb 28, 2026
91c1644
add preset.py for comparator CLI preset system
fzyzcjy Feb 28, 2026
11f4501
token_aligner: remove grouping dependency, use token_aligner=None
fzyzcjy Feb 28, 2026
f3877bf
output_types: add step field to SkipRecord, ComparisonRecord, NonTens…
fzyzcjy Feb 28, 2026
d11f2ad
entrypoint: replace --grouping with --preset and --grouping-skip-keys
fzyzcjy Feb 28, 2026
1ea4228
add CI registry to source_patcher test files
fzyzcjy Feb 28, 2026
74aac85
tests: adapt test_entrypoint for preset/grouping-skip-keys refactor
fzyzcjy Feb 28, 2026
4ea50b2
style: black formatting fixes
fzyzcjy Feb 28, 2026
8c9969a
style: black formatting for unrelated files
fzyzcjy Feb 28, 2026
6bf63c5
fix: add explicit concat args to test_concat_multi_step_cp_unshard
fzyzcjy Feb 28, 2026
adc4dea
fix: add step to skip_keys for test_concat_thd_cp_zigzag
fzyzcjy Feb 28, 2026
7926f8d
fix: unpack _run_and_parse tuple in test_concat_thd_cp_zigzag
fzyzcjy Feb 28, 2026
cbfc254
add dp attention e2e test (TP=2 baseline vs TP=2+DP=2+dp-attention ta…
fzyzcjy Feb 28, 2026
aec82f0
Merge remote-tracking branch 'upstream/main' into ac8420/18
fzyzcjy Feb 28, 2026
85f579d
fix: skip dim naming when tensor ndim mismatches metadata dims count
fzyzcjy Feb 28, 2026
aa7d92b
deduplicate e2e test: extract _run_e2e_scenario helper
fzyzcjy Feb 28, 2026
3bc7d52
Revert "fix: skip dim naming when tensor ndim mismatches metadata dim…
fzyzcjy Feb 28, 2026
2d9d8cf
refactor: move TestExpandPreset to test_preset.py
fzyzcjy Feb 28, 2026
76c9df4
simplify _compute_skip_keys to single expression
fzyzcjy Feb 28, 2026
a9bd913
fix: override mlp_output dims for dp-attention e2e test
fzyzcjy Feb 28, 2026
5eee8d9
refactor: split _parse_args into public parse_args(argv) + private _p…
fzyzcjy Feb 28, 2026
a79e7a3
refactor: use separate patch config for dp-attention e2e test
fzyzcjy Feb 28, 2026
9476263
refactor: introduce RecordLocation, _BundleComparisonRecord base class
fzyzcjy Feb 28, 2026
554f317
refactor: switch test_entrypoint from Namespace to argv-driven via pa…
fzyzcjy Feb 28, 2026
fc9a6ab
style: auto-format from pre-commit (isort, black)
fzyzcjy Feb 28, 2026
4907b6a
more
fzyzcjy Feb 28, 2026
b65159f
more
fzyzcjy Feb 28, 2026
bd20054
remove recompute_status from preset skip keys
fzyzcjy Feb 28, 2026
14f8efa
fix: recompute tests need explicit grouping_skip_keys with recompute_…
fzyzcjy Feb 28, 2026
dfea8f6
refactor: extract _expand_flag helper from expand_preset
fzyzcjy Feb 28, 2026
16e4657
more
fzyzcjy Feb 28, 2026
6add391
more
fzyzcjy Feb 28, 2026
daae289
fix: update error message match in test_preset for _expand_flag
fzyzcjy Feb 28, 2026
76afc1c
fix: _expand_flag return type should be list[str] | None
fzyzcjy Feb 28, 2026
356e034
fix: skip dim naming when tensor ndim mismatches metadata dims count
fzyzcjy Feb 28, 2026
047d9d1
fix: squeeze singleton dims when tensor ndim exceeds dims metadata count
fzyzcjy Feb 28, 2026
c508abe
fix: handle shape mismatch in replicated group verification
fzyzcjy Feb 28, 2026
f4529d6
feat: add --exclude flag to comparator for filename exclusion
fzyzcjy Feb 28, 2026
b077ab2
fix: apply --exclude filter to both baseline and target dataframes
fzyzcjy Feb 28, 2026
7d937f9
fix: treat dim_name_squeeze as informational warning, squeeze singlet…
fzyzcjy Feb 28, 2026
d407dec
fix: treat axis_aligner_dim_mismatch as informational warning
fzyzcjy Feb 28, 2026
b1a849c
revert: remove axis_aligner_dim_mismatch workaround and bidirectional…
fzyzcjy Feb 28, 2026
82a1167
remove _shape_mismatch_diff, use diff=None for shape-mismatch replica…
fzyzcjy Feb 28, 2026
5941aa1
replace --exclude with --allow-fail-pattern in comparator
fzyzcjy Feb 28, 2026
04e68c9
fix tests: pass allow_fail_pattern/failed_names to _compute_exit_code
fzyzcjy Feb 28, 2026
7f5c986
fix: clear error message when dims metadata ndim mismatches tensor
fzyzcjy Feb 28, 2026
ea97fdb
rename allow-skip/fail-pattern to allow-skipped/failed-pattern
fzyzcjy Feb 28, 2026
c726c30
more
fzyzcjy Feb 28, 2026
b6b7acc
refactor: migrate all producers and tests from GeneralWarning/Warning…
fzyzcjy Feb 28, 2026
4d4a849
fmt
fzyzcjy Feb 28, 2026
1ed815a
refactor: extract _is_all_match_pattern from _compute_exit_code
fzyzcjy Feb 28, 2026
1f9c8a7
refactor: extract _check_replicated_pair, deduplicate ReplicatedCheck…
fzyzcjy Feb 28, 2026
8bb60b6
fix: change replicated check detail from "shape mismatch (no diff)" t…
fzyzcjy Feb 28, 2026
ca59ef4
test: add tests for ac8420/30 new features
fzyzcjy Feb 28, 2026
3efa45a
refactor: move compute_exit_code to utils.py, add passed==0 guard
fzyzcjy Feb 28, 2026
4af603e
Merge branch 'ac8420/30' into worktree/dumper_sglang_run
fzyzcjy Feb 28, 2026
f673f58
fix: correct CLI flag name --allow-skip-pattern -> --allow-skipped-pa…
fzyzcjy Feb 28, 2026
1a61b93
fix: remove bogus --grouping logical flag from e2e test
fzyzcjy Feb 28, 2026
6632211
fix: add dp:=attn_dp to layer_input dims in dp-attention e2e test
fzyzcjy Feb 28, 2026
effb342
feat: add SubDimSpec and * fused dim syntax to dims parser
fzyzcjy Feb 28, 2026
eb3be4e
feat: resolve_dim_names sanitizes fused dim names for named tensors
fzyzcjy Feb 28, 2026
936a7d1
feat: unsharder planner extracts parallel modifiers from fused sub_dims
fzyzcjy Feb 28, 2026
35a3a9c
fix: address code review findings for fused dim implementation
fzyzcjy Feb 28, 2026
7d989fa
fix: add future annotations import to fix NameError in model_validator
fzyzcjy Feb 28, 2026
ed40cc4
feat: axis aligner supports fused dim matching with FlattenPlan
fzyzcjy Feb 28, 2026
840ff25
fix: axis aligner uses post-flatten names for target order
fzyzcjy Feb 28, 2026
ff4c1cc
test: add fused dim executor test, fix _name_tensors for fused dims
fzyzcjy Feb 28, 2026
60766e6
style: apply pre-commit formatting to fused dim files
fzyzcjy Feb 28, 2026
caf505a
style: apply pre-commit formatting to unrelated files
fzyzcjy Feb 28, 2026
a885e8c
dims: remove SubDimSpec.parallel_modifiers and DimSpec._validate_fuse…
fzyzcjy Feb 28, 2026
a72eec1
dims: migrate parser from () to [] modifier syntax with () fused grou…
fzyzcjy Feb 28, 2026
c8eeedd
dims: update unsharder/reorderer planners for new modifier location
fzyzcjy Feb 28, 2026
f26530c
test_dims: migrate all dims strings to bracket syntax
fzyzcjy Feb 28, 2026
380be9f
refactor: remove SubDimSpec class, make sub_dims a computed property …
fzyzcjy Feb 28, 2026
1fca1cf
test: update tests for SubDimSpec removal and ___ separator
fzyzcjy Feb 28, 2026
b95796a
refactor: is_fused/sub_dims as DimSpec properties, remove fused_sub_n…
fzyzcjy Feb 28, 2026
0bf7156
test: update for is_fused property, sub_dims unconditional list, sani…
fzyzcjy Feb 28, 2026
c10d96e
more
fzyzcjy Feb 28, 2026
f923626
style: restore list comprehension in unsharder planner for minimal diff
fzyzcjy Feb 28, 2026
8c56d2c
more
fzyzcjy Feb 28, 2026
813ebff
fmt
fzyzcjy Feb 28, 2026
2c23cef
more
fzyzcjy Feb 28, 2026
825f915
test: migrate dims syntax from () to [] in unsharder/reorderer test f…
fzyzcjy Feb 28, 2026
840d318
more
fzyzcjy Feb 28, 2026
8f749db
more
fzyzcjy Feb 28, 2026
d983a8b
migrate dims syntax from () to [] in test files (batch 2) and aux_plu…
fzyzcjy Feb 28, 2026
3bcd14d
refactor: use Pair.map in _semantic_names_match
fzyzcjy Feb 28, 2026
e1d3323
test: rename pre_flatten → flatten to match AxisAlignerPlan field rename
fzyzcjy Feb 28, 2026
6ea396b
fix: correct fused dim syntax in unsharder tests — use (a*b)[tp] not …
fzyzcjy Mar 1, 2026
58f4514
refactor: simplify axis_aligner — merge flatten into einops pattern
fzyzcjy Mar 1, 2026
1ba0701
more
fzyzcjy Mar 1, 2026
c6c5bbf
fix: always flatten toward fused representation in axis_aligner
fzyzcjy Mar 1, 2026
4ada722
fix: _build_fused_target consumed-dim bug + refactor
fzyzcjy Mar 1, 2026
22c7505
refactor: axis aligner per-side pattern with fused placeholder
fzyzcjy Mar 1, 2026
0b487ee
fix test: correct fused_vs_reordered_separate expectations, add reord…
fzyzcjy Mar 1, 2026
2bbc0cb
refactor: use DimSpec.sanitized_name in axis_aligner instead of hand-…
fzyzcjy Mar 1, 2026
67c7f89
fix: validate side parameter in execute_axis_aligner_plan + add missi…
fzyzcjy Mar 1, 2026
e230378
fix: detect overlapping fused groups in axis_aligner and return None
fzyzcjy Mar 1, 2026
a9837f8
update sglang e2e test: migrate dims syntax () → [] and add summary v…
fzyzcjy Mar 1, 2026
75ac57c
revert summary verification, keep only dims syntax migration
fzyzcjy Mar 1, 2026
305b566
Merge branch 'ac8420/31' into worktree/dumper_sglang_run
fzyzcjy Mar 1, 2026
08d6c49
suppress test warnings: remove unused timeout marks, filter upstream …
fzyzcjy Mar 1, 2026
9c6849c
style: fix black formatting in comparator tests
fzyzcjy Mar 1, 2026
de727e7
Merge branch 'ac8420/20' into ac8420/21
fzyzcjy Mar 1, 2026
4a6f451
Merge branch 'ac8420/21' into ac8420/22
fzyzcjy Mar 1, 2026
24d406b
feat: explicit replicated axis declarations in dims syntax
fzyzcjy Mar 1, 2026
355725e
style: fix black formatting in test_entrypoint.py
fzyzcjy Mar 1, 2026
4ddb61d
Merge branch 'ac8420/22' into ac8420/23
fzyzcjy Mar 1, 2026
30de37c
style: black formatting
fzyzcjy Mar 1, 2026
1cb579c
Merge branch 'ac8420/23' into ac8420/24
fzyzcjy Mar 1, 2026
378dd52
fix: auto-replicate RECOMPUTE_PSEUDO axis (system-injected, not user-…
fzyzcjy Mar 1, 2026
de3c50e
Merge branch 'ac8420/24' into ac8420/25
fzyzcjy Mar 1, 2026
186762c
style: fix black formatting in token aligner concat steps
fzyzcjy Mar 1, 2026
43e5f83
fix: update e2e entrypoint tests to use explicit # tp:replicated
fzyzcjy Mar 1, 2026
594118c
Merge branch 'ac8420/25' into ac8420/26
fzyzcjy Mar 1, 2026
4cac82b
Merge branch 'ac8420/26' into ac8420/27
fzyzcjy Mar 1, 2026
aad24ee
fix: update test_replicated_shape_mismatch to use explicit # tp:repli…
fzyzcjy Mar 1, 2026
7c99955
style: fix black formatting in test_planner.py
fzyzcjy Mar 1, 2026
7c7ef7b
Merge branch 'ac8420/27' into ac8420/28
fzyzcjy Mar 1, 2026
567e3ea
style: fix black formatting in test_dims.py
fzyzcjy Mar 1, 2026
7d795d3
fmt
fzyzcjy Mar 1, 2026
4bd0718
Merge branch 'ac8420/31' into ac8420/32
fzyzcjy Mar 1, 2026
c4fa9af
fix: unpack _run_and_parse tuple in test_concat_thd_cp_zigzag
fzyzcjy Mar 1, 2026
58a9b48
fix: unpack _run_and_parse tuple in test_concat_thd_cp_zigzag
fzyzcjy Mar 1, 2026
ced943a
Merge branch 'ac8420/26' into ac8420/27
fzyzcjy Mar 1, 2026
fc16725
Merge branch 'ac8420/27' into ac8420/28
fzyzcjy Mar 1, 2026
7d44ead
refactor: merge _extract_dp_group_alias and _extract_replicated_axes …
fzyzcjy Mar 1, 2026
9586bc8
Merge remote-tracking branch 'upstream/main' into ac8420/28
fzyzcjy Mar 1, 2026
166306a
fix: reject unrecognized comment tokens and duplicate dp aliases, add…
fzyzcjy Mar 1, 2026
9ec901c
fix: CI lint and test collection errors after upstream merge
fzyzcjy Mar 1, 2026
5b9cff4
refactor: split dims.py into dims_spec/ subpackage
fzyzcjy Mar 1, 2026
f30db6f
style: fix isort and black formatting in dims_spec/
fzyzcjy Mar 1, 2026
568b84d
Merge branch 'ac8420/18' into ac8420/19
fzyzcjy Mar 1, 2026
ce9b1b1
Merge remote-tracking branch 'upstream/main' into ac8420/19
fzyzcjy Mar 1, 2026
8cc0e4b
Merge branch 'ac8420/19' into ac8420/20
fzyzcjy Mar 1, 2026
7828eaa
Merge branch 'ac8420/20' into ac8420/21
fzyzcjy Mar 1, 2026
66e4ce7
Merge branch 'ac8420/21' into ac8420/22
fzyzcjy Mar 1, 2026
f098936
Merge branch 'ac8420/22' into ac8420/23
fzyzcjy Mar 1, 2026
930f44d
Merge branch 'ac8420/23' into ac8420/24
fzyzcjy Mar 1, 2026
8e6f790
Merge branch 'ac8420/24' into ac8420/25
fzyzcjy Mar 1, 2026
cb74bae
Merge branch 'ac8420/25' into ac8420/26
fzyzcjy Mar 1, 2026
b783fa0
Merge branch 'ac8420/26' into ac8420/27
fzyzcjy Mar 1, 2026
16c945e
Merge branch 'ac8420/27' into ac8420/28
fzyzcjy Mar 1, 2026
619050b
Merge remote-tracking branch 'upstream/main' into ac8420/28
fzyzcjy Mar 1, 2026
10b8b70
fmt
fzyzcjy Mar 1, 2026
b03ec80
Merge branch 'ac8420/28' into ac8420/29
fzyzcjy Mar 1, 2026
67f2ea7
Merge branch 'ac8420/29' into ac8420/30
fzyzcjy Mar 1, 2026
251ae31
Merge branch 'ac8420/30' into ac8420/31
fzyzcjy Mar 1, 2026
38c40a2
Merge branch 'ac8420/31' into ac8420/32
fzyzcjy Mar 1, 2026
0241a0e
comparator: add auto-descend for engine subdirectories
fzyzcjy Mar 1, 2026
26bf147
style: fix isort and black formatting
fzyzcjy Mar 1, 2026
e9e6e0e
refactor: extract explicit params from args in entrypoint helpers
fzyzcjy Mar 1, 2026
d24ecfb
style: black formatting
fzyzcjy Mar 1, 2026
0f52764
refactor: move auto_descend_dir to utils.py, add e2e tests
fzyzcjy Mar 1, 2026
5b495f5
more
fzyzcjy Mar 1, 2026
1124ca4
fix: capture stderr correctly in auto-descend e2e test
fzyzcjy Mar 1, 2026
75e1e20
refactor: replace print() with InfoLog in auto_descend_dir
fzyzcjy Mar 1, 2026
3fc11ec
refactor: use Pair[Path] for dir_pair, extract all args at run() top
fzyzcjy Mar 1, 2026
3f3dcca
refactor: replace print() with InfoLog in entrypoint report path notice
fzyzcjy Mar 1, 2026
8119048
refactor: use dir_pair: Pair[Path] in compare_bundle_pair
fzyzcjy Mar 1, 2026
3db6fcc
style: linter formatting fixes
fzyzcjy Mar 1, 2026
6bc8826
refactor: move auto_descend_dir from utils to entrypoint, eliminate l…
fzyzcjy Mar 1, 2026
39efa1a
refactor: restore auto_descend_dir in utils.py with stderr output
fzyzcjy Mar 1, 2026
f0a8ea4
more
fzyzcjy Mar 1, 2026
f38b106
refactor: remove args from token_aligner, use Pair.map for auto_desce…
fzyzcjy Mar 1, 2026
dfd8ee1
refactor: remove intermediate variable extraction in run(), use args.…
fzyzcjy Mar 1, 2026
0efb391
feat: auto_descend_dir errors on ambiguous/missing data, add tests
fzyzcjy Mar 1, 2026
4ed6412
fix: configure report_sink output_format before auto_descend_dir
fzyzcjy Mar 1, 2026
1bade5c
fix: update auto-descend test to check LogRecord in stdout JSON
fzyzcjy Mar 1, 2026
220c379
feat: add GeneralWarning type and warning_sink module
fzyzcjy Mar 1, 2026
44da934
fix: use dims_spec instead of legacy dims in axis_swapper
fzyzcjy Mar 1, 2026
3a8205d
fix: use bracket syntax h[tp] instead of h(tp) in axis_swapper test
fzyzcjy Mar 1, 2026
28afed6
fix: use bracket syntax for modifiers in unsharder test_executor
fzyzcjy Mar 1, 2026
d5480c8
fix: add pass/fail markers for all diff metrics in formatter, fix par…
fzyzcjy Mar 1, 2026
c3aba53
Revert "fix: add pass/fail markers for all diff metrics in formatter,…
fzyzcjy Mar 1, 2026
b36b7b9
Revert "fix: use bracket syntax for modifiers in unsharder test_execu…
fzyzcjy Mar 1, 2026
ebc7797
Revert "fix: use bracket syntax h[tp] instead of h(tp) in axis_swappe…
fzyzcjy Mar 1, 2026
44f9030
Revert "fix: use dims_spec instead of legacy dims in axis_swapper"
fzyzcjy Mar 1, 2026
9cc7c3c
Revert "feat: add GeneralWarning type and warning_sink module"
fzyzcjy Mar 1, 2026
2fe4d8b
fix worngly introduced file in merging
fzyzcjy Mar 1, 2026
d6ec404
fix: use bracket syntax and .dims in ReduceSum unsharder tests
fzyzcjy Mar 1, 2026
ae8e270
Merge branch 'ac8420/33' into worktree/dumper_sglang_run
fzyzcjy Mar 1, 2026
1a1f724
fix
fzyzcjy Mar 1, 2026
d9dd014
Merge branch 'worktree/dumper_sglang_run' into ac8420/34
fzyzcjy Mar 1, 2026
962f77f
fmt
fzyzcjy Mar 1, 2026
7b2af8b
refactor: extract trace info, ReportSink, and shape snapshots
fzyzcjy Mar 1, 2026
b2b8edc
feat: add Rich output formatting (normal mode)
fzyzcjy Mar 1, 2026
580e5c2
test: add Rich output snapshot tests for normal mode
fzyzcjy Mar 2, 2026
df709ee
feat: add verbosity support (minimal/normal/verbose)
fzyzcjy Mar 2, 2026
809b23e
fix test_formatter.py class ordering to match target
fzyzcjy Mar 2, 2026
a01d2d9
style: reformat preset.py (black)
fzyzcjy Mar 2, 2026
9c4bba6
Merge branch 'ac8420/29' into ac8420/30
fzyzcjy Mar 2, 2026
1c86491
style: reformat with black
fzyzcjy Mar 2, 2026
4f99384
Merge branch 'ac8420/30' into ac8420/31
fzyzcjy Mar 2, 2026
95b963b
Merge branch 'ac8420/31' into ac8420/32
fzyzcjy Mar 2, 2026
8fafde2
Merge branch 'ac8420/32' into ac8420/33
fzyzcjy Mar 2, 2026
d5046ad
style: reformat test_entrypoint.py (black)
fzyzcjy Mar 2, 2026
a4c9147
Merge branch 'ac8420/33' into ac8420/34
fzyzcjy Mar 2, 2026
0237bc5
Merge branch 'ac8420/34' into ac8420/35
fzyzcjy Mar 2, 2026
fcd5ca1
style: fix isort ordering in entrypoint.py
fzyzcjy Mar 2, 2026
a9ca818
Merge branch 'ac8420/35' into ac8420/36
fzyzcjy Mar 2, 2026
6d46397
style: fix ruff F821 (add TYPE_CHECKING import for Table) and reforma…
fzyzcjy Mar 2, 2026
68bad2e
Merge branch 'ac8420/36' into ac8420/37
fzyzcjy Mar 2, 2026
1a5d8ec
Merge remote-tracking branch 'upstream/main' into ac8420/37
fzyzcjy Mar 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions python/sglang/srt/debug_utils/comparator/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from typing import TYPE_CHECKING, Any, Optional

import polars as pl
import rich.table

if TYPE_CHECKING:
from rich.table import Table
Expand Down Expand Up @@ -68,6 +69,19 @@ def _build_rich_table(df: pl.DataFrame, *, title: Optional[str] = None) -> "Tabl
return table


def _render_polars_as_rich_table(
df: pl.DataFrame, *, title: Optional[str] = None
) -> "rich.table.Table":
from rich.table import Table

table = Table(title=title)
for col in df.columns:
table.add_column(col)
for row in df.iter_rows():
table.add_row(*[str(v) for v in row])
return table


def _collect_rank_info(
df: pl.DataFrame, dump_dir: Path
) -> Optional[list[dict[str, Any]]]:
Expand Down
34 changes: 24 additions & 10 deletions python/sglang/srt/debug_utils/comparator/output_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from __future__ import annotations

from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Literal

from rich.console import Group
from rich.markup import escape
Expand Down Expand Up @@ -38,12 +38,16 @@
_TableRecord,
)

Verbosity = Literal["minimal", "normal", "verbose"]


# ── Record-level rendering (body + logs) ─────────────────────────────


def _render_record_rich(record: _OutputRecord) -> RenderableType:
body: RenderableType = record._format_rich_body()
def _render_record_rich(
record: _OutputRecord, *, verbosity: Verbosity = "normal"
) -> RenderableType:
body: RenderableType = record._format_rich_body(verbosity=verbosity)

log_lines: list[str] = _format_log_lines_rich(
errors=record.errors, infos=record.infos
Expand Down Expand Up @@ -100,7 +104,9 @@ def _format_config_body(record: ConfigRecord) -> str:
return f"Config: {record.config}"


def _format_config_rich_body(record: ConfigRecord) -> RenderableType:
def _format_config_rich_body(
record: ConfigRecord, verbosity: Verbosity = "normal"
) -> RenderableType:
lines: list[str] = [f" [bold]{k}[/] : {v}" for k, v in record.config.items()]
return Panel("\n".join(lines), title="Comparator Config", border_style="cyan")

Expand All @@ -112,7 +118,9 @@ def _format_skip_body(record: SkipComparisonRecord) -> str:
return f"Skip: {record.name}{record._format_location_suffix()} ({record.reason})"


def _format_skip_rich_body(record: SkipComparisonRecord) -> RenderableType:
def _format_skip_rich_body(
record: SkipComparisonRecord, verbosity: Verbosity = "normal"
) -> RenderableType:
suffix: str = record._format_location_suffix()
return (
f"[dim]⊘ {escape(record.name)}{suffix} ── skipped ({escape(record.reason)})[/]"
Expand All @@ -132,7 +140,9 @@ def _format_table_body(record: _TableRecord) -> str:
)


def _format_table_rich_body(record: _TableRecord) -> RenderableType:
def _format_table_rich_body(
record: _TableRecord, verbosity: Verbosity = "normal"
) -> RenderableType:
import polars as pl

from sglang.srt.debug_utils.comparator.display import (
Expand All @@ -157,13 +167,15 @@ def _format_tensor_comparison_body(record: TensorComparisonRecord) -> str:


def _format_tensor_comparison_rich_body(
record: TensorComparisonRecord,
record: TensorComparisonRecord, verbosity: Verbosity = "normal"
) -> RenderableType:
from sglang.srt.debug_utils.comparator.tensor_comparator.formatter import (
format_comparison_rich,
)

return record._format_location_prefix_rich() + format_comparison_rich(record=record)
return record._format_location_prefix_rich() + format_comparison_rich(
record=record, verbosity=verbosity
)


# ── NonTensorComparisonRecord ────────────────────────────────────────
Expand All @@ -181,7 +193,7 @@ def _format_non_tensor_body(record: NonTensorComparisonRecord) -> str:


def _format_non_tensor_rich_body(
record: NonTensorComparisonRecord,
record: NonTensorComparisonRecord, verbosity: Verbosity = "normal"
) -> RenderableType:
suffix: str = record._format_location_suffix()
name: str = escape(record.name)
Expand Down Expand Up @@ -210,7 +222,9 @@ def _format_summary_body(record: SummaryRecord) -> str:
)


def _format_summary_rich_body(record: SummaryRecord) -> RenderableType:
def _format_summary_rich_body(
record: SummaryRecord, verbosity: Verbosity = "normal"
) -> RenderableType:
text: str = (
f"[bold green]{record.passed} passed[/] │ "
f"[bold red]{record.failed} failed[/] │ "
Expand Down
134 changes: 40 additions & 94 deletions python/sglang/srt/debug_utils/comparator/output_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@
from rich.console import RenderableType
from rich.markup import escape

from sglang.srt.debug_utils.comparator.output_formatter import ( # noqa: F401 — re-export
_format_aligner_plan as _format_aligner_plan,
)
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_config_body,
_format_config_rich_body,
_format_log_body,
_format_non_tensor_body,
_format_non_tensor_rich_body,
_format_skip_body,
_format_skip_rich_body,
_format_summary_body,
_format_summary_rich_body,
_format_table_body,
_format_table_rich_body,
_format_tensor_comparison_body,
_format_tensor_comparison_rich_body,
_render_record_rich,
_render_record_text,
)
from sglang.srt.debug_utils.comparator.tensor_comparator.types import (
DiffInfo,
TensorComparisonInfo,
Expand All @@ -17,7 +37,6 @@
from sglang.srt.debug_utils.comparator.aligner.entrypoint.traced_types import (
TracedAlignerPlan,
)
from sglang.srt.debug_utils.comparator.aligner.entrypoint.types import AlignerPlan
from sglang.srt.debug_utils.comparator.report_sink import Verbosity


Expand Down Expand Up @@ -83,21 +102,13 @@ class _OutputRecord(_StrictBase):
@abstractmethod
def _format_body(self) -> str: ...

def _format_rich_body(self) -> RenderableType:
def _format_rich_body(self, verbosity: Verbosity = "normal") -> RenderableType:
return self._format_body()

def to_rich(self) -> RenderableType:
from sglang.srt.debug_utils.comparator.output_formatter import (
_render_record_rich,
)

return _render_record_rich(self)
def to_rich(self, verbosity: Verbosity = "normal") -> RenderableType:
return _render_record_rich(self, verbosity=verbosity)

def to_text(self) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_render_record_text,
)

return _render_record_text(self)


Expand All @@ -124,46 +135,15 @@ def _format_location_suffix(self) -> str:
return ""


class RecordLocation(_StrictBase):
step: Optional[int] = None


class _BaseComparisonRecord(_OutputRecord):
location: RecordLocation = Field(default_factory=RecordLocation)

def _format_location_prefix(self) -> str:
if self.location.step is not None:
return f"[step={self.location.step}] "
return ""

def _format_location_prefix_rich(self) -> str:
if self.location.step is not None:
return escape(f"[step={self.location.step}]") + " "
return ""

def _format_location_suffix(self) -> str:
if self.location.step is not None:
return f" (step={self.location.step})"
return ""


class ConfigRecord(_OutputRecord):
type: Literal["config"] = "config"
config: dict[str, Any]

def _format_body(self) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_config_body,
)

return _format_config_body(self)

def _format_rich_body(self) -> RenderableType:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_config_rich_body,
)

return _format_config_rich_body(self)
def _format_rich_body(self, verbosity: Verbosity = "normal") -> RenderableType:
return _format_config_rich_body(self, verbosity=verbosity)


class SkipComparisonRecord(_BaseComparisonRecord):
Expand All @@ -178,18 +158,10 @@ def category(self) -> str:
return "skipped"

def _format_body(self) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_skip_body,
)

return _format_skip_body(self)

def _format_rich_body(self) -> RenderableType:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_skip_rich_body,
)

return _format_skip_rich_body(self)
def _format_rich_body(self, verbosity: Verbosity = "normal") -> RenderableType:
return _format_skip_rich_body(self, verbosity=verbosity)


class _TableRecord(_OutputRecord):
Expand All @@ -200,9 +172,10 @@ class _TableRecord(_OutputRecord):
def _table_title(self) -> str: ...

def _format_body(self) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_table_body,
)
return _format_table_body(self)

def _format_rich_body(self, verbosity: Verbosity = "normal") -> RenderableType:
return _format_table_rich_body(self, verbosity=verbosity)

return _format_table_body(self)

Expand Down Expand Up @@ -245,18 +218,10 @@ def category(self) -> str:
return "passed" if self.diff is not None and self.diff.passed else "failed"

def _format_body(self) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_tensor_comparison_body,
)

return _format_tensor_comparison_body(self)

def _format_rich_body(self) -> RenderableType:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_tensor_comparison_rich_body,
)

return _format_tensor_comparison_rich_body(self)
def _format_rich_body(self, verbosity: Verbosity = "normal") -> RenderableType:
return _format_tensor_comparison_rich_body(self, verbosity=verbosity)


class NonTensorComparisonRecord(_BaseComparisonRecord):
Expand All @@ -275,9 +240,10 @@ def category(self) -> str:
return "passed" if self.values_equal else "failed"

def _format_body(self) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_non_tensor_body,
)
return _format_non_tensor_body(self)

def _format_rich_body(self, verbosity: Verbosity = "normal") -> RenderableType:
return _format_non_tensor_rich_body(self, verbosity=verbosity)

return _format_non_tensor_body(self)

Expand Down Expand Up @@ -306,40 +272,20 @@ def _validate_totals(self) -> "SummaryRecord":
return self

def _format_body(self) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_summary_body,
)

return _format_summary_body(self)

def _format_rich_body(self) -> RenderableType:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_summary_rich_body,
)

return _format_summary_rich_body(self)
def _format_rich_body(self, verbosity: Verbosity = "normal") -> RenderableType:
return _format_summary_rich_body(self, verbosity=verbosity)

return _format_summary_body(self)

class LogRecord(_OutputRecord):
type: Literal["log"] = "log"

def _format_body(self) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_log_body,
)

return _format_log_body(self)


# Re-export _format_aligner_plan for backward compatibility (used by tests)
def _format_aligner_plan(traced_plan: TracedAlignerPlan) -> str:
from sglang.srt.debug_utils.comparator.output_formatter import (
_format_aligner_plan as _impl,
)

return _impl(traced_plan)


AnyRecord = Annotated[
Union[
ConfigRecord,
Expand Down
2 changes: 1 addition & 1 deletion python/sglang/srt/debug_utils/comparator/report_sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _print_to_stdout(self, record: _OutputRecord) -> None:
print(record.model_dump_json())
else:
console: Console = self._get_console()
console.print(record.to_rich())
console.print(record.to_rich(verbosity=self._verbosity))
console.print() # blank line between records


Expand Down
Loading
Loading