Repository navigation
Conversation
z52527
force-pushed
the
fea-distributed-embedding-dumping
branch
from
August 26, 2025 02:24
e44c25b to
54d416d
Compare
z52527
added a commit
that referenced
this pull request
May 11, 2026
Addresses the second-pass follow-up findings in examples/sid_gr/docs/beam_decode_branch_audit_for_cc.md (the section written against 59ecff5). Changes ======= P2 #1 — Validator now checks all three pairs symmetrically (benchmark_beam_decode.py) * `_validate_compare_outputs` previously checked top-K overlap only for A vs B, while top-1 / log-prob delta were checked across all pairs. That meant C(jagged) lower-rank beams could drift past 70% overlap without the validator noticing as long as the top-1 SID and lp delta stayed close. Now top-K overlap is computed for A vs B, B vs C, and A vs C. * The summary string now includes the three lp deltas and the three worst-case overlap percentages even on PASS, so a passing config reports the actual numbers instead of just a green tag. P2 #2 — `--compare_kv_modes` raises by default on validation failure (benchmark_beam_decode.py) * Previously `run_compare_kv_modes()` printed validation failures at the bottom of the output and exited normally. Since RESULTS.md documents this command as the ground-truth reproduction, a copy-pasted timing table could absorb broken numbers without the reader noticing the validation block. * Default behavior now: raise RuntimeError after the table if any config failed (non-zero exit, CI-friendly). * New `--allow_validation_fail` flag opts back into the diagnostic behavior for sweeps where you want to see timings of a path that's known to drift. * Docstring on `run_compare_kv_modes` documents the contract. P3 — RESULTS.md prose label synced with the code (benchmark/RESULTS.md) * The benchmark CLI now prints `B_ms / C_ms` but RESULTS.md still said `C/B median = 0.951x` from the previous label scheme. Updated to match: `B_ms / C_ms median = 0.951x` with explicit "B (dense) takes 95.1% of C (jagged)'s wallclock" prose so the ratio direction is unambiguous. Tests ===== New unit test in test_beam_decode_generate.py: * test_compare_kv_modes_default_raises_on_validation_failure — exercises both: 1. `_validate_compare_outputs` actually flags injected mismatches (top-1 disagreement on sample 0). 2. The post-sweep raise path raises in strict mode and stays silent under `--allow_validation_fail`. Verified: 57/57 tests in test_beam_decode_generate.py pass. `--compare_kv_modes --sweep_hist 64 --sweep_beam 10 --sweep_dtype bf16` on H100 PCIe prints the new "top-K overlap >= 70% on all 3 pairs" language and the validation block. Out of scope (still deferred from earlier audit rounds, codex agrees these are the highest-leverage perf items but they live in another MR): * Per-step KJT.from_lengths_sync overhead in the decode loop. * torch.cat for beam KV accumulation -> preallocated tensor. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Runchu Zhao <[email protected]>
z52527
added a commit
that referenced
this pull request
May 26, 2026
…jagged-only) Five fixes from codex review on the previous RESULTS rewrite: 1. Reproduce command was `--batch_size 16` only, but the bar chart covers four batches. Replaced with a 4-iteration shell loop so a reviewer can actually reproduce the figure. 2. Correctness verification was tagged "weakest to strongest" but the list runs kernel oracle → mask isolation → overlap guard, which is strongest to weakest. Flip the tag. 3. Restore benchmark provenance (date, branch, kernel pinned commit, flash-attention pinned commit, container torch / CUDA versions) on the hardware line. 4. Drop the entire "Jagged-native context K/V" section and the matching "use_jagged_kv=False kept as alternative" bullet from Known issues. The decision is settled — jagged + varlen is the default; dense path stays in code as a legacy fallback but doesn't need user-facing framing. 5. examples/sid_gr/README.md: drop the `use_jagged_kv` mention from the "see benchmark/RESULTS.md" pointer line so the upper-level doc doesn't reintroduce the same comparison framing. Issue #1 from the codex audit (default flip + docstring refresh) was addressed in the previous commit. Signed-off-by: Runchu Zhao <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist