[Engine] recurrent-depth (looped) decode for the generic path - QSA-only, KV-sharing
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- backend, machine-learning
Hướng nghiên cứu
Read src/core/verify.cpp at Verifier::record_window and include/strata/core/session.hpp for the QSA KV state; compare their behavior with the loop configuration and gate kernels in src/inkling2/. Trace the generic loader through src/artifact/gguf_reader.cpp and its ModelGeometry config path. The issue asks for agreement on scope before implementation, so first resolve that design discussion; completion would require QSA-only KV-sharing, GGUF configuration, and the stated parity, decode speed, and VRAM validation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Proposing to add recurrent-depth / Middle-Cycle style looped execution to the generic path (the one --layer-split and the expert cache use), scoped to QSA layers only for v1 — GDN layers stay outside the looped range, since a repeated pass over recurrent state isn't a well-defined "revisit" the way a KV cache is.
Background. This follows the recurrent-depth / looped-transformer line (Universal Transformer -> Huginn -> Relaxed Recursive Transformers, arXiv:2410.20672 -> Mixture-of-Recursions, arXiv:2507.10524 -> Ouro), prompted by looking at whether something like GLM-5.4's "Loop Transformer" is feasible here. Strata already ships the execution-side building blocks for this in src/inkling2/ (Inkling-2-Mini's Middle-Cycle: prelude/core/coda scheduling, loop.core_start/core_end/num_passes/gate_rank config, GRU-style gate kernels loop_control_f32/attn_res_mix_f32), but with per-pass (non-shared) KV. This proposal is to bring the same capability to the generic path, targeting KV-sharing (pass 0's KV reused by later passes, the MoR variant) since that's the one Inkling2 doesn't have and the one that helps on VRAM-constrained cards rather than compute-bound ones.
Why generic-path QSA layers check out clean. Verified by direct read:
- Layer execution (
src/core/layer.cpp): stateless, plainint64_t layerindex — revisiting a layer index is free. - Main runtime loop (
src/core/verify.cpp,Verifier::record_window): one-layer-ahead software-pipelined loop; wrapping[core_start, core_end)in an outer pass loop is a local, bounded change. - Pipeline hand-off (
Verifier::chain_overlap): gated onnext_->device_ != device_; same-device repeated stages just skip the cross-device latency-hiding optimization and run correctly. - Expert cache (
core/expert_cache.cpp): pure(layer, expert) -> slot, no per-token one-visit assumption.
The one real wrinkle. include/strata/core/session.hpp's SessionState shows the 48 generic-path layers are a GDN/QSA hybrid (is_qsa_layer picks qsa_layer vs gdn_layer). QSA layers have ordinary KV (the sharing problem Inkling2's visit_kv_slot[v] already solves, just not in a form the generic path can call). GDN layers carry recurrent state (gdn_state) instead — a second pass there would be another recurrence step, not a cache hit. Scoping v1 to QSA-only sidesteps that question entirely; extending to GDN (snapshot/restore gdn_state per pass) would be a separate, riskier follow-up.
Rough file list for v1:
src/core/verify.cpp-Verifier::record_window: outer pass loop over[core_start, core_end), restricted to QSA layers.include/strata/core/session.hpp-SessionState::qsa_statesaddressing: read pass-0 KV on pass > 0 instead of writing a new one.src/artifact/gguf_reader.cpp(+ itsModelGeometryconfig path) - addloop.core_start/core_end/num_passes/gate_rankfor the generic loader, mirroring Inkling2's GGUF keys. No generic-path safetensors loader exists, so GGUF-only.- Possibly relocate
loop_control_f32/attn_res_mix_f32out ofsrc/inkling2/inkling2_loop.cppinto a shared location once two families call them, rather than forking the kernel.
No change expected to the expert cache or the multi-GPU pipeline hand-off (checked above).
Validation plan: parity against Inkling2-Mini's own Middle-Cycle on the same model (byte-identical where applicable, exactness-gate style like --peer-device's), plus decode tok/s and VRAM at 1/2/3 passes, in the usual _parity/_test/_bench triplet shape.
What I'm asking: agreement on this scope (QSA-only, KV-sharing, reusing Inkling2's config/gate-kernel pattern) before I put together a PR, per CONTRIBUTING.md's rule for a feature this size. Happy to narrow or adjust the approach based on feedback.
- Ngôn ngữ chính
- C++
- Star
- 11.6k
- Fork
- 1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 Niko1221/Strata
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Niko1221/Strata#7365 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 4 ngày
-
[GUI] Engine chip: move the breathing status dot to the right end of the quant line, inside the chipĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 4 ngày
-
[GUI] The top horizontal stroke of 更 in the sidebar footer is never drawn (Windows, 125% scaling)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Niko1221/Strata#7276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Niko1221/Strata#7230 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của Niko1221/Strata
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`test_controlled_TermSequenceBox_logging` and `test_symbolic_ops` fail when another test runs firstĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Quantinuum/tket#2282 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
KhronosGroup/Vulkan-Tutorial#555 ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Server crashes when a mob dies to poisonCó thể đã có người làm @joelstiller đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DarkCastleMUD/DarkCastle#305 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Issue]: RAS status report lists the wrong pids for an outlier nodeCó thể đã có người làm @bhargavchintam đã 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
Maintainer thường phản hồi trong vòng 2 ngày