Skip to content

Conversation

yingtongxiong
Copy link
Collaborator

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

_ckpt_block_num = int(gpc.config.model.checkpoint * gpc.config.isp_num_layers)

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
Collaborator Author

Choose a reason for hiding this comment

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

哦对 好的

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@huangting4201 huangting4201 merged commit caf30d8 into InternLM:develop Feb 25, 2025
25 checks passed
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