Skip to content

refactor(framework): promote greedy Qwen decoder runtime and Qwen BPE bundle helpers - #555

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
gqf2008:audio8-asr-promotion
Sep 15, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
gqf2008:audio8-asr-promotion

Conversation

@gqf2008

@gqf2008 gqf2008 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves the greedy Qwen decoder runtime and the Qwen BPE bundle helpers out of the audio8_asr community model into the framework, so other Qwen-based families can reuse them instead of carrying their own copies.

Changes

New framework pieces (moved from src/community_models/audio8_asr/thinker.cpp):

  • include/engine/framework/runtime/greedy_qwen_decoder.h / src/framework/runtime/greedy_qwen_decoder.cpp
  • include/engine/framework/tokenizers/qwen_bpe_bundle.h / src/framework/tokenizers/qwen_bpe_bundle.cpp

audio8_asr keeps using the same logic through the promoted runtime; the moved types are renamed to match their new home (ThinkerWeights -> DecoderWeights, TextLayerWeights -> DecoderLayerWeights, ...). CMakeLists.txt registers the new sources.

Verification

  • Rebased onto current main (cherry-pick, no conflicts).
  • Both targets build: audiocpp_cli, audiocpp_server.
  • ASR output is identical to main on the same input — assets/resources/b.wav transcribes to
    Some call me nature. Others call me Mother Nature. I've been here for over four point five billion years, twenty-two thousand five hundred times longer than you.
    byte for byte on both trees, so the move does not change behaviour.

… bundle helpers

Promotes the decoder graph scaffolding that greedy Qwen-family model
ports each re-roll (qwen3_asr thinker, audio8_asr thinker, audio8_tts
slow/fast decoders) into the framework:

- runtime/GreedyQwenDecoderRuntime: prefill graph with optional
  set_rows embedding injection, static-cache step decode, KV state
  handoff, and the argmax/EOS loop, parameterized by GreedyQwenDecoderSpec
  (weight names, use_qk_norm, attention biases, packed QKV, tied LM head,
  decoder stack config).
- tokenizers: load_qwen_bpe_tokenizer(bundle) and
  require_added_token_id(bundle, content), replacing per-family copies of
  the Qwen2 BPE bootstrap and special-token lookup.

audio8_asr is refactored onto the runtime as the first in-tree consumer;
its thinker shrinks from ~950 lines of graph code to a family-specific
spec. Behavior verified unchanged: unit tests, raw-transcript golden
test, and exact parity on Metal and CPU for short and 61 s clips.

Stacked on the audio8_asr port; meant to land after both model PRs so
the promotion has multiple consumers, with audio8_tts ported onto the
runtime as a follow-up commit in the same change.
@0xShug0
0xShug0 merged commit 5f1b82b into 0xShug0:main Sep 15, 2026
6 checks passed
@0xShug0

0xShug0 commented Sep 15, 2026

Copy link
Copy Markdown
Owner

@gqf2008 PR merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants