[PR #1166] [CLOSED] cpu pool: --host-core sibling, the host off the interrupts' logical processor (hybrid CPUs too) #3279

Closed
opened 2026-11-07 14:40:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1166
Author: @Hardin22
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: pr41/host-sibling


📝 Commits (1)

  • a71da89 cpu pool: --host-core sibling, the host on the first core's other hardware thread (hybrid CPUs too)

📊 Changes

6 files changed (+77 additions, -13 deletions)

View changed files

📝 docs/DETAILS.md (+5 -1)
📝 include/strata/kernels/cpu/pool.hpp (+10 -6)
📝 src/core/session.cpp (+2 -1)
📝 src/kernels/cpu/pool.cpp (+24 -0)
📝 src/kernels/cpu/pool_affinity_test.cpp (+25 -0)
📝 src/program/generate.cpp (+11 -5)

📄 Description

--host-core last exists because Windows sends a GPU's interrupts to the first logical processor, where the host thread spins on the GPU's flags. It leaves hybrid CPUs alone, though, so on a 12th-14th gen Intel or a Core Ultra the host stays on logical processor 0 together with the interrupts.

This adds --host-core sibling (or STRATA_HOST_CORE=sibling). The host stays on the first core but moves to its other hardware thread:

  • the interrupts keep logical processor 0, and nothing else is pinned there;
  • the workers keep every other core, since they take one logical processor per core. With --pool-affinity auto / p-cores, which also use the P-cores' siblings, the host's sibling is taken out of their list;
  • it works on hybrid CPUs, and it is first when the core has no SMT sibling;
  • Linux gets the same layout (the sibling from sysfs), though there the interrupts are usually spread anyway.

It is opt-in, so nothing changes by default. The startup log names the placement, e.g. the host thread on 1 (draining too) (--host-core sibling).

Measured

RTX 4060 Ti (stage 0, layers 0-19, on PCIe 4.0 x4) + RTX 5080 (stage 1), i9-14900KF (8P+16E, hybrid), Windows 11. Swift 1.5 IQ3_XXS at 160K (q4_0 KV), resident RAM mode with the whole complement in RAM, stock draft layer, --trim-stage-weights. Greedy, five prompts × two rounds, a fresh server per run, the two arms interleaved, decode tok/s:

first (today) sibling
0.1.40.1, --pipeline-windows 2 98.0, 96.0, 98.2 101.4, 99.6, 98.2
0.1.40.1 + #1122, --pipeline-windows 2 --adapt-async 1 102.1, 112.5, 98.4 112.1, 112.2, 111.4

The first row is about +2.4%. The second is +7% on average (104.3 → 111.9), and the spread goes from 14 tok/s to 0.8. That is where it matters most: there the host also queues the async tier's copies, and with the host on logical processor 0 a whole run would sometimes come out 10-15% slower, while the GPU clocks, P-states, acceptance and cache hits were the same. In the decode timing log, the slow runs had the same per-layer host time but more "GPU-reach wait". With sibling those drops went away: an earlier set of four pairs on the same stack, with some opt-in pipeline switches on, gave 105.5 ± 6 with the host on logical processor 0 and 114.2 ± 0.4 on its sibling.

The build for the second row also carried other branches' opt-in switches, all off, and a Windows power-throttling opt-out in both arms, which made no difference on its own.

Checks

  • pool_affinity_test (Windows) gains a layout check for every affinity mode (all, auto, p-cores): with sibling, the host is on the first host core's sibling, no worker is on that core, and without SMT the layout is the same as first. It passes on the 14900KF. The Linux test is unchanged, and the Linux path (sibling_of from sysfs) was neither built nor run here.
  • Builds with MSVC + CUDA 13.3 (sm_89 / sm_120).
  • Only threads move, so results are the same.

If it holds on other hybrid boxes, it may be worth making it the default for hybrid CPUs on Windows. I left that to you.


🔄 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/1166 **Author:** [@Hardin22](https://github.com/Hardin22) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr41/host-sibling` --- ### 📝 Commits (1) - [`a71da89`](https://github.com/Niko1221/Strata/commit/a71da892150aa6b30cf560c2294c936a0353c5a8) cpu pool: --host-core sibling, the host on the first core's other hardware thread (hybrid CPUs too) ### 📊 Changes **6 files changed** (+77 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+5 -1) 📝 `include/strata/kernels/cpu/pool.hpp` (+10 -6) 📝 `src/core/session.cpp` (+2 -1) 📝 `src/kernels/cpu/pool.cpp` (+24 -0) 📝 `src/kernels/cpu/pool_affinity_test.cpp` (+25 -0) 📝 `src/program/generate.cpp` (+11 -5) </details> ### 📄 Description `--host-core last` exists because Windows sends a GPU's interrupts to the first logical processor, where the host thread spins on the GPU's flags. It leaves hybrid CPUs alone, though, so on a 12th-14th gen Intel or a Core Ultra the host stays on logical processor 0 together with the interrupts. This adds `--host-core sibling` (or `STRATA_HOST_CORE=sibling`). The host stays on the first core but moves to its other hardware thread: - the interrupts keep logical processor 0, and nothing else is pinned there; - the workers keep every other core, since they take one logical processor per core. With `--pool-affinity auto` / `p-cores`, which also use the P-cores' siblings, the host's sibling is taken out of their list; - it works on hybrid CPUs, and it is `first` when the core has no SMT sibling; - Linux gets the same layout (the sibling from sysfs), though there the interrupts are usually spread anyway. It is opt-in, so nothing changes by default. The startup log names the placement, e.g. `the host thread on 1 (draining too) (--host-core sibling)`. ## Measured RTX 4060 Ti (stage 0, layers 0-19, on PCIe 4.0 x4) + RTX 5080 (stage 1), i9-14900KF (8P+16E, hybrid), Windows 11. Swift 1.5 IQ3_XXS at 160K (q4_0 KV), resident RAM mode with the whole complement in RAM, stock draft layer, `--trim-stage-weights`. Greedy, five prompts × two rounds, a fresh server per run, the two arms interleaved, decode tok/s: | | `first` (today) | `sibling` | |---|---|---| | 0.1.40.1, `--pipeline-windows 2` | 98.0, 96.0, 98.2 | 101.4, 99.6, 98.2 | | 0.1.40.1 + #1122, `--pipeline-windows 2 --adapt-async 1` | 102.1, 112.5, 98.4 | 112.1, 112.2, 111.4 | The first row is about +2.4%. The second is +7% on average (104.3 → 111.9), and the spread goes from 14 tok/s to 0.8. That is where it matters most: there the host also queues the async tier's copies, and with the host on logical processor 0 a whole run would sometimes come out 10-15% slower, while the GPU clocks, P-states, acceptance and cache hits were the same. In the decode timing log, the slow runs had the same per-layer host time but more "GPU-reach wait". With `sibling` those drops went away: an earlier set of four pairs on the same stack, with some opt-in pipeline switches on, gave 105.5 ± 6 with the host on logical processor 0 and 114.2 ± 0.4 on its sibling. The build for the second row also carried other branches' opt-in switches, all off, and a Windows power-throttling opt-out in both arms, which made no difference on its own. ## Checks - `pool_affinity_test` (Windows) gains a layout check for every affinity mode (`all`, `auto`, `p-cores`): with `sibling`, the host is on the first host core's sibling, no worker is on that core, and without SMT the layout is the same as `first`. It passes on the 14900KF. The Linux test is unchanged, and the Linux path (`sibling_of` from sysfs) was neither built nor run here. - Builds with MSVC + CUDA 13.3 (sm_89 / sm_120). - Only threads move, so results are the same. If it holds on other hybrid boxes, it may be worth making it the default for hybrid CPUs on Windows. I left that to you. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:20 +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#3279
No description provided.