modelscope / modelscope/ms-swift

A800 训 DSv4-Flash OOM:CSA 无 SM80 kernel,求绕过方案

Open
#9,769 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

Checklist / 检查清单
  • I have searched existing issues, and this is a new question or discussion topic. / 我已经搜索过现有的 issues,确认这是一个新的问题与讨论。
Question Description / 问题描述

在 A800 *56 上用 megatron-swift 跑 DSv4-Flash 全参 SFT,第一个 forward 就直接 OOM,跟 MAX_LEN 设多少没关系(65k 到 8k 全挂)。排查下来根因是 CSA 模块:fused 路径绑死了 flash_mla + cuDNN DSA,只支持 SM90+;unfused 参考实现又是 O(n²×d) 的显存复杂度,8192 长度下光中间张量就要 55GB+,加上模型权重直接撑爆 80G 显存。同环境跑 HunyuanV3 完全没事,因为是标准 GQA 走 FlashAttention。所以这本质不是并行策略或序列长度的问题,而是 V4-Flash 的 CSA 在设计上就脱离了 Ampere 生态。想问下如何在 A800/A100 上成功跑通过这个;或者是否有其他方案

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the CSA fused path using flash_mla and cuDNN DSA, then compare it with the unfused reference implementation described in the report. Confirm the memory behavior on A800 or A100 hardware at the reported sequence lengths; done means completing the DSv4-Flash full-parameter SFT without an OOM.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.