[PR #2242] [Engine] numa-placement: --numa-hot-node N - keep the GPU-side host pools on the GPU's NUMA node (Linux, dual-socket, opt-in) #3943

Open
opened 2026-11-07 15:31:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2242
Author: @G0-0000
Created: 10/13/2026
Status: 🔄 Open

Base: main ← Head: feat/numa-placement


📝 Commits (9)

  • 156cf52 numa: --numa-hot-node N claims the RAM complement on the GPU's node before the startup fill
  • 117b7ab numa: lift the NUMA primitives out of expert_source.cpp into numa_policy.hpp
  • a49949a numa: publish the hot and cold node process-wide, cold derived from hot
  • f7d1c56 numa: place the layer, session, weight and native-head pinned pools on the hot node
  • e33655d numa: place a conversation buffer's segments on the cold node
  • 6a01c56 docs: how to find the GPU's NUMA node for --numa-hot-node
  • 5b4dce4 numa: judge the claim by the node's own free memory, and its id by the host's node list
  • 8017e50 resident: fix budget clamp double-counting the pre-claimed arena
  • cc9cd6e resident: test the arena credit in the budget clamp, and saturate it

📊 Changes

14 files changed (+859 additions, -57 deletions)

View changed files

📝 CMakeLists.txt (+1 -1)
📝 docs/AI_SETUP.md (+1 -0)
📝 docs/DETAILS.md (+18 -0)
📝 include/strata/core/conversation_buffer.hpp (+14 -0)
📝 include/strata/core/expert_source.hpp (+45 -0)
➕ include/strata/core/numa_policy.hpp (+118 -0)
📝 src/core/expert_source.cpp (+320 -34)
📝 src/core/layer.cpp (+21 -9)
📝 src/core/native_head.cpp (+14 -1)
➕ src/core/numa_policy.cpp (+27 -0)
📝 src/core/session.cpp (+17 -5)
📝 src/core/weights.cpp (+17 -6)
📝 src/program/generate.cpp (+75 -1)
📝 tests/core/file_expert_source_test.cpp (+171 -0)

📄 Description

What this is

An opt-in placement for the expert RAM complement: --numa-hot-node N claims the complement on the NUMA node that holds the GPU before the startup fill, so a dual-socket box does not spill part of it to the other socket. --numa-cold-node places the session and conversation buffers on the other node.

Rebased onto 0.2.2 on 2026-10-22, and now includes the budget-clamp fix from #2501 (closed with the 0.2.0-beta tracker reset) plus its regression tests. That fix belongs to this path: without it the clamp counts the pre-claimed arena twice.

Why

On the measured box (dual-socket, 125 GiB as two ~63 GiB nodes, Tesla V100-SXM2-32GB, engine bound to node1 with the GPU), the complement used to land 80.6 % on node1 and the rest on node0; the claim takes it to 100 %, and after the startup fill the file tier reads nothing from disk. This is a placement change, not a speed claim: decode and prompt numbers stayed inside the run-to-run spread.

Relation to #3201 / STRATA_NUMA_POOL

#3201 splits the CPU expert pool per NUMA node and places each socket's half of every expert's rows locally. This PR is the other axis: it keeps the whole complement on the GPU's node. They are complementary but should not be combined blindly: when the hot-node claim wins, the split's complement placement does not run, and this branch now prints one line saying so. Our deployment runs STRATA_NUMA_POOL=0.

Validation

Passed: CUDA 12.9 (sm_70) full build; file_expert_source_test, including the clamp regression and the node accessors; numa_pool_test unchanged; --numa-hot-node foo exits 2 with the usage line.

Not run: an end-to-end run of this rebased branch on the dual-socket box (the production service holds the GPU), and Windows/HIP/SYCL builds.

Defaults

No flag: upstream behaviour and the same startup output. Non-Linux degrades with a per-site warning.


🔄 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/2242 **Author:** [@G0-0000](https://github.com/G0-0000) **Created:** 10/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/numa-placement` --- ### 📝 Commits (9) - [`156cf52`](https://github.com/Niko1221/Strata/commit/156cf523c5faa95f38ab53c6aba2dc86833384a8) numa: --numa-hot-node N claims the RAM complement on the GPU's node before the startup fill - [`117b7ab`](https://github.com/Niko1221/Strata/commit/117b7ab1f0900ddc793aabbb17bbe3af8cecf506) numa: lift the NUMA primitives out of expert_source.cpp into numa_policy.hpp - [`a49949a`](https://github.com/Niko1221/Strata/commit/a49949a940c5b37ca9308db072eb7e5a637b712d) numa: publish the hot and cold node process-wide, cold derived from hot - [`f7d1c56`](https://github.com/Niko1221/Strata/commit/f7d1c56622a686d78f7bac9b7b4ed73aca8c3721) numa: place the layer, session, weight and native-head pinned pools on the hot node - [`e33655d`](https://github.com/Niko1221/Strata/commit/e33655d71fb1def0baab238eaa722a2438d8002a) numa: place a conversation buffer's segments on the cold node - [`6a01c56`](https://github.com/Niko1221/Strata/commit/6a01c56110e950efb91453837cb06f125f2f4067) docs: how to find the GPU's NUMA node for --numa-hot-node - [`5b4dce4`](https://github.com/Niko1221/Strata/commit/5b4dce4f71460a82939a0ffb399d583b453e92e1) numa: judge the claim by the node's own free memory, and its id by the host's node list - [`8017e50`](https://github.com/Niko1221/Strata/commit/8017e5031cad134b08a9bf08cb4e05ab81ec487d) resident: fix budget clamp double-counting the pre-claimed arena - [`cc9cd6e`](https://github.com/Niko1221/Strata/commit/cc9cd6e61f048a2b65af626864ed46e33b8c2789) resident: test the arena credit in the budget clamp, and saturate it ### 📊 Changes **14 files changed** (+859 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -1) 📝 `docs/AI_SETUP.md` (+1 -0) 📝 `docs/DETAILS.md` (+18 -0) 📝 `include/strata/core/conversation_buffer.hpp` (+14 -0) 📝 `include/strata/core/expert_source.hpp` (+45 -0) ➕ `include/strata/core/numa_policy.hpp` (+118 -0) 📝 `src/core/expert_source.cpp` (+320 -34) 📝 `src/core/layer.cpp` (+21 -9) 📝 `src/core/native_head.cpp` (+14 -1) ➕ `src/core/numa_policy.cpp` (+27 -0) 📝 `src/core/session.cpp` (+17 -5) 📝 `src/core/weights.cpp` (+17 -6) 📝 `src/program/generate.cpp` (+75 -1) 📝 `tests/core/file_expert_source_test.cpp` (+171 -0) </details> ### 📄 Description ## What this is An opt-in placement for the expert RAM complement: `--numa-hot-node N` claims the complement on the NUMA node that holds the GPU before the startup fill, so a dual-socket box does not spill part of it to the other socket. `--numa-cold-node` places the session and conversation buffers on the other node. Rebased onto 0.2.2 on 2026-10-22, and now includes the budget-clamp fix from #2501 (closed with the 0.2.0-beta tracker reset) plus its regression tests. That fix belongs to this path: without it the clamp counts the pre-claimed arena twice. ## Why On the measured box (dual-socket, 125 GiB as two ~63 GiB nodes, Tesla V100-SXM2-32GB, engine bound to node1 with the GPU), the complement used to land 80.6 % on node1 and the rest on node0; the claim takes it to 100 %, and after the startup fill the file tier reads nothing from disk. This is a placement change, not a speed claim: decode and prompt numbers stayed inside the run-to-run spread. ## Relation to #3201 / STRATA_NUMA_POOL #3201 splits the CPU expert pool per NUMA node and places each socket's half of every expert's rows locally. This PR is the other axis: it keeps the whole complement on the GPU's node. They are complementary but should not be combined blindly: when the hot-node claim wins, the split's complement placement does not run, and this branch now prints one line saying so. Our deployment runs `STRATA_NUMA_POOL=0`. ## Validation Passed: CUDA 12.9 (sm_70) full build; `file_expert_source_test`, including the clamp regression and the node accessors; `numa_pool_test` unchanged; `--numa-hot-node foo` exits 2 with the usage line. Not run: an end-to-end run of this rebased branch on the dual-socket box (the production service holds the GPU), and Windows/HIP/SYCL builds. ## Defaults No flag: upstream behaviour and the same startup output. Non-Linux degrades with a per-site warning. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#3943
No description provided.