[GH-ISSUE #4578] [Engine] aarch64 (Jetson AGX Thor): CPU topology reads one physical core (all core_id=0), so the expert pool defaults to 1 worker #2070

Closed
opened 2026-11-04 01:56:24 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @potoior on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4578

On aarch64 (Jetson AGX Thor, Tegra) the engine's Linux topology detection reads every logical processor as the same physical core, so the CPU expert pool defaults to 1 worker on a 14-core part.

Observed

Startup line (source build, engine 0.1.52, 5e8a4cc):

strata generate: CPU pool: 1 workers by default (1 physical cores, 14 logical processors; bounded by every physical core but the host's)
strata generate: 1 expert-pool workers + the host thread

strata tune auto reports the same: facts.workers = 1.

Environment

  • NVIDIA Jetson AGX Thor Dev Kit, aarch64, 14 logical CPUs, 122.8 GiB unified, L4T R38, Ubuntu 24.04
  • Strata source build, -DCMAKE_CUDA_ARCHITECTURES=110

Root cause (reproduced)

The Linux detection (src/kernels/cpu/pool.cpp, detect_cpu_topology_impl / fill_plan_fields, ~lines 119-132 and 160-177) keys a physical core by physical_package_id * 1e6 + core_id from sysfs:

$ for c in /sys/devices/system/cpu/cpu*/topology/core_id; do cat $c; done
0 0 0 0 0 0 0 0 0 0 0 0 0 0        # core_id = 0 for ALL 14 CPUs
$ .../physical_package_id
0 0 0 0 0 0 0 0 0 0 0 0 0 0        # 0 for ALL

All CPUs therefore map to the same core and the code dedupes them to 1 physical core.

Tegra does expose per-CPU uniqueness elsewhere — there is no SMT, and thread_siblings_list / core_cpus_list is each CPU alone, while cluster_id varies:

cpu0:  core_id=0 pkg=0 thread_siblings_list=0   cluster_id=0
cpu5:  core_id=0 pkg=0 thread_siblings_list=5   cluster_id=5
cpu9:  core_id=0 pkg=0 thread_siblings_list=9   cluster_id=9
cpu13: core_id=0 pkg=0 thread_siblings_list=13  cluster_id=13

The known path in fill_plan_fields treats core_id/physical_package_id as valid (both >= 0), so it does not fall back to the "topology unknown" path (the comment at ~pool.cpp line 288 about taking half the logical processors). It reports one package with one core.

Suggested fix

On Linux, when core_id is not unique across the allowed CPUs but thread_siblings_list (or core_cpus_list) shows each CPU alone (no SMT), treat each logical processor as its own physical core — or build the core map from core_cpus_list/thread_siblings_list instead of pkg*1e6+core_id when the latter collapses. A guard like "if all core_id identical and only one CPU per core_cpus_list, use the CPU index as the core" would cover Tegra without changing x86/SPMT behavior.

Impact (measured here)

With the model's experts mostly GPU-resident, the 1-worker default did not change decode measurably: strata tune auto baseline (default, 1 worker) 31.9 tok/s vs --pool-workers 10 32.0 tok/s (within noise). Prefill 4K/16K went 745/891 -> 776/900 tok/s with 10 workers (small, +/- noise). So this is a correctness/portability issue rather than a proven speed win on this box; it would matter more for CPU-heavy (low-VRAM) configurations and for anyone reading the reported pool size.

Reproduction status: reproduced locally (startup log + sysfs on the machine above). A pool_workers/topology unit-test on an aarch64 host (or a fake sysfs with repeated core_id) would pin it down.

Originally created by @potoior on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4578 On aarch64 (Jetson AGX Thor, Tegra) the engine's Linux topology detection reads **every** logical processor as the same physical core, so the CPU expert pool defaults to **1 worker** on a 14-core part. ## Observed Startup line (source build, engine 0.1.52, `5e8a4cc`): ``` strata generate: CPU pool: 1 workers by default (1 physical cores, 14 logical processors; bounded by every physical core but the host's) strata generate: 1 expert-pool workers + the host thread ``` `strata tune auto` reports the same: `facts.workers = 1`. ## Environment - NVIDIA Jetson AGX Thor Dev Kit, aarch64, 14 logical CPUs, 122.8 GiB unified, L4T R38, Ubuntu 24.04 - Strata source build, `-DCMAKE_CUDA_ARCHITECTURES=110` ## Root cause (reproduced) The Linux detection (`src/kernels/cpu/pool.cpp`, `detect_cpu_topology_impl` / `fill_plan_fields`, ~lines 119-132 and 160-177) keys a physical core by `physical_package_id * 1e6 + core_id` from sysfs: ``` $ for c in /sys/devices/system/cpu/cpu*/topology/core_id; do cat $c; done 0 0 0 0 0 0 0 0 0 0 0 0 0 0 # core_id = 0 for ALL 14 CPUs $ .../physical_package_id 0 0 0 0 0 0 0 0 0 0 0 0 0 0 # 0 for ALL ``` All CPUs therefore map to the same core and the code dedupes them to **1 physical core**. Tegra does expose per-CPU uniqueness elsewhere — there is **no SMT**, and `thread_siblings_list` / `core_cpus_list` is each CPU alone, while `cluster_id` varies: ``` cpu0: core_id=0 pkg=0 thread_siblings_list=0 cluster_id=0 cpu5: core_id=0 pkg=0 thread_siblings_list=5 cluster_id=5 cpu9: core_id=0 pkg=0 thread_siblings_list=9 cluster_id=9 cpu13: core_id=0 pkg=0 thread_siblings_list=13 cluster_id=13 ``` The `known` path in `fill_plan_fields` treats `core_id`/`physical_package_id` as valid (both >= 0), so it does not fall back to the "topology unknown" path (the comment at ~`pool.cpp` line 288 about taking half the logical processors). It reports one package with one core. ## Suggested fix On Linux, when `core_id` is not unique across the allowed CPUs but `thread_siblings_list` (or `core_cpus_list`) shows each CPU alone (no SMT), treat each logical processor as its own physical core — or build the core map from `core_cpus_list`/`thread_siblings_list` instead of `pkg*1e6+core_id` when the latter collapses. A guard like "if all core_id identical and only one CPU per core_cpus_list, use the CPU index as the core" would cover Tegra without changing x86/SPMT behavior. ## Impact (measured here) With the model's experts mostly GPU-resident, the 1-worker default did **not** change decode measurably: `strata tune auto` baseline (default, 1 worker) 31.9 tok/s vs `--pool-workers 10` 32.0 tok/s (within noise). Prefill 4K/16K went 745/891 -> 776/900 tok/s with 10 workers (small, +/- noise). So this is a correctness/portability issue rather than a proven speed win on this box; it would matter more for CPU-heavy (low-VRAM) configurations and for anyone reading the reported pool size. Reproduction status: reproduced locally (startup log + sysfs on the machine above). A `pool_workers`/topology unit-test on an aarch64 host (or a fake sysfs with repeated core_id) would pin it down.
Author
Owner

@potoior commented on GitHub (Oct 29, 2026):

Fixed in PR #4580: identify the physical core by thread_siblings_list (falls back to (pkg, core)). On the Thor this changes 1 worker (1 physical core) to 13 workers (14 physical cores). Closing; please reopen if that PR is not merged.

<!-- gh-comment-id:6489668729 --> @potoior commented on GitHub (Oct 29, 2026): Fixed in PR #4580: identify the physical core by `thread_siblings_list` (falls back to `(pkg, core)`). On the Thor this changes `1 worker (1 physical core)` to `13 workers (14 physical cores)`. Closing; please reopen if that PR is not merged.
Author
Owner

@potoior commented on GitHub (Oct 29, 2026):

Reopened — leaving this open until the linked PR is merged.

<!-- gh-comment-id:6489676108 --> @potoior commented on GitHub (Oct 29, 2026): Reopened — leaving this open until the linked PR is merged.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660709919 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#2070
No description provided.