Skip to content

Chunk the degree-tensor all-reduce to bound peak device memory - #766

Draft
mkolodner-sc wants to merge 1 commit into
mainfrom
mkolodner-sc/chunk-degree-allreduce
Draft

Chunk the degree-tensor all-reduce to bound peak device memory#766
mkolodner-sc wants to merge 1 commit into
mainfrom
mkolodner-sc/chunk-degree-allreduce

Conversation

@mkolodner-sc

@mkolodner-sc mkolodner-sc commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

What

_all_reduce_single_degree_tensor padded the degree tensor to the global max
size, moved the whole int64 tensor to the process-group device, and
all-reduced it in a single call.

Why

For large graphs that tensor is several GiB. Together with the collective's
buffer it can OOM small-memory GPUs during dataloader setup, even though the
reduced result is only ever used on CPU.

How

Reduce one fixed-size slice (_DEGREE_ALLREDUCE_CHUNK) at a time: keep the
padded tensor on CPU and, per slice, copy to device -> all-reduce -> copy back.
A chunked element-wise SUM is bit-identical to the whole-tensor SUM (every rank
pads to the same size and uses identical slice bounds); the over-counting
correction is unchanged. Runs once at loader setup, so there is no per-batch
throughput cost.

The single-shot all-reduce moved the whole padded int64 degree tensor to the
process-group device. For large graphs that tensor is several GiB, so together
with the collective buffer it can OOM small-memory GPUs during dataloader setup,
even though the reduced result is only ever used on CPU.

Reduce one fixed-size slice at a time: keep the padded tensor on CPU and, per
slice, copy it to the device, all-reduce, and copy the result back. A chunked
element-wise SUM is bit-identical to a whole-tensor SUM (every rank pads to the
same size and uses identical slice bounds); the over-counting correction is
unchanged. This runs once at loader setup, so there is no per-batch cost.
@mkolodner-sc
mkolodner-sc force-pushed the mkolodner-sc/chunk-degree-allreduce branch from fcff48d to 7c24c08 Compare September 9, 2026 21:27
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