Skip to content
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

feat(2D): support selective-checkpoint-offload for 2D attention #396

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

yingtongxiong
Copy link
Contributor

Motivation

Support selective-checkpoint-offload for 2D attention, which offload the attention activation to CPU when enable selective activation checkpoint.

Modification

internlm/model/ops/ring_flash_attn/zigzag_ring_flash_attn_with_sliding_window.py

Use cases (Optional)

image

TODO

loss testing


if gpc.is_forward is False and gpc.config.selective_checkpoint:
assert layer_idx in fa_output_mapping
Copy link
Collaborator

Choose a reason for hiding this comment

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

第11行fa_output_mapping的初始化可以去掉了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

哦对 好的

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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