mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #297] [CLOSED] perf(ds4): opt-in HIP prefill transfer pruning #454
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#454
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/297
Author: @LostVector
Created: 10/20/2026
Status: ❌ Closed
Base:
main← Head:perf/ds4-skip-unpicked📝 Commits (1)
6f72b39ds4: skip unselected HIP batch-prefill transfers on current upstream📊 Changes
6 files changed (+186 additions, -1 deletions)
View changed files
📝
CMakeLists.txt(+2 -0)📝
README.md(+6 -0)➕
docs/ds4-skip-unpicked.md(+42 -0)📝
src/ds4/ds4_model.cu(+56 -1)➕
src/ds4/ds4_ram_slice.hpp(+28 -0)➕
tests/ds4_ram_slice_test.cpp(+52 -0)📄 Description
On our multi-GPU batch-loader setup, skipping unused expert transfers reduced copied payload by 18.7% and increased warm 4K prefill throughput by 3.6–3.9% in a current-upstream EXL3 integration. The reviewer's default single-GPU configuration used Maya's other loader, flow, which bypasses this change.
In plain terms, the batch loader can deliver weights for experts that no token needs. This option waits for routing and skips those deliveries. Applicability depends on the loader, quant, RAM mode and topology; GPU count alone does not determine whether it runs. Flow already makes most deliveries according to routing and is unchanged.
Enable
DS4_SKIP_UNPICKED=1in the native engine environment. It is off by default, HIP only, and does not change decode. SetDS4_FLOW_STATS=1and check for "unpicked experts skipped" before comparing speed or answers: without that message, this optimization was not exercised. No GPU IDs, VRAM budgets, CPU thread counts or cache policies become defaults.The implementation preserves virtual slots, batches, kernels and accumulation order. Explicit RAM-copy mode stages only the TP member's gate/up rows into the existing blob offsets, retaining full down rows for strided DMA. File-backed layout is unchanged. Copies still overlap computation within each layer; deferring cross-layer copies may hurt broad-routing workloads, which is why this remains opt-in.
Current-upstream integration evidence
On
8b4b39f(v1.1.29), a separate helper/packed-transfer EXL3 integration measured the following fixed-residency warm 4,096-token coding-agent prefix:Each cell averages two warm requests, with identical inputs, copied initial profiles and fixed placement. Throughput improved 3.58–3.89%; control drift was 0.30%. Reported expert payload copied per target TP member per pass fell from 141,250,490,880 to 114,879,022,848 bytes (18.67%). These are payload counters, not PCIe protocol measurements.
Two short coding/async prompts were also checked, with little timing change. All twelve sampled full-vocabulary checkpoints (three workloads, four each) matched the disabled reference byte-for-byte in every mode-0/3/0 trial; repeats also matched. Matching combine modes were compared separately. The drafter was loaded but drafting was not executed. This is not a normal-runtime MTP/decode benchmark or a standalone clean-branch timing claim.
That measured configuration used three R9700s, TP2 target layers plus a resident helper/DSpark GPU, CPU threads 8, context 262,144, chunk 4,096 and mmap off. Those are benchmark settings, not feature requirements. This clean PR includes none of the helper, drafter-placement, packed-transfer or matrix-kernel changes. Its model/header/unit-test pruning changes are identical to that validated integration port.
Earlier Q8 measurements on
abc09c7observed 2.16–2.44x faster fresh 1K–2K prefill on a different three-card setup. All 512 x 129280 float32 logits were bit-identical to the original, with an independent repeat. Those historical results do not establish a current-Q8 or general speedup. The exact settings and limitations are retained indocs/ds4-skip-unpicked.md.Current clean-branch checks
Rebased on
8b4b39f; updated the GGUF member reader to the currentmx_read_len(layer, member, projection)signature. No behavioral tuning was added.maya-ds4build passed.ds4_ram_slice_testand independent ASan/UBSan test passed: TP 1/2/4, RAM parts 1/2, gate/up and full-down spans, destination guards and invalid bounds.git diff --checkpassed.A new full-model standalone run on this clean branch has not been performed; integration evidence is labeled separately above. Windows/HIP Strix Halo and NVIDIA runtime validation remain outstanding. The unchanged default and flow/CUDA paths are intentional. See
docs/ds4-skip-unpicked.mdfor reproduction and limitations.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.