Skip to content

Conversation

@jberchtold-nvidia
Copy link
Contributor

@jberchtold-nvidia jberchtold-nvidia commented Dec 2, 2025

Description

This PR allows us to avoid rematerializing TransformerEngine (TE) quantizations. TE supports fused kernels that compute both the forward and backward layouts in a single kernel, however, these are only useful if we are saving the alternate layouts for the backward.

This PR introduces two new remat policies, minimal_with_quantization and minimal_with_context_and_quantization which extend the existing policies with additional support for checkpointing TE quantizations.

Tests

Tested locally with E2E workloads and confirmed the quantization operations were saved and not rematerialized with these policies enabled.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

Copy link
Collaborator

@richjames0 richjames0 left a comment

Choose a reason for hiding this comment

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

lgtm

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.

3 participants