[PR #639] [CLOSED] layer split: with explicit split points each GPU loads only its own layers' dense weights #2737

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

📋 Pull Request Information

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

Base: main ← Head: pr-stage-trim


📝 Commits (1)

  • 5fe54e5 layer split: with explicit split points each GPU loads only its own layers' dense weights

📊 Changes

3 files changed (+61 additions, -3 deletions)

View changed files

📝 include/strata/core/native_dense.hpp (+3 -0)
📝 src/core/native_dense.cpp (+9 -0)
📝 src/program/generate.cpp (+49 -3)

📄 Description

What

With a layer split every GPU keeps a full copy of the dense weights (~3.4 GB for the Coder), although each stage only reads its own layers. This PR lets each GPU load only its layers' dense weights when the split points are explicit (--layer-split 27), and gives the freed VRAM to the expert cache.

  • The canonical arena of each GPU skips the blk.N.* tensors outside its layer range (read from the pack's index.txt). PLE tensors stay on every GPU.
  • NativeDense::set_layer_range limits the native projections the next load uploads in the same way.
  • --layer-split auto and single-GPU runs are unchanged. STRATA_STAGE_TRIM=0 keeps the full copies.
  • One log line per GPU says which layers it loads, and a later stage logs its free VRAM before its cache is sized.

Measured

2x AMD Instinct MI50 16 GB (gfx906, see #638), Coder IQ1_M, 128K context, --layer-split 27:

full copies own layers only
experts held in VRAM 8,819 of 12,288 10,626 of 12,288
VRAM hit rate in decode 95% 98%
decode, 17K-token agent prompt 39.2 tok/s 41.7 tok/s

The trimmed tensors are never read by the GPU that skips them.

Status

Re-run on 2x MI50 with this branch on current main, results in the comment below.

🤖 Generated with Claude Code


🔄 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/639 **Author:** [@JeanP00l](https://github.com/JeanP00l) **Created:** 10/3/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr-stage-trim` --- ### 📝 Commits (1) - [`5fe54e5`](https://github.com/Niko1221/Strata/commit/5fe54e55b785a1179279a35f632c439a8f245a6e) layer split: with explicit split points each GPU loads only its own layers' dense weights ### 📊 Changes **3 files changed** (+61 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `include/strata/core/native_dense.hpp` (+3 -0) 📝 `src/core/native_dense.cpp` (+9 -0) 📝 `src/program/generate.cpp` (+49 -3) </details> ### 📄 Description ## What With a layer split every GPU keeps a full copy of the dense weights (~3.4 GB for the Coder), although each stage only reads its own layers. This PR lets each GPU load only its layers' dense weights when the split points are explicit (`--layer-split 27`), and gives the freed VRAM to the expert cache. - The canonical arena of each GPU skips the `blk.N.*` tensors outside its layer range (read from the pack's `index.txt`). PLE tensors stay on every GPU. - `NativeDense::set_layer_range` limits the native projections the next `load` uploads in the same way. - `--layer-split auto` and single-GPU runs are unchanged. `STRATA_STAGE_TRIM=0` keeps the full copies. - One log line per GPU says which layers it loads, and a later stage logs its free VRAM before its cache is sized. ## Measured 2x AMD Instinct MI50 16 GB (gfx906, see #638), Coder IQ1_M, 128K context, `--layer-split 27`: | | full copies | own layers only | |---|---|---| | experts held in VRAM | 8,819 of 12,288 | 10,626 of 12,288 | | VRAM hit rate in decode | 95% | 98% | | decode, 17K-token agent prompt | 39.2 tok/s | 41.7 tok/s | The trimmed tensors are never read by the GPU that skips them. ## Status Re-run on 2x MI50 with this branch on current `main`, results in the comment below. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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:45 +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#2737
No description provided.