Skip to content

float8: snapshot FSDP precomputed scale#4555

Open
nascheme wants to merge 1 commit into
pytorch:mainfrom
nascheme:ft-audit-fsdp-scale-snapshot
Open

float8: snapshot FSDP precomputed scale#4555
nascheme wants to merge 1 commit into
pytorch:mainfrom
nascheme:ft-audit-fsdp-scale-snapshot

Conversation

@nascheme

@nascheme nascheme commented Jul 3, 2026

Copy link
Copy Markdown

fsdp_pre_all_gather on WeightWithDynamicFloat8CastTensor checks self._precomputed_scale is not None and then reads self._precomputed_scale again to use it. precompute_float8_dynamic_scale_for_fsdp can reassign that attribute on the same shared instance between the check and the use, so under free-threaded Python the value used may differ from the one checked.

Read self._precomputed_scale into a local once and use that for both the check and the call.

Read the precomputed scale once in fsdp_pre_all_gather so concurrent
updates between FSDP iterations cannot change which value is used after
the branch is selected.

Assisted-by: Claude Opus 4.7
@nascheme nascheme requested a review from vkuzo as a code owner July 3, 2026 02:28
@pytorch-bot

pytorch-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4555

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants