Skip to content

[PyTorch] Debug checkpointing with te.Sequential#1629

Merged
timmoon10 merged 2 commits intoNVIDIA:mainfrom
timmoon10:debug-te-sequential-checkpoint
Apr 9, 2025
Merged

[PyTorch] Debug checkpointing with te.Sequential#1629
timmoon10 merged 2 commits intoNVIDIA:mainfrom
timmoon10:debug-te-sequential-checkpoint

Conversation

@timmoon10
Copy link
Collaborator

Description

TE 2.0 changed how the fusible ops handled FP8 state, i.e. using quantizers rather than fp8_meta dicts, but the get_extra_state/set_extra_state functions were not updated. This PR updates these functions so they are similar to the module get_extra_state/set_extra_state functions:

def get_extra_state(self) -> torch.Tensor:

def set_extra_state(self, state: torch.Tensor) -> None:

I've also added a unit test.

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

  • Update checkpointing functions in fusible ops with changes from TE 2.0
  • Add tests for checkpointing fusible ops

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

Signed-off-by: Tim Moon <tmoon@nvidia.com>
@timmoon10 timmoon10 added the bug Something isn't working label Apr 1, 2025
@timmoon10
Copy link
Collaborator Author

/te-ci pytorch

@timmoon10 timmoon10 merged commit 0da6044 into NVIDIA:main Apr 9, 2025
20 of 23 checks passed
wdykas pushed a commit to wdykas/TransformerEngine that referenced this pull request Apr 14, 2025
* Debug checkpointing with te.Sequential

Signed-off-by: Tim Moon <tmoon@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Tim Moon <tmoon@nvidia.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Peter Dykas <wdykas@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant