Skip to content

hgb_scaling: disable OMP_PROC_BIND on hybrid-core machines - #36

Merged
cakedev0 merged 1 commit into
mainfrom
worktree-refactored-prancing-dolphin
Aug 26, 2026
Merged

hgb_scaling: disable OMP_PROC_BIND on hybrid-core machines#36
cakedev0 merged 1 commit into
mainfrom
worktree-refactored-prancing-dolphin

Conversation

@cakedev0

Copy link
Copy Markdown
Collaborator

Summary

  • configs/hgb_scaling.py set OMP_PROC_BIND=true unconditionally. On hybrid-core (P-core/E-core) machines, that binds each OpenMP thread to a place chosen from across the whole taskset's topology without distinguishing core type - so a thread team smaller than the taskset can land partly on slower E-cores instead of packing entirely onto the faster P-cores the taskset was sized for.
  • Observed directly in the PR#34788 (hgb/both_threads_optim) benchmark results: ames_housing on the laptop runner resolved to the same tree_n_threads=4 at both OMP_NUM_THREADS=4 (taskset 0-3, all P-cores) and OMP_NUM_THREADS=16 (taskset 0-15, mixed P/E) yet ran ~2x slower in the wider-taskset case.
  • Reproduced the underlying placement mechanism locally with a small OpenMP C program LD_PRELOADing the repo's own sklearn-dev-libomp libomp.so: with a narrow taskset all 4 threads bind to P-cores; with a wide hybrid taskset covering the same team size, some threads bind to Atom/E-cores instead.
  • configs/_scaling.py gains has_hybrid_cores(), detecting Intel Hybrid Technology via the cpu_core/cpu_atom PMU sysfs directories the kernel exposes (absent → treated as non-hybrid). hgb_scaling.py's _with_thread_count now sets OMP_PROC_BIND to "false" on hybrid machines instead of "true", explicitly either way (same "don't rely on ambient state" rationale already used for OMP_NUM_THREADS in that function).
  • configs/hgb_scaling_force_active_wait.py needed no change - it already rebuilds bench.env from scratch and never sets OMP_PROC_BIND.

Test plan

  • PIXI_FROZEN=true pixi run -e sklearn-pypi python -c 'from _scaling import has_hybrid_cores; print(has_hybrid_cores())'True on this (hybrid) machine.
  • load_cases_from_script("configs/hgb_scaling.py") → every generated case now carries OMP_PROC_BIND=false on this machine.
  • Rerun hgb_scaling.py on the actual laptop runner and confirm the ames_housing 4-vs-16-thread anomaly is gone.

🤖 Generated with Claude Code

OMP_PROC_BIND=true binds each OpenMP thread to a place chosen from
across the whole taskset's topology without distinguishing core type.
On a hybrid (P-core/E-core) laptop that can place a thread team
smaller than the taskset onto slower E-cores instead of packing it
onto the faster P-cores the taskset was sized for - observed as a
~2x fit-time regression between two OMP_NUM_THREADS values that both
resolved to the same actual tree_n_threads (see PR#34788 benchmark
analysis). has_hybrid_cores() detects this via the cpu_core/cpu_atom
sysfs directories the kernel exposes for Intel Hybrid Technology.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@cakedev0
cakedev0 merged commit 0ba4b38 into main Aug 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant