Skip to content

docs: hybrid scheduling, OpenMP-style teams with scoped stealing (design study, #22) - #23

Merged
shinaoka merged 1 commit into
developfrom
docs/hybrid-scheduling
Oct 30, 2026
Merged

shinaoka merged 1 commit into
developfrom
docs/hybrid-scheduling

Conversation

@shinaoka

Copy link
Copy Markdown
Member

Design study for #22. Theory only, nothing implemented. It adds one file against develop: docs/design/hybrid-scheduling.md.

Maintainer direction (2026-10-30): 「threadteamを独自スレッドで拡張していくとしよう.OpenMPの機能をメインにするが,Rayonの柔軟性も取り込めないか?理論的に検討させよう」. Addendum: 「threadteamはOpenMP的にして,work stealingはRayonにますという手もあるね.例えば,tenferroのCPUEngineが両方のプールを持ってもいいわけだし.」

Recommendation

One runtime, team first, with scoped stealing.

  • Team sections stay as they are: reserved, co-scheduled, with barriers and stable numbers.
  • Tasks from join, scope and prepared graphs are stolen only inside the creating token's domain. Pool scope is opt-in, as with OpenMP 6.0's threadset.
  • Stealing is child stealing. Continuation stealing needs compiler support or a cactus stack.
  • Waits. A waiter runs only descendants of what it waits for (libomp's task scheduling constraint, oneTBB isolate). Tasks carry no team authority, by type (TaskExec). A plain barrier runs nothing; a draining barrier is opt-in.
  • Budget. Stealing creates no authority. Finished siblings' workers can help the rest inside the domain. A nested team claims idle domain workers or is refused, and never draws from the reserve.
  • Dependent tasks. Prepared graphs (taskgraph-like) with priority by remaining critical path.
  • Determinism. Reproducible reductions over fixed chunks.

The two-pool option (an engine owns a threadteam pool and a Rayon pool) is evaluated item by item:

  • concurrent use oversubscribes, so phase exclusion is required;
  • idle CPU of the inactive side: Rayon's 33 search rounds against spin_polls;
  • stranded shares: the P/m loss of serial inner kernels;
  • placement;
  • the ownership rule rewrite, which is a maintainer decision;
  • Parallelism::Pool;
  • the OpenMP and TBB precedent (KMP_COMPOSABILITY, libirml IPC, MKL_THREADING_LAYER).

It is kept as the baseline every native stage has to beat. The note ends with a comparison table and six deciding measurements.

Coverage

Sources

  • Citations. Every citation was opened and checked against the source text.
  • Corrections to the brief. Fibril is SPAA 2016. KMP_COMPOSABILITY, libirml and --ipc come from the SciPy 2018 paper. oneTBB has no src/irml. No OMP_* variable controls deterministic reductions. Kokkos tasking was removed in 5.0.
  • Not verified. The claims that could not be checked are listed at the end of the note.
  • Method. pi-council in plan mode (GPT-6-astra chair, DeepSeek, GLM), in two meetings. A first single meeting stopped on an invalid chair decision.

Docs only. Base develop. The monitor merges.

🤖 Generated with Claude Code

…ign study, #22)

Theory only. Recommends one runtime, team first: tasks stolen only inside
the creating token's domain, child stealing, a waiter runs descendants only,
tasks carry no team authority, plain barriers run nothing (draining barrier
opt-in), nested teams from idle domain workers or refusal, prepared graphs
with rank priority, reproducible reductions over fixed chunks. Evaluates the
two-pool option (engine owns a threadteam pool and a Rayon pool) item by
item, with a comparison table, the deciding measurements, invariants, TLA+
properties and a staged introduction. Citations checked against primary
sources; unverified ones are listed.

Refs #22.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shinaoka shinaoka self-assigned this Oct 30, 2026
@shinaoka
shinaoka merged commit 41370f3 into develop Oct 30, 2026
13 of 14 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