Skip to content

add support for cudnn sdpa checkpoint #1805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Cjkkkk
Copy link
Collaborator

@Cjkkkk Cjkkkk commented Jun 4, 2025

Description

Add support for cudnn sdpa checkpoint. This helps avoid recomputation when using remat policy=minimal_flash in maxtext.

Checklist

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

  • I have performed a self-review of my code.
  • 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.

@Cjkkkk Cjkkkk changed the title add checkpoint name add support for cudnn sdpa checkpoint Jun 4, 2025
@@ -911,6 +911,9 @@ def cudnn_jax_flash_attention(
qkv_layout="BTNH",
return_residual=True
)
output = checkpoint_name(output, "context")
lse = checkpoint_name(lse, "context")
return output, lse
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this match the return type hint of Array?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ya this is good point, its failing our internal lint, probably need to change type hint

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.

3 participants