Final review report · NVIDIA/hyperflare-inference #673

Raw Markdown for agents: https://autobot.eidonix.com/p/58c1e78d-2380-47aa-a279-d059844f8dc6.md

Recommendation: Changes Requested

The kernel changes in ignition/components/logprobs.py are mathematically sound, bit-exact, and address a real speculative-decoding preparation bottleneck (~15×–100× faster cold prepare() by collapsing per-width cubins and bounding _finish's bitonic sort block), backed by the repository's first direct unit and CUDA tests for these kernels. No correctness, ABI, or CUDA-graph capture defects were found. However, before merge, the runtime launch changes that apply across all vocabularies (_MERGE_WARPS 8→4 for every V, chunked serial sorts for V >= 16,385) need before/after latency coverage beyond the single V = 262,144 / width = 6 point (plus complete-replay/exported-core validation per docs/logprobs-design.md:129-130), the PR description should make the 8 → 4 warp transition explicit, and CPU CI needs to run on head 1337213.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. Measure the unmeasured runtime regimes and document the full before/after launch change (ignition/components/logprobs.py:23-26, 137-147, 164):
    • Verified behavior & impact: Two independent launch changes apply well beyond the single measured point (V = 262,144, width = 6):
      1. _MERGE_WARPS changed from 8 to 4 (ignition/components/logprobs.py:26 vs main:22), affecting every vocabulary—including V <= 16,384 where BLOCK is unchanged—while the PR description only mentions 4 warps inside the 512 cap bullet without stating the 8 → 4 transition.
      2. merge_block = min(triton.next_power_of_2(tiles * _TILE_CANDIDATES), _MERGE_BLOCK) (ignition/components/logprobs.py:164) replaces a single 1024..4096-key sort with 2..9 serial 512-key sorts for every V >= 16,385 (e.g., 9 serial sorts at V = 131,072). None of V <= 16,384, 32k–128k, or width = 1 are measured before/after, and docs/logprobs-design.md:129-130 specifies: "Performance claims about the reduction require complete replay and service measurements."
    • Concrete fix:
      • Add before/after CUDA-graph latency measurements (e.g. using the in-repo scripts/benchmark_logprobs.py harness at width in (1, 6)) covering representative small (<= 16,384), mid (~128k), and 262,144 vocabularies, plus a complete replay or exported-core check (docs/logprobs-design.md:129-130, docs/performance-work.md:45-51), or explicitly bound the runtime speedup claim to the measured V = 262,144 case while tracking unrun SM103/SM120/SM121 and exported-core checks in docs/TODO.txt (AGENTS.md:57-58).
      • Update the PR description's "What changed" section (AGENTS.md:88-94) to explicitly note the _MERGE_WARPS 8 → 4 change (affecting all vocabularies) and clarify that _finish remains specialized per vocabulary via TILES: tl.constexpr (collapsing only the width dimension).
      • Ensure CPU CI (.github/workflows/python-cpu.yml (not opened)) runs and passes on the PR head before merge.

Subtract / Simplify

  1. Drop tautological module-level assert (ignition/components/logprobs.py:24):
    • assert _MERGE_BLOCK > _TILE_CANDIDATES and (_MERGE_BLOCK & (_MERGE_BLOCK - 1)) == 0 checks two adjacent module literals (512 and 32), is the only top-level assert in ignition/, cannot fail at runtime, and is stripped under python -O. Deleting line 24 leaves the concise comment at lines 21–22 intact.

Nits

Dropped on verification