Skip to content

Avoid FP32 scratch allocation in FP16 communication - #6293

Open
purnawirman wants to merge 1 commit into
pytorch:mainfrom
purnawirman:export-D119536338
Open

Avoid FP32 scratch allocation in FP16 communication#6293
purnawirman wants to merge 1 commit into
pytorch:mainfrom
purnawirman:export-D119536338

Conversation

@purnawirman

Copy link
Copy Markdown

Summary:
The FP16 communication conversion creates an extra full-size FP32 copy, which can cause out-of-memory errors for large tensors.

With the rollout flag enabled, convert to FP16 first and clamp in place to avoid that copy. Embeddings remain trainable through the existing custom backward pass.

Keep the flag lookup compatible with compilation and test both flag settings.

Differential Revision: D119536338

Summary:
The FP16 communication conversion creates an extra full-size FP32 copy, which can cause out-of-memory errors for large tensors.

With the rollout flag enabled, convert to FP16 first and clamp in place to avoid that copy. Embeddings remain trainable through the existing custom backward pass.

Keep the flag lookup compatible with compilation and test both flag settings.

Differential Revision: D119536338
@meta-cla meta-cla Bot added the cla signed label Sep 11, 2026
@meta-codesync

meta-codesync Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

@purnawirman has exported this pull request. If you are a Meta employee, you can view the originating Diff in D119536338.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant