[PR #3730] [Engine] keep the automatic NUMA pool off when the experts come from the arena path (#3708) #4759

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3730
Author: @baptisterajaut
Created: 10/22/2026
Status: 🔄 Open

Base: main ← Head: fix/numa-split-arena


📝 Commits (1)

  • 5a13bbe fix: keep the automatic NUMA pool off when the experts come from the arena path

📊 Changes

5 files changed (+53 additions, -4 deletions)

View changed files

📝 docs/DETAILS.md (+6 -3)
📝 include/strata/kernels/cpu/pool.hpp (+6 -0)
📝 src/kernels/cpu/pool.cpp (+11 -1)
📝 src/kernels/cpu/pool_tasks_test.cpp (+27 -0)
📝 src/program/generate.cpp (+3 -0)

📄 Description

Problem and result

Since 0.2.2 the NUMA pool turns itself on as soon as it finds two nodes with CPUs, the arena path included, where the experts' memory is not placed per node. There the split only adds workers on the second socket (19 instead of 10 in #3708) that read memory partly on the other node, with a cross-socket pool barrier per layer. #3708 measured it on 2x Xeon Gold 6226R with every expert in VRAM: 3.7K prefill at 1697 tok/s with the split against 1830 without, decode between 40 and 60 tok/s from run to run.

With this change the arena path keeps the one-socket pool and says why at start:

strata cpu pool: NUMA pool off: this model's experts come from the arena path, which does not place memory per node (2 NUMA nodes found), the pool runs as before (STRATA_NUMA_SPLIT=1 forces the split)

The file path (FileExpertSource, which places memory per node) is unchanged, and STRATA_NUMA_SPLIT=1 still forces the split on the arena path.

#3708. The "arena path: memory is not placed per node" warning it quotes comes from my split branch (2496795b), written when the split was opt-in (#3201).

Approach

generate.cpp sets a veto (set_numa_pool_veto) before the pool is built when the expert source is the arena. ExpertPool then skips the automatic attempt the way STRATA_NUMA_POOL=0 does (same worker count, same cores) and logs the reason. An explicit STRATA_NUMA_SPLIT=1 is not affected. Placing the arena per node would be the real fix, but it touches ArenaExpertSource's allocation and pinning; the veto gives the arena path its 0.2.1 behaviour back until then. docs/DETAILS.md adds the arena path to the cases where the split does not run.

Validation

Passed:

  • pool_tasks_test, pool_cores_test, numa_pool_test, pool_plan_test: rc 0, with #3706's test fix applied (not part of this branch). The new block in pool_tasks_test uses the fake two nodes: with the veto, the pool has the workers and cores of STRATA_NUMA_POOL=0 and no split (pool tasks: fake two nodes, veto: split off, 11 workers as with STRATA_NUMA_POOL=0); with the veto and STRATA_NUMA_SPLIT=1, the split still runs with 2 slices.
  • The file path on a real engine: Qwen3.8-Flash-Next IQ4_XS with --resident-budget-gib 55 (FileExpertSource), 2x Xeon Gold 6226, 64 GB, RTX 3090. The start-up still shows NUMA split on: slice 0 = node 0 (12 threads), slice 1 = node 1 (11 threads) and the per-node placement; decode 48.2 / 54.3 / 55.4 tok/s over 3 turns.
  • Environment: the branch's files built in a v0.2.2 checkout (main at 011c9e60 is v0.2.2), CUDA 13.2, Debian 12.

Failed: none observed.

Not run:

  • The arena path on a real engine. The only models on this box (Flash-Next IQ4_XS, about 50 GiB of experts) do not fit the resident arena in 64 GB: both arena runs were OOM-killed at 61.5 GB RSS before the pool was built. The veto's log line and its effect on decode in #3708's setup are therefore unverified; I have asked there for a run with this branch.
  • HIP, SYCL and Metal builds: pool.cpp and generate.cpp are part of them, and I have no toolchain for them. The change is plain C++ with no backend code.

Limits

The arena path keeps the one-socket pool even where the split could help (experts partly on the CPU), until the arena places its memory per node.


🔄 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/3730 **Author:** [@baptisterajaut](https://github.com/baptisterajaut) **Created:** 10/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/numa-split-arena` --- ### 📝 Commits (1) - [`5a13bbe`](https://github.com/Niko1221/Strata/commit/5a13bbefb25cca2983a807c782f0b3911eba646d) fix: keep the automatic NUMA pool off when the experts come from the arena path ### 📊 Changes **5 files changed** (+53 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+6 -3) 📝 `include/strata/kernels/cpu/pool.hpp` (+6 -0) 📝 `src/kernels/cpu/pool.cpp` (+11 -1) 📝 `src/kernels/cpu/pool_tasks_test.cpp` (+27 -0) 📝 `src/program/generate.cpp` (+3 -0) </details> ### 📄 Description ## Problem and result Since 0.2.2 the NUMA pool turns itself on as soon as it finds two nodes with CPUs, the arena path included, where the experts' memory is not placed per node. There the split only adds workers on the second socket (19 instead of 10 in #3708) that read memory partly on the other node, with a cross-socket pool barrier per layer. #3708 measured it on 2x Xeon Gold 6226R with every expert in VRAM: 3.7K prefill at 1697 tok/s with the split against 1830 without, decode between 40 and 60 tok/s from run to run. With this change the arena path keeps the one-socket pool and says why at start: ``` strata cpu pool: NUMA pool off: this model's experts come from the arena path, which does not place memory per node (2 NUMA nodes found), the pool runs as before (STRATA_NUMA_SPLIT=1 forces the split) ``` The file path (FileExpertSource, which places memory per node) is unchanged, and `STRATA_NUMA_SPLIT=1` still forces the split on the arena path. ## Related discussion #3708. The "arena path: memory is not placed per node" warning it quotes comes from my split branch (2496795b), written when the split was opt-in (#3201). ## Approach `generate.cpp` sets a veto (`set_numa_pool_veto`) before the pool is built when the expert source is the arena. `ExpertPool` then skips the automatic attempt the way `STRATA_NUMA_POOL=0` does (same worker count, same cores) and logs the reason. An explicit `STRATA_NUMA_SPLIT=1` is not affected. Placing the arena per node would be the real fix, but it touches ArenaExpertSource's allocation and pinning; the veto gives the arena path its 0.2.1 behaviour back until then. `docs/DETAILS.md` adds the arena path to the cases where the split does not run. ## Validation **Passed:** - `pool_tasks_test`, `pool_cores_test`, `numa_pool_test`, `pool_plan_test`: rc 0, with #3706's test fix applied (not part of this branch). The new block in `pool_tasks_test` uses the fake two nodes: with the veto, the pool has the workers and cores of `STRATA_NUMA_POOL=0` and no split (`pool tasks: fake two nodes, veto: split off, 11 workers as with STRATA_NUMA_POOL=0`); with the veto and `STRATA_NUMA_SPLIT=1`, the split still runs with 2 slices. - The file path on a real engine: Qwen3.8-Flash-Next IQ4_XS with `--resident-budget-gib 55` (FileExpertSource), 2x Xeon Gold 6226, 64 GB, RTX 3090. The start-up still shows `NUMA split on: slice 0 = node 0 (12 threads), slice 1 = node 1 (11 threads)` and the per-node placement; decode 48.2 / 54.3 / 55.4 tok/s over 3 turns. - Environment: the branch's files built in a v0.2.2 checkout (main at 011c9e60 is v0.2.2), CUDA 13.2, Debian 12. **Failed:** none observed. **Not run:** - The arena path on a real engine. The only models on this box (Flash-Next IQ4_XS, about 50 GiB of experts) do not fit the resident arena in 64 GB: both arena runs were OOM-killed at 61.5 GB RSS before the pool was built. The veto's log line and its effect on decode in #3708's setup are therefore unverified; I have asked there for a run with this branch. - HIP, SYCL and Metal builds: `pool.cpp` and `generate.cpp` are part of them, and I have no toolchain for them. The change is plain C++ with no backend code. ## Limits The arena path keeps the one-socket pool even where the split could help (experts partly on the CPU), until the arena places its memory per node. --- <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#4759
No description provided.