Skip to content

[megatron] test_convert_precision support attention fused#9395

Merged
Jintao-Huang merged 2 commits into
modelscope:mainfrom
Jintao-Huang:test_convert_precision_suppot_attention_fused
May 21, 2026
Merged

[megatron] test_convert_precision support attention fused#9395
Jintao-Huang merged 2 commits into
modelscope:mainfrom
Jintao-Huang:test_convert_precision_suppot_attention_fused

Conversation

@Jintao-Huang
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request renames _patch_attention_flash_fp32 to _patch_attention_fp32 and updates the test_convert_precision function to apply this patch when using either the 'flash' or 'fused' attention backends. A review comment identifies a potential issue with how args.attention_backend is accessed, noting that using .name may lead to an AttributeError or case-sensitivity mismatches if the backend type is inconsistent with other parts of the codebase.

Comment thread swift/megatron/utils/convert_utils.py
@Jintao-Huang Jintao-Huang changed the title [megatron] test_convert_precision support attention_fused [megatron] test_convert_precision support attention fused May 21, 2026
@Jintao-Huang Jintao-Huang merged commit f7eb065 into modelscope:main May 21, 2026
1 of 3 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.

1 participant