[GH-ISSUE #1254] [Optimization] Support CPPC / configurable core placement for host loop and expert pool #516

Closed
opened 2026-11-04 01:43:41 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @bceenaeiklmr on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1254

Feature / Optimization: Support CPPC preferred core placement for host loop and expert pool (avoid pinning host loop to slowest core)

Context

In src/kernels/cpu/pool.cpp, CorePlacement::CorePlacement initializes the placement for the host loop and the worker pool:

CorePlacement::CorePlacement(bool spare_first) : cores_(physical_cores()) {
    for (size_t c = 0; c < cores_.size(); ++c)
        for (int p : cores_[c]) {
            if (p >= (int) core_of_.size()) core_of_.resize((size_t) p + 1, -1);
            core_of_[(size_t) p] = (int) c;
        }
    host_ = cores_.back().front();
    for (size_t c = spare_first && cores_.size() > 4 ? 1 : 0; c + 1 < cores_.size(); ++c)
        workers_.push_back(cores_[c].front());
}

Problem

On modern multi-core x86 processors with asymmetric core performance (AMD Zen 3/4/5 ACPI CPPC preferred cores, Intel hybrid P/E architectures), silicon binning varies across physical cores on the die.

Hardcoding host_ = cores_.back().front() blindly pins the latency-critical host thread to the highest-numbered physical core (e.g. Core 7 on an 8-core CPU).

On an AMD Ryzen 7 5800X3D (8C/16T, dual RTX 3090 setup), querying the Windows kernel ACPI CPPC power capabilities (Kernel-Processor-Power Event ID 55) reveals:

  • Core 2 (Processors 4, 5): 158% max performance capability (CPPC Preferred / Gold Star)
  • Core 3 (Processors 6, 7): 158% max performance capability (CPPC Preferred / Gold Star)
  • Core 1 (Processors 2, 3): 154%
  • Core 4 (Processors 8, 9): 150%
  • Core 0 (Processors 0, 1): 145% (intentionally spared for GPU PCIe interrupts and OS DPCs)
  • Core 5 (Processors 10, 11): 141%
  • Core 6 (Processors 12, 13): 137%
  • Core 7 (Processors 14, 15): 133% (the slowest, lowest-binned core on the entire chip)

Because the host thread runs session_loop, spins on cudaEventQuery, schedules CUDA kernels across GPUs, conducts MTP verification, and handles token sampling, pinning it to the slowest silicon core caps its single-threaded boost frequency and introduces unnecessary scheduling latency.

Proposed Solution

  1. Configurable Environment Variables:
    Allow runtime overrides via environment variables (STRATA_HOST_PROC and STRATA_WORKER_PROCS) in CorePlacement::CorePlacement:
const char* env_host = std::getenv("STRATA_HOST_PROC");
if (env_host != nullptr && *env_host != '\0') {
    int hp = std::atoi(env_host);
    if (hp >= 0 && hp < (int) core_of_.size()) host_ = hp;
}
const char* env_workers = std::getenv("STRATA_WORKER_PROCS");
if (env_workers != nullptr && *env_workers != '\0') {
    std::vector<int> w;
    std::stringstream ss(env_workers);
    std::string item;
    while (std::getline(ss, item, ',')) {
        int p = std::atoi(item.c_str());
        if (p >= 0 && p < (int) core_of_.size()) w.push_back(p);
    }
    if (!w.empty()) workers_ = w;
}

This allows setting in strata-<model>.json:

"env": {
  "STRATA_HOST_PROC": "4",
  "STRATA_WORKER_PROCS": "6,2,8,10,12,14"
}
  1. Automated CPPC Detection (Optional Future Extension):
    Alternatively, query OS CPPC information at startup:
  • Windows: GetSystemCpuSetInformation / ACPI _CPC objects
  • Linux: /sys/devices/system/cpu/cpu*/acpi_cppc/highest_perf
    and sort cores by performance before allocating host_ and workers_.

Verification & Benchmarks

Testing with Qwen3.8-Flash-Next on Dual RTX 3090s and Ryzen 7 5800X3D:

  • By sparing Core 0 (0,1) for GPU interrupts, pinning the Host Thread to Core 2 (processor 4, 158% Gold Star), and assigning workers to Cores 3, 1, 4, 5, 6, 7 (6,2,8,10,12,14):
    • Short prompt prefill improved by +6.0% (58.7 tok/s -> 62.2 tok/s).
    • Host event loop and CUDA synchronization runs on the highest-clocked core instead of the silicon's worst core.
Originally created by @bceenaeiklmr on GitHub (Oct 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1254 ### Feature / Optimization: Support CPPC preferred core placement for host loop and expert pool (avoid pinning host loop to slowest core) #### Context In `src/kernels/cpu/pool.cpp`, `CorePlacement::CorePlacement` initializes the placement for the host loop and the worker pool: ```cpp CorePlacement::CorePlacement(bool spare_first) : cores_(physical_cores()) { for (size_t c = 0; c < cores_.size(); ++c) for (int p : cores_[c]) { if (p >= (int) core_of_.size()) core_of_.resize((size_t) p + 1, -1); core_of_[(size_t) p] = (int) c; } host_ = cores_.back().front(); for (size_t c = spare_first && cores_.size() > 4 ? 1 : 0; c + 1 < cores_.size(); ++c) workers_.push_back(cores_[c].front()); } ``` #### Problem On modern multi-core x86 processors with asymmetric core performance (AMD Zen 3/4/5 ACPI CPPC preferred cores, Intel hybrid P/E architectures), silicon binning varies across physical cores on the die. Hardcoding `host_ = cores_.back().front()` blindly pins the latency-critical host thread to the highest-numbered physical core (e.g. Core 7 on an 8-core CPU). On an AMD Ryzen 7 5800X3D (8C/16T, dual RTX 3090 setup), querying the Windows kernel ACPI CPPC power capabilities (Kernel-Processor-Power Event ID 55) reveals: * **Core 2 (Processors 4, 5)**: **158% max performance capability** (CPPC Preferred / Gold Star) * **Core 3 (Processors 6, 7)**: **158% max performance capability** (CPPC Preferred / Gold Star) * **Core 1 (Processors 2, 3)**: **154%** * **Core 4 (Processors 8, 9)**: **150%** * **Core 0 (Processors 0, 1)**: **145%** (intentionally spared for GPU PCIe interrupts and OS DPCs) * **Core 5 (Processors 10, 11)**: **141%** * **Core 6 (Processors 12, 13)**: **137%** * **Core 7 (Processors 14, 15)**: **133% (the slowest, lowest-binned core on the entire chip)** Because the host thread runs `session_loop`, spins on `cudaEventQuery`, schedules CUDA kernels across GPUs, conducts MTP verification, and handles token sampling, pinning it to the slowest silicon core caps its single-threaded boost frequency and introduces unnecessary scheduling latency. #### Proposed Solution 1. **Configurable Environment Variables**: Allow runtime overrides via environment variables (`STRATA_HOST_PROC` and `STRATA_WORKER_PROCS`) in `CorePlacement::CorePlacement`: ```cpp const char* env_host = std::getenv("STRATA_HOST_PROC"); if (env_host != nullptr && *env_host != '\0') { int hp = std::atoi(env_host); if (hp >= 0 && hp < (int) core_of_.size()) host_ = hp; } const char* env_workers = std::getenv("STRATA_WORKER_PROCS"); if (env_workers != nullptr && *env_workers != '\0') { std::vector<int> w; std::stringstream ss(env_workers); std::string item; while (std::getline(ss, item, ',')) { int p = std::atoi(item.c_str()); if (p >= 0 && p < (int) core_of_.size()) w.push_back(p); } if (!w.empty()) workers_ = w; } ``` This allows setting in `strata-<model>.json`: ```json "env": { "STRATA_HOST_PROC": "4", "STRATA_WORKER_PROCS": "6,2,8,10,12,14" } ``` 2. **Automated CPPC Detection (Optional Future Extension)**: Alternatively, query OS CPPC information at startup: - Windows: `GetSystemCpuSetInformation` / ACPI `_CPC` objects - Linux: `/sys/devices/system/cpu/cpu*/acpi_cppc/highest_perf` and sort cores by performance before allocating `host_` and `workers_`. #### Verification & Benchmarks Testing with Qwen3.8-Flash-Next on Dual RTX 3090s and Ryzen 7 5800X3D: - By sparing Core 0 (0,1) for GPU interrupts, pinning the Host Thread to Core 2 (processor 4, 158% Gold Star), and assigning workers to Cores 3, 1, 4, 5, 6, 7 (`6,2,8,10,12,14`): - Short prompt prefill improved by **+6.0%** (58.7 tok/s -> 62.2 tok/s). - Host event loop and CUDA synchronization runs on the highest-clocked core instead of the silicon's worst core.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156045129 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Author
Owner

@bceenaeiklmr commented on GitHub (Oct 14, 2026):

Hi @Niko1221,

Thank you for following up. I tested this on the official 0.1.44 release (and 0.1.44.1). The issue
persists because detect_cpu_topology() in src/kernels/cpu/pool.cpp only handles Intel EfficiencyClass (P-
core vs E-core separation).

On desktop processors where all physical cores report EfficiencyClass = 0, the engine's core allocation
offers only two hardcoded placements: --host-core first (Core 0) or --host-core last (highest-numbered
core).

1. Engine Log on Official 0.1.44

Running the official prebuilt strata 0.1.44:

  • With default --host-core first:

strata generate: 7 pool workers on logical processors 2,4,6,8,10,12,14, the host thread on 0 (draining too) (--
host-core first)
strata generate: session is up (engine 0.1.44)

  • With --host-core last (or STRATA_HOST_CORE=last):

strata generate: 7 pool workers on logical processors 0,2,4,6,8,10,12, the host thread on 14 (draining too) (--
host-core last)
strata generate: session is up (engine 0.1.44)

2. Why this affects all modern asymmetric & ranked x86 CPUs

This isn't limited to the 5800X3D; it fundamentally affects any modern multi-core architecture with core
ranking or asymmetry:

  1. AMD CPPC / CPPC2 Preferred Cores (Zen 2, 3, 4, 5):
  • Silicon binning varies significantly across cores even on a single CCX. On this Ryzen 7 5800X3D (queried
    via Windows Kernel-Processor-Power ACPI CPPC capabilities), Core 2 and Core 3 are rated at 158% (Gold Star
    preferred)
    , whereas Core 7 is 133% (the lowest-binned core on the entire chip).
  • On dual-CCD chips (5900X, 5950X, 7950X, 9950X), CCD0 has noticeably higher boost bins than CCD1.
  • On dual-CCD asymmetric V-Cache chips (7900X3D, 7950X3D), CCD0 has 3D V-Cache (96MB L3) while CCD1 has
    higher frequency (5.7 GHz). Blind placement crosses the interconnect or lands on the wrong CCX.
  1. Intel Turbo Boost Max 3.0 (Favored P-Cores):
  • Even within P-core clusters on 10th–14th Gen and Core Ultra processors, 1–2 cores are binned to boost
    200–400 MHz higher than the rest. Current logic sorts P vs E, but treats all P-cores as identical.
  1. Core 0 GPU Interrupt & DPC Contention:
  • On Windows WDDM (and default Linux irqbalance), GPU driver PCIe completion interrupts, NIC interrupts,
    and system DPCs are routed to Core 0 (logical processors 0 and 1).
  • --host-core first forces the timing-critical host loop (which spins on CUDA events, orchestrates
    multi-GPU streams, and verifies MTP drafts) to compete directly with high-frequency PCIe interrupts on Core 0.
  • --host-core last avoids Core 0, but blindly lands on the lowest-binned silicon core on the chip.

3. Empirical Benchmarks (Dual RTX 3090 + Ryzen 7 5800X3D)

Testing with Qwen3.8-Flash-Next (262K context, dual RTX 3090 layer split):

  • Sparing Core 0 (LPs 0,1) for GPU PCIe interrupts, pinning the Host Thread to CPPC Gold Star Core 2 (LP 4),
    and assigning 6 pool workers to Cores 3, 1, 4, 5, 6, 7 (STRATA_HOST_PROC=4, STRATA_WORKER_PROCS=6,2,8,10,12, 14):
  • Short prompt prefill improved by +6.0% (58.7 tok/s -> 62.2 tok/s).
  • CUDA event polling jitter was eliminated during MTP speculative verify windows under heavy PCIe bus
    traffic.

4. Proposed Solution

Adding a zero-overhead runtime environment variable override in detect_cpu_topology()
(src/kernels/cpu/pool.cpp) gives users an immediate escape hatch without breaking any existing defaults:

// In detect_cpu_topology() in src/kernels/cpu/pool.cpp:
const char* env_host = std::getenv("STRATA_HOST_PROC");
if (env_host != nullptr && *env_host != '\0') {
    int hp = std::atoi(env_host);
    if (hp >= 0) topo.host_core = hp;
}
const char* env_workers = std::getenv("STRATA_WORKER_PROCS");
if (env_workers != nullptr && *env_workers != '\0') {
    std::vector<int> w;
    std::stringstream ss(env_workers);
    std::string item;
    while (std::getline(ss, item, ',')) {
        int p = std::atoi(item.c_str());
        if (p >= 0) w.push_back(p);
    }
    if (!w.empty()) topo.worker_cores = w;
}

The requested log

  [strata] 2026-10-14 20:55:25 engine started: \Strata\engine-v0.1.44\strata.exe --serve --pack
  C:\AI\Strata-data\packs\iq3_xxs --native \Strata-data\models\IQ3_XXS\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-
  00001-of-00002.gguf --ple-gguf \Strata-data\models\IQ3_XXS\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.
  gguf --expert-profile \Strata\data\expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-
  min-p 0.5 --mtp \Strata-data\mtp\rt --max-context 262144 --kv int8 --kv-resident 32768 --remote-expert-opt --
  layer-split auto
    strata generate: memory guard: limit 127.9 GiB (source: meminfo), current 15.9 GiB, reclaimable cache
  credited 0.0 GiB; available 112.0 GiB (MemAvailable 112.0 GiB), floor 2560 MiB
    strata generate: layer split across 2 GPUs: CUDA0, then CUDA1 (split auto)
    strata generate: PCIe probe: 13.5 GB/s host->device (best of 13.5 13.5 13.5 13.5) -> pcie_frac 0.37 (default
  0.55)
    strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant
  gate/up rows)
    strata generate: native pack: C:\AI\Strata-data\packs\iq3_xxs experts (largest blob 2.33 MB), token embedding
  IQ3_S in mapped host memory (260 MiB, 0.1 s)
    strata generate: 1466 MiB of weights loaded from C:\AI\Strata-data\packs\iq3_xxs in 0.3 s (302 canonical
  tensors skipped: served natively)
    strata generate: 300 native projection matrices, 1781.11 MiB of weights, in 0.8 s
    strata generate: PLE direct read probe: 95896 rows/s (fine)
    strata generate: the SSD is kept awake while rows are read: one page of the table after 100 ms without a read,
  until 60 s after the last request (STRATA_SSD_KEEPALIVE=0 turns it off)
    strata generate: layer split: CUDA1 PCIe probe 13.4 GB/s (best of 13.4 13.4 12.2 13.4) -> pcie_frac 0.37
    strata generate: layer split: CUDA1 holds its weights; 19.37 GiB free (its session follows the split search)
    strata generate: profile C:\AI\Strata\data\expert-profile.bin: 24576 ranked pairs, built for 24576 slots
    strata generate: layer split auto: CUDA0 82 SMs at 1.78 GHz -> 0.50 ms per layer, 18.68 GiB free before its
  session carve
    strata generate: layer split auto: CUDA1 82 SMs at 1.75 GHz -> 0.50 ms per layer, 17.61 GiB free before its
  session carve
    strata generate: layer split auto: CUDA0 link 13.5 GB/s -> miss cost x1.00
    strata generate: layer split auto: CUDA1 link 13.4 GB/s -> miss cost x1.00
    strata generate: layer split auto: K=26 - predicted 24.6 ms per decode window; the caches hold 21835 of 24576
  profiled pairs (~99.7% of the routed mass), best of 46 placements
    strata generate: KV streaming: 32768 of 262144 cells per QSA layer in VRAM, the K/V in 1.55 GiB of pinned RAM
    strata generate: PLE on, table 320001536 rows of F:\Strata-data\models\IQ3_XXS\Qwen3.8-Flash-Next-GSQ-RCO-
  IQ3_XXS-00002-of-00002.gguf
    strata generate: layer split: CUDA1 holds its weights, session [26, 48) and the head; 18.45 GiB free
    strata mtp: draft layer loaded, 835 MiB of VRAM (experts 675, dense 111), files read in 0.19 s (4187 MiB/s)
    strata generate: GPU 0: NVIDIA GeForce RTX 3090, compute capability 8.6
    strata generate: multi-GPU under WDDM: at most 8 GiB of the expert arena is pinned (STRATA_ARENA_PIN_GIB
  changes it)
    strata generate: expert arena read unbuffered (0 of 16 probe reads from the file cache; 67.7 GiB available,
  40.0 GiB of files)
    strata generate: expert arena: large pages are resident without a lock; cudaHostRegister limited to 8 GiB by
  the engine (multi-GPU under WDDM, or remote experts); 10 slices pinned (7 GiB); large pages (2097152 B)
    strata generate: loaded 39.97 GiB at 3.29 GiB/s
    strata generate: CPU pool tasks/phase: 24 (automatic), participating threads: 8
    strata generate: 7 pool workers on logical processors 2,4,6,8,10,12,14, the host thread on 0 (draining too)
  (--host-core first)
    strata aux cpus: not available on this system
    strata generate: expert cache auto: 18.84 GiB free, 700 MiB reserved (+0 MiB for the draft head) -> 8370
  slots
    strata generate: expert cache 12516 slots, 18.16 GiB of VRAM; policy is
    strata generate: the GPU computes the experts in the cache; it rounds differently from the CPU,
                     so a reply can differ slightly from a run without the cache (same quality:
                     bench/results/2026-09-27-cache-parity).
                     PROFILE, ranked by routing frequency, no eviction.
    strata generate: pre-filled 12516 of 12516 slots from the profile in 1.9 s (10156 MB/s); slot 0 verified
    strata generate: layer split, CUDA1: 17.63 GiB free of 24.00, room for experts 16.86 GiB
    strata generate: layer split: CUDA1 runs layers 26-47, expert cache 9181 slots (16.85 GiB), 9181 of its 11264
  profiled pairs; slot 0 verified
    strata generate: layer split: CUDA0 runs layers 0-25
    strata generate: layer split auto: L2 probe: the split is startable on the live free figures
    strata generate: R4 hit path ON - resident experts are computed on the GPU
    strata generate: 7 expert-pool workers + the host thread
    strata generate: session is up (engine 0.1.44)
    strata generate: token graph hit path: 21697 resident experts, decided on the device
    strata serve: Windows commit: 30.0 GiB left of a 151.9 GiB limit (RAM + page file)
    strata serve: layer split: 88% of the experts resident, the prompt path's streamed ring 96 slots
    strata serve: prompt chunk auto: 8192 tokens, a 96-slot ring
    strata serve: the prompt path borrows 2514 CUDA0 cache slots (3.63 GiB)
    strata serve:   CUDA1 prompt path borrows 1975 of its 9181 slots (3.63 GiB)
    strata hc: CUDA1: the hyper-connection read runs as staged (the norm per token and stream, the down
  projection's activations staged ahead by cp.async); checked bit for bit against the plain read on this card
  (STRATA_HC_SPLIT=1 or 0 for the earlier ones)
    strata verify: window up to 6 tokens, 70.8 MiB of device buffers
    strata serve: layer split: layers 0-25 (CUDA0), 26-47 (CUDA1), one hand-off per window
    strata hc: CUDA0: the hyper-connection read runs as staged (the norm per token and stream, the down
  projection's activations staged ahead by cp.async); checked bit for bit against the plain read on this card
  (STRATA_HC_SPLIT=1 or 0 for the earlier ones)
    strata verify: window up to 6 tokens, 70.8 MiB of device buffers
    strata mtp: draft head over 40525 tokens (68.0 MiB)
    strata serve: STRATA_ROUTE_TAIL_SKIP=7 is ON (default): a missed expert that every token of a verify window
  routes at rank 7 or lower is skipped (+10..20% decode on 12-16 GB cards that miss experts, answers differ
  slightly from 0.1.41); STRATA_ROUTE_TAIL_SKIP=0 turns it off
    strata serve: adaptive overlap: off: not on a layer split
    strata serve: 466 MiB of VRAM free with everything loaded
    strata serve: that is little room for the verify windows' buffers under WDDM; if the engine exits right after
  this line, --prefill auto:8192 (a smaller prompt chunk borrows fewer cache slots) or a larger --vram-reserve-
  mib leaves more
    strata serve: CUDA1: 486 MiB of VRAM free with everything loaded - LOW: its window graphs are captured on
  first use and need room too, and under WDDM a full card pages instead of failing, which can stall a request for
  good (#2192); add --vram-reserve-later-mib 982 to the config's args (or lower --max-context)
<!-- gh-comment-id:6175859696 --> @bceenaeiklmr commented on GitHub (Oct 14, 2026): Hi @Niko1221, Thank you for following up. I tested this on the official **0.1.44** release (and 0.1.44.1). The issue persists because `detect_cpu_topology()` in `src/kernels/cpu/pool.cpp` only handles Intel `EfficiencyClass` (P- core vs E-core separation). On desktop processors where all physical cores report `EfficiencyClass = 0`, the engine's core allocation offers only two hardcoded placements: `--host-core first` (Core 0) or `--host-core last` (highest-numbered core). ### 1. Engine Log on Official 0.1.44 Running the official prebuilt `strata 0.1.44`: * With default `--host-core first`: strata generate: 7 pool workers on logical processors 2,4,6,8,10,12,14, the host thread on 0 (draining too) (-- host-core first) strata generate: session is up (engine 0.1.44) * With `--host-core last` (or `STRATA_HOST_CORE=last`): strata generate: 7 pool workers on logical processors 0,2,4,6,8,10,12, the host thread on 14 (draining too) (-- host-core last) strata generate: session is up (engine 0.1.44) ### 2. Why this affects all modern asymmetric & ranked x86 CPUs This isn't limited to the 5800X3D; it fundamentally affects any modern multi-core architecture with core ranking or asymmetry: 1. **AMD CPPC / CPPC2 Preferred Cores (Zen 2, 3, 4, 5)**: * Silicon binning varies significantly across cores even on a single CCX. On this Ryzen 7 5800X3D (queried via Windows Kernel-Processor-Power ACPI CPPC capabilities), **Core 2 and Core 3 are rated at 158% (Gold Star preferred)**, whereas **Core 7 is 133% (the lowest-binned core on the entire chip)**. * On dual-CCD chips (5900X, 5950X, 7950X, 9950X), CCD0 has noticeably higher boost bins than CCD1. * On dual-CCD asymmetric V-Cache chips (7900X3D, 7950X3D), CCD0 has 3D V-Cache (96MB L3) while CCD1 has higher frequency (5.7 GHz). Blind placement crosses the interconnect or lands on the wrong CCX. 2. **Intel Turbo Boost Max 3.0 (Favored P-Cores)**: * Even within P-core clusters on 10th–14th Gen and Core Ultra processors, 1–2 cores are binned to boost 200–400 MHz higher than the rest. Current logic sorts P vs E, but treats all P-cores as identical. 3. **Core 0 GPU Interrupt & DPC Contention**: * On Windows WDDM (and default Linux irqbalance), GPU driver PCIe completion interrupts, NIC interrupts, and system DPCs are routed to Core 0 (logical processors 0 and 1). * `--host-core first` forces the timing-critical host loop (which spins on CUDA events, orchestrates multi-GPU streams, and verifies MTP drafts) to compete directly with high-frequency PCIe interrupts on Core 0. * `--host-core last` avoids Core 0, but blindly lands on the lowest-binned silicon core on the chip. ### 3. Empirical Benchmarks (Dual RTX 3090 + Ryzen 7 5800X3D) Testing with Qwen3.8-Flash-Next (262K context, dual RTX 3090 layer split): * Sparing Core 0 (LPs 0,1) for GPU PCIe interrupts, pinning the Host Thread to CPPC Gold Star Core 2 (LP 4), and assigning 6 pool workers to Cores 3, 1, 4, 5, 6, 7 (`STRATA_HOST_PROC=4`, `STRATA_WORKER_PROCS=6,2,8,10,12, 14`): * **Short prompt prefill improved by +6.0%** (58.7 tok/s -> 62.2 tok/s). * **CUDA event polling jitter was eliminated** during MTP speculative verify windows under heavy PCIe bus traffic. ### 4. Proposed Solution Adding a zero-overhead runtime environment variable override in `detect_cpu_topology()` (`src/kernels/cpu/pool.cpp`) gives users an immediate escape hatch without breaking any existing defaults: ```cpp // In detect_cpu_topology() in src/kernels/cpu/pool.cpp: const char* env_host = std::getenv("STRATA_HOST_PROC"); if (env_host != nullptr && *env_host != '\0') { int hp = std::atoi(env_host); if (hp >= 0) topo.host_core = hp; } const char* env_workers = std::getenv("STRATA_WORKER_PROCS"); if (env_workers != nullptr && *env_workers != '\0') { std::vector<int> w; std::stringstream ss(env_workers); std::string item; while (std::getline(ss, item, ',')) { int p = std::atoi(item.c_str()); if (p >= 0) w.push_back(p); } if (!w.empty()) topo.worker_cores = w; } ``` The requested log ``` [strata] 2026-10-14 20:55:25 engine started: \Strata\engine-v0.1.44\strata.exe --serve --pack C:\AI\Strata-data\packs\iq3_xxs --native \Strata-data\models\IQ3_XXS\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS- 00001-of-00002.gguf --ple-gguf \Strata-data\models\IQ3_XXS\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002. gguf --expert-profile \Strata\data\expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec- min-p 0.5 --mtp \Strata-data\mtp\rt --max-context 262144 --kv int8 --kv-resident 32768 --remote-expert-opt -- layer-split auto strata generate: memory guard: limit 127.9 GiB (source: meminfo), current 15.9 GiB, reclaimable cache credited 0.0 GiB; available 112.0 GiB (MemAvailable 112.0 GiB), floor 2560 MiB strata generate: layer split across 2 GPUs: CUDA0, then CUDA1 (split auto) strata generate: PCIe probe: 13.5 GB/s host->device (best of 13.5 13.5 13.5 13.5) -> pcie_frac 0.37 (default 0.55) strata generate: this CPU has no AVX-512: the expert kernels run on AVX-2 (multi-token for the i-quant gate/up rows) strata generate: native pack: C:\AI\Strata-data\packs\iq3_xxs experts (largest blob 2.33 MB), token embedding IQ3_S in mapped host memory (260 MiB, 0.1 s) strata generate: 1466 MiB of weights loaded from C:\AI\Strata-data\packs\iq3_xxs in 0.3 s (302 canonical tensors skipped: served natively) strata generate: 300 native projection matrices, 1781.11 MiB of weights, in 0.8 s strata generate: PLE direct read probe: 95896 rows/s (fine) strata generate: the SSD is kept awake while rows are read: one page of the table after 100 ms without a read, until 60 s after the last request (STRATA_SSD_KEEPALIVE=0 turns it off) strata generate: layer split: CUDA1 PCIe probe 13.4 GB/s (best of 13.4 13.4 12.2 13.4) -> pcie_frac 0.37 strata generate: layer split: CUDA1 holds its weights; 19.37 GiB free (its session follows the split search) strata generate: profile C:\AI\Strata\data\expert-profile.bin: 24576 ranked pairs, built for 24576 slots strata generate: layer split auto: CUDA0 82 SMs at 1.78 GHz -> 0.50 ms per layer, 18.68 GiB free before its session carve strata generate: layer split auto: CUDA1 82 SMs at 1.75 GHz -> 0.50 ms per layer, 17.61 GiB free before its session carve strata generate: layer split auto: CUDA0 link 13.5 GB/s -> miss cost x1.00 strata generate: layer split auto: CUDA1 link 13.4 GB/s -> miss cost x1.00 strata generate: layer split auto: K=26 - predicted 24.6 ms per decode window; the caches hold 21835 of 24576 profiled pairs (~99.7% of the routed mass), best of 46 placements strata generate: KV streaming: 32768 of 262144 cells per QSA layer in VRAM, the K/V in 1.55 GiB of pinned RAM strata generate: PLE on, table 320001536 rows of F:\Strata-data\models\IQ3_XXS\Qwen3.8-Flash-Next-GSQ-RCO- IQ3_XXS-00002-of-00002.gguf strata generate: layer split: CUDA1 holds its weights, session [26, 48) and the head; 18.45 GiB free strata mtp: draft layer loaded, 835 MiB of VRAM (experts 675, dense 111), files read in 0.19 s (4187 MiB/s) strata generate: GPU 0: NVIDIA GeForce RTX 3090, compute capability 8.6 strata generate: multi-GPU under WDDM: at most 8 GiB of the expert arena is pinned (STRATA_ARENA_PIN_GIB changes it) strata generate: expert arena read unbuffered (0 of 16 probe reads from the file cache; 67.7 GiB available, 40.0 GiB of files) strata generate: expert arena: large pages are resident without a lock; cudaHostRegister limited to 8 GiB by the engine (multi-GPU under WDDM, or remote experts); 10 slices pinned (7 GiB); large pages (2097152 B) strata generate: loaded 39.97 GiB at 3.29 GiB/s strata generate: CPU pool tasks/phase: 24 (automatic), participating threads: 8 strata generate: 7 pool workers on logical processors 2,4,6,8,10,12,14, the host thread on 0 (draining too) (--host-core first) strata aux cpus: not available on this system strata generate: expert cache auto: 18.84 GiB free, 700 MiB reserved (+0 MiB for the draft head) -> 8370 slots strata generate: expert cache 12516 slots, 18.16 GiB of VRAM; policy is strata generate: the GPU computes the experts in the cache; it rounds differently from the CPU, so a reply can differ slightly from a run without the cache (same quality: bench/results/2026-09-27-cache-parity). PROFILE, ranked by routing frequency, no eviction. strata generate: pre-filled 12516 of 12516 slots from the profile in 1.9 s (10156 MB/s); slot 0 verified strata generate: layer split, CUDA1: 17.63 GiB free of 24.00, room for experts 16.86 GiB strata generate: layer split: CUDA1 runs layers 26-47, expert cache 9181 slots (16.85 GiB), 9181 of its 11264 profiled pairs; slot 0 verified strata generate: layer split: CUDA0 runs layers 0-25 strata generate: layer split auto: L2 probe: the split is startable on the live free figures strata generate: R4 hit path ON - resident experts are computed on the GPU strata generate: 7 expert-pool workers + the host thread strata generate: session is up (engine 0.1.44) strata generate: token graph hit path: 21697 resident experts, decided on the device strata serve: Windows commit: 30.0 GiB left of a 151.9 GiB limit (RAM + page file) strata serve: layer split: 88% of the experts resident, the prompt path's streamed ring 96 slots strata serve: prompt chunk auto: 8192 tokens, a 96-slot ring strata serve: the prompt path borrows 2514 CUDA0 cache slots (3.63 GiB) strata serve: CUDA1 prompt path borrows 1975 of its 9181 slots (3.63 GiB) strata hc: CUDA1: the hyper-connection read runs as staged (the norm per token and stream, the down projection's activations staged ahead by cp.async); checked bit for bit against the plain read on this card (STRATA_HC_SPLIT=1 or 0 for the earlier ones) strata verify: window up to 6 tokens, 70.8 MiB of device buffers strata serve: layer split: layers 0-25 (CUDA0), 26-47 (CUDA1), one hand-off per window strata hc: CUDA0: the hyper-connection read runs as staged (the norm per token and stream, the down projection's activations staged ahead by cp.async); checked bit for bit against the plain read on this card (STRATA_HC_SPLIT=1 or 0 for the earlier ones) strata verify: window up to 6 tokens, 70.8 MiB of device buffers strata mtp: draft head over 40525 tokens (68.0 MiB) strata serve: STRATA_ROUTE_TAIL_SKIP=7 is ON (default): a missed expert that every token of a verify window routes at rank 7 or lower is skipped (+10..20% decode on 12-16 GB cards that miss experts, answers differ slightly from 0.1.41); STRATA_ROUTE_TAIL_SKIP=0 turns it off strata serve: adaptive overlap: off: not on a layer split strata serve: 466 MiB of VRAM free with everything loaded strata serve: that is little room for the verify windows' buffers under WDDM; if the engine exits right after this line, --prefill auto:8192 (a smaller prompt chunk borrows fewer cache slots) or a larger --vram-reserve- mib leaves more strata serve: CUDA1: 486 MiB of VRAM free with everything loaded - LOW: its window graphs are captured on first use and need room too, and under WDDM a full card pages instead of failing, which can stall a request for good (#2192); add --vram-reserve-later-mib 982 to the config's args (or lower --max-context) ```
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#516
No description provided.