Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Moonshine streaming: zero-audio frontend context at the utterance start corrupts transcripts

Đã đóng
#500 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Một pull request liên quan đã được merge.

  • #501 của @michalharakal — đã merge
  • #507 của @michalharakal — đã merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c
Lĩnh vực
machine-learning

Hướng nghiên cứu

Read moonshine_stream_jni.c, focusing on the first-window and early-peek frontend handling at start == 0. Compare the current zero-audio context path with the issue's proposed sample-0 input and first-CHUNK-frames behavior. Validate against the three beckett.wav slices and confirm their transcripts match the stated references; note that pull request #501 is already open.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

moonshine_stream_jni.c feeds the frontend of the first encoder window four frames (FE_LC) of zero samples as left context. Zero samples are not the absence of context: past the first convolution's bias they become non-zero features, where the reference model zero-pads. The first memory rows come out wrong, and through the encoder's attention the error spreads over the whole utterance. Clips that start with a short pause before speech lose their entire transcript.

Repro

Moonshine v2 streaming tiny (EN, moonshine-ai/moonshine-streaming-tiny @ f8e9dfd), the five graphs from the asr-moonshine-v2-streaming-iree blueprint, 4 s slices of the public Moonshine sample beckett.wav:

clip reference (transformers 5.20.1, full pass) streaming runtime today
beckett 0–4 s Ever tried, ever failed, no matter. Ever tried, ever failed.
beckett 2.6–6.6 s Old. No matter. Try again. No, no, 10 out.
beckett 5.6–9.6 s (1.1 s pause, then speech) Fail again, fail better. (empty)

Bisection

  1. Each graph (frontend, encoder, adapter, prefill incl. logits) agrees with the same graph on host IREE 3.11 (cos 1.000000), so compiler and runtime are not involved.
  2. The PyTorch decoder fed the cross memory built the way the runtime builds it reproduces the wrong transcripts exactly, so the decode loop is faithful and the memory is wrong.
  3. The memory's first rows have cos 0.15–0.6 against the reference encoder output, recovering only after ~30 frames.
  4. A PyTorch emulation of the streaming loop reproduces the runtime's output word for word. Changing only the utterance start (no frontend context instead of zero audio) fixes all three clips. (Separately, the exported encoder's attention bands are one frame wider on each side than the reference, dist <= 16 / <= 4 vs < 16 / < 4. That alone is harmless: the reference with the wider bands still decodes all three correctly.)

Fix

At start == 0 (the first window and the early peek), feed the frontend from sample 0 and keep its first CHUNK output frames instead of feats[FE_LC]. The graph's own convolution padding is then exactly the reference start. Later windows are unchanged (their 4 frames of real context cover the frontend's receptive field; they match the reference exactly).

Verified with the same change in a port of this runtime on a Cortex-A55 board (local-task): all three finals match the reference.

Ngôn ngữ chính
Kotlin
Star
8
Fork
3
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
48

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SKaiNET-developers/SKaiNET-transformers

Tất cả issue của SKaiNET-developers/SKaiNET-transformers

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.