[PR #578] [CLOSED] Improve multi-GPU decode performance via optimized expert-helper execution #2703

Closed
opened 2026-11-04 02:02:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/578
Author: @zhedang
Created: 10/3/2026
Status: ❌ Closed

Base: main ← Head: feat/remote-expert-opt-pr


📝 Commits (1)

  • b28121f core: optimize remote expert helper decode

📊 Changes

11 files changed (+370 additions, -32 deletions)

View changed files

📝 CMakeLists.txt (+1 -0)
📝 docs/SECOND_GPU.md (+32 -0)
📝 include/strata/core/expert_cache.hpp (+7 -0)
➕ include/strata/core/remote_expert_opt.hpp (+53 -0)
📝 include/strata/core/remote_experts.hpp (+5 -1)
📝 include/strata/core/verify.hpp (+3 -0)
📝 src/core/expert_source.cpp (+8 -6)
➕ src/core/remote_expert_opt.cu (+194 -0)
📝 src/core/remote_experts.cpp (+28 -15)
📝 src/core/verify.cpp (+9 -1)
📝 src/program/generate.cpp (+30 -9)

📄 Description

Summary

This PR improves multi-GPU decode performance by making the primary GPU and
expert-helper GPUs cooperate more efficiently.

The optimized v2.2 expert-helper path delivers substantial decode speedups
over both the previous expert-helper path and the automatic layer-split path.

Speedup summary

GPUs / Version Compared against Mixed Code Math20
RTX 5090 + RTX 4090 / 0.1.38 Original expert-helper +28% +63% +42%
RTX 5090 + RTX 4090 / 0.1.38 Automatic layer split +17% +16% +18%
Dual RTX 4090 / 0.1.37 Original expert-helper +63% +132% —
Dual RTX 4090 / 0.1.37 Automatic layer split +13% +34% —

Enabled with --remote-expert-opt. Disabled by default.


Benchmarks

RTX 5090 + RTX 4090 — 0.1.38

Decode throughput, in tokens/s:

Configuration Mixed Code Math20
Original expert helper 135.49 152.56 158.61
Automatic layer split 147.41 213.89 191.06
Optimized expert helper 173.04 248.38 226.00

Dual RTX 4090 — 0.1.37

Decode throughput, in tokens/s:

Configuration Mixed Code
Original expert helper 88.07 85.15
Automatic layer split 126.86 146.95
Optimized expert helper 143.35 197.58

What changed

  • Complementary expert caches
    Keep the primary and helper GPU expert caches complementary, reducing
    duplicated experts and CPU fallback.

  • Lower inter-GPU transfer volume
    Reduce weighted expert outputs on helper GPUs before returning results.

  • Skip unnecessary CPU quantization
    Avoid CPU activation quantization when all selected experts are served by GPUs.

  • Automatic helper-cache sizing
    Add auto sizing based on available VRAM, removing the need to manually tune
    expert counts.

The existing primary/helper GPU layout remains unchanged.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/578 **Author:** [@zhedang](https://github.com/zhedang) **Created:** 10/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/remote-expert-opt-pr` --- ### 📝 Commits (1) - [`b28121f`](https://github.com/Niko1221/Strata/commit/b28121ff6ef117bec2558b3ece7e188dd33a2b7e) core: optimize remote expert helper decode ### 📊 Changes **11 files changed** (+370 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -0) 📝 `docs/SECOND_GPU.md` (+32 -0) 📝 `include/strata/core/expert_cache.hpp` (+7 -0) ➕ `include/strata/core/remote_expert_opt.hpp` (+53 -0) 📝 `include/strata/core/remote_experts.hpp` (+5 -1) 📝 `include/strata/core/verify.hpp` (+3 -0) 📝 `src/core/expert_source.cpp` (+8 -6) ➕ `src/core/remote_expert_opt.cu` (+194 -0) 📝 `src/core/remote_experts.cpp` (+28 -15) 📝 `src/core/verify.cpp` (+9 -1) 📝 `src/program/generate.cpp` (+30 -9) </details> ### 📄 Description ## Summary This PR improves multi-GPU decode performance by making the primary GPU and expert-helper GPUs cooperate more efficiently. The optimized **v2.2 expert-helper path** delivers substantial decode speedups over both the previous expert-helper path and the automatic layer-split path. ### Speedup summary | GPUs / Version | Compared against | Mixed | Code | Math20 | |---|---|---:|---:|---:| | RTX 5090 + RTX 4090 / 0.1.38 | Original expert-helper | **+28%** | **+63%** | **+42%** | | RTX 5090 + RTX 4090 / 0.1.38 | Automatic layer split | **+17%** | **+16%** | **+18%** | | Dual RTX 4090 / 0.1.37 | Original expert-helper | **+63%** | **+132%** | — | | Dual RTX 4090 / 0.1.37 | Automatic layer split | **+13%** | **+34%** | — | > Enabled with `--remote-expert-opt`. Disabled by default. --- ## Benchmarks ### RTX 5090 + RTX 4090 — 0.1.38 Decode throughput, in tokens/s: | Configuration | Mixed | Code | Math20 | |---|---:|---:|---:| | Original expert helper | 135.49 | 152.56 | 158.61 | | Automatic layer split | 147.41 | 213.89 | 191.06 | | **Optimized expert helper** | **173.04** | **248.38** | **226.00** | ### Dual RTX 4090 — 0.1.37 Decode throughput, in tokens/s: | Configuration | Mixed | Code | |---|---:|---:| | Original expert helper | 88.07 | 85.15 | | Automatic layer split | 126.86 | 146.95 | | **Optimized expert helper** | **143.35** | **197.58** | --- ## What changed - **Complementary expert caches** Keep the primary and helper GPU expert caches complementary, reducing duplicated experts and CPU fallback. - **Lower inter-GPU transfer volume** Reduce weighted expert outputs on helper GPUs before returning results. - **Skip unnecessary CPU quantization** Avoid CPU activation quantization when all selected experts are served by GPUs. - **Automatic helper-cache sizing** Add `auto` sizing based on available VRAM, removing the need to manually tune expert counts. The existing primary/helper GPU layout remains unchanged. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:02:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2703
No description provided.