Skip to content

Wake each PE's own chares per epoch instead of three array broadcasts - #45

Open
AdvaitTahilyani wants to merge 5 commits into
scale/27-kernel-layout-followupsfrom
scale/28-local-wakeups
Open

AdvaitTahilyani wants to merge 5 commits into
scale/27-kernel-layout-followupsfrom
scale/28-local-wakeups

Conversation

@AdvaitTahilyani

@AdvaitTahilyani AdvaitTahilyani commented Nov 26, 2026 •

Copy link
Copy Markdown

What was wrong. receive_dag and receive_get_request run on every PE (a group broadcast from PE 0), and each ended with partition_proxy_{1,2,3}.run(): three array broadcasts per PE per epoch, i.e. 3P broadcasts and 3P² deliveries per epoch, and every chare woken P times. Charm++ keeps every array broadcast on every PE until the second 1-minute spring cleaning (for elements created later). On ofi/cxi a received message holds a 128 KB slot of the registered message pool, so each process retained 3P × 128 KB per epoch (6 MB at 16 processes). The pool grows in 128 MB blocks that are never returned, and its allocator scans the full blocks on every allocation, so message handling slowed down as a run went on: at 16 GPUs repeats drifted and resident memory reached 10–12 GB (linreg) and 26–27 GB (cg) per process within a minute.

Change. wake_local_partitions() (partition_lifecycle.cpp) sends run() to this PE's own chares; the three call sites use it. A chare created later still starts itself from init() and replays the stored DAGs of the epochs it missed, as before.

Measured (per-repeat seconds, ofi build; measured on the older integration tree scale-int with and without this commit, not on this stack head):

layout program before after
4 nodes × 4 A100 linreg -n 4000 -i 2000 12.46, 11.77, 11.28, 11.30, 10.11, 12.67 9.54, 9.63, 9.60, 9.65, 9.65, 9.65
4 nodes × 4 A100 cg -n 120 -m 3000 8.68 rising to 9.96 (+15% over 6 repeats) 7.63–7.71, flat (with #46 too)
1 node × 4 A100 linreg 4.50–4.55 4.42–4.47
1 node × 4 A100 cg 4.65 rising to 4.73 4.39–4.46

Resident memory at 16 GPUs: 1.0–1.25 GB per process and flat, against 9.7–27 GB. The allocator's block search (checkblock) on process 0 went from 2.6% → 7.8% of CPU time (cg baseline) to 0.2%.

Validated. nc build; CPU regress (regress.sh) at +p1 and +p2 on this branch: originals 15/15, ports 25/25, ops 38/38 at each (job 24506761). GPU: covered by the validation of the top of this stack (#48).

Known limits.

  • Not changed in Charm++: the ofi message pool still never frees blocks and searches them linearly; any other high-rate array broadcast would hit the same thing.
  • The group still keeps every epoch's DAG and array_meta every array ever created (about 1 MB/s in linreg); unbounded, but not a time cost in these runs.
  • The baseline linreg spread at 16 GPUs (10.1–12.7 s) is larger than the measured allocator cost; the fix removes it, but the exact path was not isolated.

🤖 Generated with Claude Code

AdvaitTahilyani and others added 2 commits November 24, 2026 22:58
…dcasts

receive_dag and receive_get_request run on every PE (group broadcast from
PE 0), and each of them ended with partition_proxy_{1,2,3}.run(): three
array broadcasts per PE per epoch. Each went to PE 0 (the serializer) and
from there to every PE, so an epoch cost 3 P broadcasts and 3 P^2 message
deliveries, and every chare got run() P times.

Charm++ also keeps every array broadcast on every PE until the second
1-minute spring cleaning after it (for elements created later). On the
ofi/cxi layer a received message occupies a whole 64 KB eager receive
buffer (a 128 KB slot of the registered message pool), so each process
retained 3 P x 128 KB per epoch: 6 MB per epoch at 16 processes, about
1.4 GB per linreg repeat and 10 GB or more per process after two minutes.
The pool grows in 128 MB blocks that are never returned, and its
allocator searches the full blocks first to last on every allocation, so
message allocation got slower as the run went on.

Each PE now sends run() to its own chares (wake_local_partitions). A chare
created later still starts itself from init(), and finds the stored DAGs
of the epochs it missed, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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