Skip to content

fix(pool): identify Linux physical cores by thread_siblings_list (aarch64 / Tegra, #4578) - #4580

Open
potoior wants to merge 1 commit into
Niko1221:mainfrom
potoior:fix/aarch64-cpu-topology
Open

potoior wants to merge 1 commit into
Niko1221:mainfrom
potoior:fix/aarch64-cpu-topology

Conversation

@potoior

@potoior potoior commented Oct 29, 2026

Copy link
Copy Markdown

Fixes #4578.

Problem

On some aarch64 SoCs (here a Jetson AGX Thor / Tegra, 14 logical CPUs) every CPU reports topology/core_id = 0 and physical_package_id = 0. The Linux topology reader in src/kernels/cpu/pool.cpp keys a physical core by physical_package_id * 1e6 + core_id, so all CPUs collapsed to one core and the CPU expert pool started a single worker:

strata generate: CPU pool: 1 workers by default (1 physical cores, 14 logical processors; ...)
strata generate: 1 expert-pool workers + the host thread

strata tune auto also reported facts.workers = 1.

Change

Identify the physical core by thread_siblings_list (the logical CPUs that share one core), using the smallest CPU id in the list as the key. On an SMT x86 core the list is e.g. 0,16, which names the same smallest id from both threads, so the grouping is unchanged there; the code falls back to (pkg, core) when the file is absent or unreadable. Sibling lookup (sibling_of) and the physical-core count (p_cores) now use the same key.

Validation (on the affected hardware)

Jetson AGX Thor, aarch64, 14 logical CPUs, source build -DCMAKE_CUDA_ARCHITECTURES=110:

  • Before: CPU pool: 1 workers by default (1 physical cores, 14 logical processors), 1 expert-pool workers + the host thread
  • After: CPU pool: 13 workers by default (14 physical cores, 14 logical processors), 13 expert-pool workers + the host thread
  • Engine starts, serves 256K, /health ok.
  • pool_plan_test: OK (the x86 plan cases are unchanged).
  • pool_test: SKIPPED on aarch64 (needs AVX-512), not a regression.
  • Speed on this workload (experts mostly GPU-resident): decode ~32.9 tok/s, prefill 708/904 tok/s (4K/16K) — unchanged vs the 1-worker default, so this is a correctness/portability fix, not a speed one.

Not done

No new automated test: detect_cpu_topology reads /sys directly (no STRATA_TEST_SYSFS_ROOT hook, unlike cpu_numa_node), so a fake-sysfs unit test would need that hook first. Happy to add one if you want the refactor.

Reproduction status: reproduced and fixed on the machine above.

…o1221#4578)

On some aarch64 SoCs (Jetson AGX Thor / Tegra) every CPU reports
topology/core_id = 0, so the (physical_package_id, core_id) key collapsed
all logical CPUs to one physical core and the CPU expert pool started a
single worker on a 14-core part:

  CPU pool: 1 workers by default (1 physical cores, 14 logical processors)

Use thread_siblings_list (the logical CPUs that share one core) as the
core identity, with the smallest id in the list as the key. On an SMT x86
core the list ('0,16') still names the same smallest id from both
threads, so the grouping is unchanged there; the code falls back to
(pkg, core) when the file is absent or unreadable. Sibling lookup and the
physical-core count now use the same key.

Validated on Jetson AGX Thor (14 logical CPUs): 'CPU pool: 13 workers by
default (14 physical cores, 14 logical processors)' (was 1). pool_plan_test
passes; pool_test is skipped on aarch64 (no AVX-512). Decode/prefill are
unchanged on this GPU-resident workload (~32.9 tok/s decode), so this is a
correctness/portability fix, not a speed one.

No new automated test: detect_cpu_topology reads /sys directly (no
STRATA_TEST_SYSFS_ROOT hook), so it cannot be faked from a unit test yet.
Related: Niko1221#4578.
@github-actions github-actions Bot added the needs-format Title or template does not follow CONTRIBUTING.md yet label Oct 29, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the pull request. To keep the tracker readable, every item needs an area prefix in the title and the parts of the pull request template filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] fix decode stop on long prompts".

Edit the pull request (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-format Title or template does not follow CONTRIBUTING.md yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant