Beautify text output in dump comparator#19683
Conversation
Assert that sglang_parallel_info in dump metadata contains the newly added moe_dp_rank/size and attn_cp_rank/size fields alongside the existing tp_rank/size.
Check every group (tp, pp, moe_ep, moe_tp, moe_dp, attn_tp, attn_dp, local_attn_dp, attn_cp, enable_dp_attention) rather than only the newly added ones.
The first two tests now model the realistic scenario where dp_size=2 with one empty rank (attention-style DP), while // dp:=moe_dp redirects dp filtering to use the alias group. This avoids the aligner failure that occurs when 2 replicated non-empty items reach it without sharding.
- test_dp_alias_absent_group_noop: single rank with dp_size=1, verifies // syntax doesn't break comparison - test_dp_alias_via_override_dims: uses moe_dp_rank/moe_dp_size fields so override-dims with // dp:=moe_dp triggers real alias-based filtering
parse_dims() now returns DimsSpec (dims + dp_group_alias) instead of list[DimSpec]. This removes the separate extract_dp_group_alias() public API and keeps dp group alias extraction as an internal detail of the parsing step.
# is more natural as an annotation/pragma marker and avoids ambiguity with URL fragments or division operators.
… control Instead of all-or-nothing --forbid-skip, --allow-skip-pattern accepts a regex: tensor names matching the pattern are allowed to skip (e.g. core auto-dump fields like positions/seq_lens that lack dims metadata at TP>1). Default '.*' allows all skips; '^$' forbids all (equivalent to old --forbid-skip).
Replace scattered print_record() calls with a centralized report_sink singleton that tees output to both stdout and an auto-generated JSONL report file. This eliminates output_format parameter threading through the call chain. - Add ReportSink class with configure/add/close lifecycle - Add --report-path and --no-report CLI arguments - Default report path: <target-path>/comparator_report.jsonl - Remove output_format from emit_display_records, _consume_comparison_records, WarningSink - Add TestReportOutput test class and conftest autouse fixture for isolation
- Report path now printed via report_sink.add(ReportPathRecord(...)) so it respects json/text output format - --no-report removed; pass --report-path '' to disable instead
…_seq_lens_only `&` and `-` are same-precedence left-associative so behavior was correct, but explicit parentheses make the intent unambiguous.
Cover: no plugin, empty cp_sharded_names, sglang seq_lens extraction, megatron cu_seqlens_q diff extraction, multi-step, and missing tensor.
Verifies that concat mode correctly loads thd_seq_lens and performs zigzag→natural reorder for Megatron-format CP=2 THD tensors.
…nly to concat_steps package - Rename token_aligner/concat.py → token_aligner/concat_steps/ package - Rename execute_token_aligner_concat → execute_token_aligner_concat_steps - Move load_thd_seq_lens_only from smart/aux_loader.py to concat_steps/thd_seq_lens_loader.py so concat-specific code no longer lives inside the smart subpackage - Update CLI choices, defaults, and all string literals from "concat" to "concat_steps" - Update all imports and test files accordingly
The concat_steps/__init__.py eagerly importing thd_seq_lens_loader created a circular import chain through smart/aux_loader.py → entrypoint/executor.py. Import from the submodule path instead.
This reverts commit 44da934.
This reverts commit 220c379.
- Add TracedAlignerPlan wrapper types with ShapeSnapshot tracking - Extract ReportSink to report_sink.py, add verbosity field - Add BundleFileInfo/BundleSideInfo/ShapeSnapshot types to output_types - Change executor return values to NamedTuples (StepPlansResult, SubPlansResult) - Refactor TensorComparisonRecord: aligner_plan -> traced_plan, add raw_bundle_info - Make extract_parallel_info and PARALLEL_INFO_KEYS public in display.py - Add --verbosity CLI parameter to entrypoint - Add testing_helpers.py with shared test factories - Add to_rich() / _format_rich_body() stubs to _OutputRecord
Extract output_formatter.py for record-level rendering delegation, add Rich markup formatters in tensor_comparator/formatter.py, and wire up display.py with _render_polars_as_rich_table. All Rich functions hardcoded to normal mode (no verbosity params).
Add Rich body tests for ConfigRecord, SkipRecord, NonTensorRecord, SummaryRecord, and log attachment (to_rich). Add Rich table tests for RankInfoRecord and InputIdsRecord. Add comprehensive snapshot tests for format_comparison_rich, _format_bundle_section, _format_plan_section_rich, _format_stats_rich, and _format_abs_diff_percentiles_rich.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant improvements to the comparator's output, making debugging and analysis of tensor differences more intuitive and comprehensive. By integrating detailed execution traces and a refined dimension specification system, it provides users with a clearer understanding of tensor transformations and comparison outcomes. The changes also enhance the robustness of parallelization awareness and streamline the overall user experience with more flexible CLI options and improved logging. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
Motivation
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci