Perf: skip redundant CSA scoring and fuse gather unpack - #1195
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds typed CSA all-gather pipelines and a TP_SIZE==4 decode fast path. Cache-fitting requests bypass redundant indexer scoring and projection stages. Indexer helper annotations now expose task dependencies required by the new orchestration. ChangesCSA TP4 decode path
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant decode_csa
participant typed_allgather
participant indexer
participant outputs
decode_csa->>typed_allgather: gather typed CSA payloads
typed_allgather->>outputs: write projection and cache tensors
decode_csa->>indexer: propagate task dependencies
indexer->>outputs: write bounded Top-K indices
Merge Risk: ⚪ Minimal · up to The TP4 decode optimization preserves fallback behavior, and no merge-blocking correctness or runtime risk is currently identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit reads each line, Comment |
beae8e0 to
3b48f23
Compare
- Bypass query scoring and sorting when the ratio-4 cache fits Top-K, retaining causal visibility, cache updates and the long-cache path. - Read CSA gather payloads directly into typed consumers before epoch retirement, removing full packed buffers and separate unpack waves. TP4 CSA at 16x256 on a2a3: average minimum-rank median latency falls 1016.850 -> 880.275 us (13.43%). Average minimum-rank mean latency falls 1027.507 -> 923.736 us (10.10%). Use PYPTO_BENCH=1, swimlane0, 100 timed rounds and 5 warmups, with all samples retained across AB/BA runs.
Call typed allgathers directly and remove the packed gather/unpack branch, its imports and task-ID array. TP1 is dispatched to its separate kernel before reaching distributed CSA. Retain the cache-length conditions without redundant TP guards.
Route the CSA main and aux transport fixtures through the production typed allgathers. Repack their outputs without numerical conversion to retain the existing raw-bit and retained-window epoch checks. Remove both packed allgather implementations now that no callers remain.
- Derive CSA arrival and retirement counts from push/readback workers. - Share named projection widths and wire offsets across CSA packing, typed gathers and their transport fixtures. - Name indexer dependency slots and CSA pack/visible-index worker sizes.
in distributed CSA, retaining causal visibility, cache updates and
the long-cache path.
retirement, removing full packed buffers and separate unpack waves.
Distributed CSA calls both typed gathers directly; TP1 uses its
separate decode_csa_tp1 entry. Standalone transport fixtures exercise
the same typed gathers, replacing their legacy packed implementations.
TP4 CSA at 16x256 on a2a3: minimum per-rank median latency falls from
1010.05 µs to 880.500 µs (12.83%). Measured with PYPTO_BENCH=1,
swimlane0, 100 timed rounds and 5 warmups, with all 400 timed samples
retained.