[Ulysses SP] sdpa/eager x non-packed inputs crash with NPU vector-core exception 507035 (IndexCheckKernel OOB)
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Bereich
- distributed-systems, machine-learning
Rechercherichtung
Start by reading DistributedAttention.forward and tracing how the 2D attention mask length relates to the gathered q/k/v sequence length for Ulysses sequence parallelism. Reproduce with sequence_parallel_size=2, attn_impl=sdpa, packing=false, and padding_free=false on Ascend NPU. Done means the mask uses the global sequence length or this configuration is rejected early with an actionable validation message; the report says a fix candidate and companion validation PR are planned.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Checklist / 检查清单
- I have searched existing issues, and this is a new bug report. / 我已经搜索过现有的 issues,确认这是一个新的 bug report。
Bug Description / Bug 描述
Ulysses sequence parallelism (sequence_parallel_size>1) with attn_impl=sdpa/eager and
non-packed inputs (padding=False, padding_free=False) crashes on Ascend NPU with a
vector-core exception (507035). The crash is an index-out-of-bounds during attention
mask building: the attention mask stays at the local shard length while q/k/v are
gathered to the global sequence length.
Evidence (cann log):
EE9999: vector core exception, error code 507035
cann IndexCheckKernel: bounds=88, index in [128, 173]
- bounds=88 is exactly the local seq length (global 176 / SP2)
- indices 128-173 fall in the global position range (88+40 ~ 88+85)
Triggering matrix (20-step training runs, all on Ascend910 x2):
fa2 + packed -> PASS
fa2 + non-packed -> PASS
sdpa + packed -> rejected by existing validation (requires flash kernel)
sdpa + non-packed -> CRASH (only combination neither supported nor guarded)
An all-ones mask (single sample, no padding) also crashes, which confirms the issue
is the length mismatch, not the padding values.
How to Reproduce / 如何复现
- ms-swift dev-swift-v5 + twinkle dev-swift-v5, 2 x Ascend910, torchrun:
- Config: sequence_parallel_size=2, attn_impl=sdpa, packing=false, padding_free=false,
backend=hf, tuner=lora, any text SFT dataset (e.g. alpaca-zh 2000 rows), max_steps=20. - First forward_backward crashes with 507035.
Expected: either the 2D mask is gathered to the global sequence length (like the 4D
path), or config validation rejects this combination early with an actionable message
(flash-attention backends take the varlen path and are unaffected; see companion
ms-swift validation PR).
Additional Information / 补充信息
- twinkle: dev-swift-v5 @ dd3d68f
- Hardware: Ascend910 x2 (64GB), torch_npu 2.10.0.post7, CANN 8.x
- transformers 5.22.1, peft 0.19, Qwen3.5-4B / Qwen3.5-35B-A3B-8L (MoE, 256 experts)
- We have a fix candidate: gather 2D masks along the sequence dim in
DistributedAttention.forward (PR to follow), plus an NPU-gated config-level guard in
ms-swift validate (companion PR).
- Vorherrschende Sprache
- Python
- Sterne
- 270
- Forks
- 68
- Ø Merge
- 2 T. 16 Std.
- Gemergte PRs (30 T.)
- 38
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelscope/twinkle
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
modelscope/twinkle#429 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 22/100
modelscope/twinkle#411 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
modelscope/twinkle#410 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 66/100
modelscope/twinkle#407 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
魔搭托管的 Twinkle API 持续超时Offenbug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 15/100
modelscope/twinkle#319 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in modelscope/twinkle
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choiceEvtl. vergeben @beartester34 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
modelscope/evalscope#2330 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Distribution plot crashes when a numeric feature is constant in the train or test setEvtl. vergeben @adembilge hat das heute übernommen. Offenbug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
MAIF/shapash#847 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 10 Tagen
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 2 Tagen
-
namespace team:operations
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 60/100
EclipseFdn/open-vsx.org#16738 ·
Maintainer antworten meist innerhalb von 1 Tag