Skip to content

perf: COALESCE=1 multi-expert coalesced pread for contiguous shard runs - #1398

Draft
KyleSanderson wants to merge 2 commits into
JustVugg:devfrom
KyleSanderson:perf/glm-disk-coalesce
Draft

KyleSanderson wants to merge 2 commits into
JustVugg:devfrom
KyleSanderson:perf/glm-disk-coalesce

Conversation

@KyleSanderson

@KyleSanderson KyleSanderson commented Sep 8, 2026

Copy link
Copy Markdown

Summary

When a PIPE miss batch contains experts that are contiguous in the same shard file,
issue a single pread for the combined range instead of one per expert.
Gated by COALESCE=1 env flag (default off); zero behavior change when off.

A/B on GLM-5.2 real workload (--ram 8, PIPE=1 DIRECT=1 IDOT_TEAM=1):
prefill: 63.4s -> 58.3s (-8%)
decode: 50.9s -> 43.6s (-14%)
disk service: prefill -8%, decode -16%
No regression in output correctness or expert-matmul IPC.

Validation

  • make -C c check
  • CUDA changes were tested with make -C c cuda-test (if applicable)
  • Performance claims include hardware, commands, and repeatable measurements

Compatibility

  • The default CPU build remains dependency-free
  • No model files, generated binaries, or benchmark artifacts are included

When a PIPE miss batch contains experts that are contiguous in the same shard file,
issue a single pread for the combined range instead of one per expert.
Gated by COALESCE=1 env flag (default off); zero behavior change when off.

A/B on GLM-5.2 real workload (--ram 8, PIPE=1 DIRECT=1 IDOT_TEAM=1):
  prefill:  63.4s -> 58.3s (-8%)
  decode:   50.9s -> 43.6s (-14%)
  disk service: prefill -8%, decode -16%
No regression in output correctness or expert-matmul IPC.
@KyleSanderson
KyleSanderson marked this pull request as draft September 8, 2026 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant