OpenFlowLM-Next icon indicating copy to clipboard operation
OpenFlowLM-Next copied to clipboard

Granite 4.2 3B Uno drafter on the NPU (on top of #184)

Open Cyronius opened this issue 1 month ago • 0 comments

Run a Uno drafter for IBM Granite 4.2 3B through #184's NPU path, so a second model and adapter use the L-row pass and uno_cycle.

The adapter

  • Format: a PEFT LoRA, r=128, alpha 8192 (s = 64), on q, k, v, o, gate, up and down of all 40 layers. Trained with IFM's Uno recipe against frozen ibm-granite/granite-4.2-3b.

  • Training: 1,651 steps, 0.87B tokens of OpenThoughts3 + Tülu 3 SFT data. The draft noise ids are [1, 100256), which leaves out Granite's special and added tokens.

  • Measured on 60 prompts (CPU/GPU reference, greedy, 256 tokens):

    tokens per forward tokens per cycle
    S=4 1.586 3.17
    S=8 1.765 3.53
    • With q4_1 base weights, S=8 holds at 1.763.
    • Output is identical to greedy decode in fp32.
  • Hosting: the weights are on HF (private for now); a local copy is used for conversion.

Depends on (family-neutral, going onto #184 by a stacked PR)

  1. The adapter's B carries the base's folds. Granite's builder folds attention_multiplier * sqrt(head_dim) = 0.125 into q, so s·B_q needs it too.
  2. The draft noise range is per adapter, recorded as uno.q4nx metadata and honored by uno_cycle and the CLI.
  3. One Uno generate in the AutoModel base, instead of K2-only code.
  4. The L-row pass (dxl, lmhl) at hidden widths that are multiples of 512. Granite is 2560; today rows_route returns no route for it, and lmhl drops the columns past 2048.

Granite-specific (this issue)

  • [ ] Convert with q4nx-build ... --uno-adapter <dir> --uno-noise-high 100256.
  • [ ] Add ROWS_FAMILIES += granite and build dxl, dxl_lora and lmhl for granite:3b; --rows-check 17 prints ROWS PASS.
  • [ ] open_qwen36_cli --uno 128 on utilities/uno-ref/prompts.jsonl prints UNO IDENTICAL on every prompt. Tokens a cycle within ±5% of the CPU reference at L=4 with a q4_1 base.
  • [ ] utilities/uno-bench numbers next to K2's.
  • [ ] Granite's AutoModel opts into Uno for greedy requests. To decide: Granite's default sampler is top-k 40 / temperature 1.0, so Uno would serve only explicitly greedy requests unless the default changes.
  • [ ] Spec: OPEN-FAMILY-GRANITE-UNO.

Expected

About 3.1–3.2 tokens a cycle at L=4. With #184's current pass costs (verify ~1.34×, draft ~1.56× a decode step), that is ~1.1× plain decode, below K2's 1.2× because this adapter accepts fewer tokens at four rows. #184's speed phase lowers the pass costs for every adapter. L=8, where this adapter reaches 3.53, stays blocked for K2 and Granite alike.

Cyronius avatar Oct 09 '26 23:10 Cyronius