Skip to content

Conversation

ntenenz
Copy link

@ntenenz ntenenz commented Aug 24, 2025

Description

This fixes multiple issues in the FSDP2 test, namely

  1. Previously fp8 init was performed when args.fp8_init == False. I have updated the logic to match what I presume was intended by leveraging the nullcontext context manager.
  2. te.fp8_autocast was previously not called; the recipe was created but was unused. The autocast context manager now wraps the model's computation.

Does not necessarily fix #1705, but it does enable the test which should determine if the issue is still present.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Enable / disable fp8_model_init according to the test's flag
  • Apply fp8_autocast

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

ntenenz and others added 3 commits August 24, 2025 03:41
This fixes multiple issues in the FSDP2 test, namely
1. Previously fp8 init was performed when `args.fp8_init == False`. I have updated the logic to match what I presume was intended by leveraging the nullcontext context manager.
2. `te.fp8_autocast` was previously not called; the recipe was created but was unused. The autocast context manager now wraps the model's computation.

Signed-off-by: Neil Tenenholtz <[email protected]>
Signed-off-by: Neil Tenenholtz <[email protected]>
ptrendx
ptrendx previously approved these changes Aug 26, 2025
@timmoon10
Copy link
Collaborator

/te-ci pytorch L1

timmoon10
timmoon10 previously approved these changes Aug 29, 2025
Copy link
Collaborator

@timmoon10 timmoon10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending CI

@timmoon10 timmoon10 dismissed stale reviews from ptrendx and themself via 4708277 August 29, 2025 21:19
@timmoon10
Copy link
Collaborator

/te-ci pytorch L1

@timmoon10 timmoon10 self-requested a review August 29, 2025 23:33
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.

FSDP2 Deadlock with fp8_autocast
3 participants