Chunked DFlash loss path flattens prev_token_ids, breaking DSpark subclass heads
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
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- machine-learning, performance
Hướng nghiên cứu
Bắt đầu bằng cách đọc _forward_chunked_decay và chunk gate trong angelspec/models/dflash.py, sau đó so sánh các triển khai hook trong angelspec/models/dspark.py và angelspec/models/draft/dspark.py. Tái hiện mục tiêu decay với ANGELSPEC_DFLASH_LOSS_CHUNK > 0 bằng cấu hình DSpark chỉ dùng Markov và với confidence_head_alpha=0. Hoàn thành khi đường dẫn chunked không còn bị crash và regularizer pos_alpha.smooth_loss() vẫn được giữ lại khi áp dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In _forward_chunked_decay, prev_token_ids is flattened to 2-D before being passed to the _compute_draft_logits hook:
https://github.com/Tencent/AngelSpec/blob/main/angelspec/models/dflash.py#L1089-L1094
prev_chunk = prev_token_ids[:, start:end].reshape(bsz, nb * bs) # 2-D
logits_chunk = self._compute_draft_logits(dh_chunk, lm_head_weight, prev_chunk, nb)
But DSparkModel._compute_draft_logits (angelspec/models/dspark.py) forwards prev_token_ids to markov_head.apply_block_logits(token_ids=...), which expects [B, n_blocks, block_size] (angelspec/models/draft/dspark.py). With a 2-D input, compute_step_bias produces a [bsz, nb*bs, V] bias that is added to [bsz, nb, bs, V] logits — a RuntimeError whenever nb > 1 (and a silently wrong broadcast followed by a reshape crash when nb == 1, bsz > 1).
The gate that is supposed to keep subclass heads off the chunked path only checks _extra_distill_needed():
https://github.com/Tencent/AngelSpec/blob/main/angelspec/models/dflash.py#L754-L761
For DSpark that returns True only when a confidence head is active, so a DSpark model with only a markov_head (or confidence_head_alpha=0) plus ANGELSPEC_DFLASH_LOSS_CHUNK > 0 and the decay objective takes the chunked path and crashes. This contradicts the stated intent in _dflash_loss_chunk's docstring ("dpace / distillation / subclass heads keep the single full-vocab projection").
A secondary issue on the same path: _forward_chunked_decay never calls _compute_extra_loss, so the position-adaptive-alpha smoothness regularizer (pos_alpha.smooth_loss()) is silently dropped for any DSpark config that reaches the chunked path without crashing.
Possible fixes: extend the chunk gate to exclude models that override _compute_draft_logits / _compute_extra_loss, or pass prev_token_ids as [B, nb, bs] and make the hooks shape-consistent.
- Ngôn ngữ chính
- Python
- Star
- 460
- Fork
- 40
- Merge trung bình
- 1 giờ 4 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay 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 Tencent/AngelSpec
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
SGLang multi-node: auto-negotiated dist_init port can collide with pre-allocated engine portsĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Tất cả issue của Tencent/AngelSpec
Issue tương tự
-
ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
future-agi/future-agi#5070 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
juandresrodca/AdminForge#69 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
deepset-ai/haystack-integrations#817 ·
Maintainer thường phản hồi trong vòng 12 ngày
-
[Bug]: test_remote_realpath_uses_argument_vector fails on Windows with Python 3.13+ (ntpath.isabs)Có thể đã có người làm @gouyu-hou đã nhận hôm nay. Đang mởtriage/confirmed
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
agentscope-ai/agentscope#4397 ·
Maintainer thường phản hồi trong vòng 2 ngày