[Ulysses SP] sdpa/eager x non-packed inputs crash with NPU vector-core exception 507035 (IndexCheckKernel OOB)
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- distributed-systems, machine-learning
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Python
- Star
- 270
- Fork
- 68
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 38
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelscope/twinkle
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
modelscope/twinkle#429 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 22/100
modelscope/twinkle#411 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
modelscope/twinkle#410 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
modelscope/twinkle#407 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
魔搭托管的 Twinkle API 持续超时Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
modelscope/twinkle#319 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của modelscope/twinkle
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choiceCó thể đã có người làm @beartester34 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
modelscope/evalscope#2330 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Distribution plot crashes when a numeric feature is constant in the train or test setCó thể đã có người làm @adembilge đã nhận hôm nay. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
MAIF/shapash#847 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 2 ngày
-
namespace team:operations
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
EclipseFdn/open-vsx.org#16738 ·
Maintainer thường phản hồi trong vòng 1 ngày