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

Request: ~9B NPU2 build for FLM 1.0.7 with MTP head retained (speculative decoding)

Open webactionhellas-dev opened this issue 1 month ago • 7 comments

Request: a ~9B NPU2 build for FLM 1.0.7 with the MTP head retained (speculative decoding)

Thanks for the excellent NPU2 work, the builds are a huge help for AMD Ryzen AI users.

The gap: FLM 1.0.7 added speculative decoding via the built-in MTP draft head, but so far the only model shipping it is qwen3.8-mtp:27b. That model is ~17 GB of weights, which does not fit the ~15.5 GB NPU carveout on 32 GB machines (Ryzen AI 7/9 laptops and mini-PCs).

Meanwhile every 9B NPU2 build I can find (yours and FastFlowLM's) is still flm_version: 1.0.1. Their configs declare mtp_num_hidden_layers: 1, so the architecture has the draft head, but the 1.0.1 runtime has no speculative path, and the 1.0.1-format q4nx does not load/generate cleanly on the 1.0.7 runtime (tested: loads then fails/garbles, same class of issue as other 1.0.1 builds on 1.0.7).

The ask: a ~9B NPU2 build packaged for FLM 1.0.7 with the MTP/nextn head retained, so flm serve engages speculative decoding on it the way it does for the 27B. A 9B would fit the common 32 GB NPU budget at Q4NX (~7.6 GB weights) and give those machines the decode-speed win without needing the 27B.

Ideal base (open to anything that fits): one of the abliterated/uncensored Qwen3.5/Qwen3.8 9B distills you already ship (e.g. Qwen3.8-Distilled-Heretic-9B, Ornith-1.5-9B, or a Qwen3.5-9B), rebuilt for 1.0.7 with the draft head kept.

Two questions in case a full build is not planned:

  1. Does the FLM Q4NX converter currently have any way to export the MTP/nextn tensors into a 1.0.7 q4nx, or is that still internal-only? If there is a flag or recipe, a DIY on an existing 9B would be great.
  2. Is FLM 1.0.7 speculative decoding validated for the Qwen3.5 9B family, or is it currently specific to the 27B build?

Happy to test any build on a Ryzen AI 7 (Radeon 840M, 32 GB) and report decode numbers. Thanks again.

webactionhellas-dev avatar Oct 12 '26 10:10 webactionhellas-dev

Related smaller-MoE ask (may be an easier win than the MTP 27B):

Would a 14B-A3B NPU2 build be feasible? Specifically Qwen3.5-14B-A3B-Claude-4.6-Opus-Reasoning-Distilled-reap (and similar small A3B distills). Its config is Qwen3_5MoeForConditionalGeneration with hidden_size 2048, moe_intermediate_size 512, num_experts_per_tok 8, 40 layers - identical per-expert dims to the Qwen3.6-35B-A3B you already ship as NPU2, just pruned to 93 experts. So the existing 35B-A3B xclbin kernels look like they should apply directly.

At Q4NX it would be ~9-10GB of weights, which fits the ~15.5GB NPU carveout on 32GB machines (where the 35B-A3B at ~24GB does not). That would give those boxes a 14B-class MoE: more capable than a dense 9B, with A3B (~3B active) decode speed. It also carries an MTP head (mtp_num_hidden_layers: 1), so it could be a candidate for the 1.0.7 speculative path too.

Is converting a 93-expert qwen3_5_moe variant to Q4NX something the current converter/tooling handles, or does the pruned expert count need new kernels? Happy to test any build on a Ryzen AI 7 (32GB). Thanks!

webactionhellas-dev avatar Oct 12 '26 10:10 webactionhellas-dev

Concrete target found - this one looks directly convertible with your existing 35B-A3B kernels:

tvall43/qwen3.5-18b-a3b-reap-coding-heretic-v0 (18B-A3B, REAP-pruned to 128 experts, heretic/abliterated, coding).

Its config is an exact match to Qwen3.6-35B-A3B except expert count:

  • model_type: qwen3_5_moe_text, Qwen3_5MoeForConditionalGeneration
  • hidden_size 2048, moe_intermediate_size 512, num_experts_per_tok 8, num_hidden_layers 40, head_dim 256
  • num_experts 128 (pruned from 256), mtp_num_hidden_layers: 1

Since only the expert count differs, the 35B-A3B xclbin kernels should apply directly. At Q4NX it would be ~11GB of weights, which fits a 32GB machine's ~15.5GB NPU carveout (the 35B at ~24GB does not). That would give Ryzen AI boxes an 18B-class abliterated MoE at ~3B-active decode speed - a real step up from the dense 9B NPU2 builds.

Is a 128-expert qwen3_5_moe convertible with the current tooling/kernels, or does the pruned expert count need a rebuild? If it is straightforward, a NPU2 build of this (or any sub-20B heretic qwen3_5_moe A3B) would be hugely useful. Happy to test on a Ryzen AI 7 (32GB) and report numbers. Thanks!

webactionhellas-dev avatar Oct 12 '26 10:10 webactionhellas-dev

There's been a lot of spec decode work in progress. Make sure anything we do for this is evaluated in context of existing PRs.

Currently we support dflash2, mtp, and an interesting "prompt word" spec decode feature that is nearly free for models that don't have a better option.

And the uno diffusion models essentially draft for themselves.

Cyronius avatar Oct 12 '26 15:10 Cyronius

Related smaller-MoE ask (may be an easier win than the MTP 27B):

Would a 14B-A3B NPU2 build be feasible? Specifically Qwen3.5-14B-A3B-Claude-4.6-Opus-Reasoning-Distilled-reap (and similar small A3B distills). Its config is Qwen3_5MoeForConditionalGeneration with hidden_size 2048, moe_intermediate_size 512, num_experts_per_tok 8, 40 layers - identical per-expert dims to the Qwen3.6-35B-A3B you already ship as NPU2, just pruned to 93 experts. So the existing 35B-A3B xclbin kernels look like they should apply directly.

At Q4NX it would be ~9-10GB of weights, which fits the ~15.5GB NPU carveout on 32GB machines (where the 35B-A3B at ~24GB does not). That would give those boxes a 14B-class MoE: more capable than a dense 9B, with A3B (~3B active) decode speed. It also carries an MTP head (mtp_num_hidden_layers: 1), so it could be a candidate for the 1.0.7 speculative path too.

Is converting a 93-expert qwen3_5_moe variant to Q4NX something the current converter/tooling handles, or does the pruned expert count need new kernels? Happy to test any build on a Ryzen AI 7 (32GB). Thanks!

I believe this will work. My own pruned qwen 3.6 27b A2.8b loads, and was actually the whole reason for me to get involved with openflowlm. I would test it, and if it doesn't work, we'll accept PRs, or we can fix it for you if you're not a coder type.

Shameless plug: I'm not a big fan of the reap models. They are helpful in making more fit in memory but they don't actually do much for speed. You get similar intelligence losses but speed GAINS from pruning entire layers. My pruned qwen is substantially faster than base.

Cyronius avatar Oct 12 '26 15:10 Cyronius

@Cyronius No other model gets anywhere near that performance, what the heck did you do? Because it sounds like what you did is vaguely, Very vaguely, similar to what my llama.cpp build does itself, and the two seem to be playing stupefyingly well together. Chilling at ~6gb on the ram, which is nice.

Atomic-Germ avatar Oct 15 '26 04:10 Atomic-Germ

5. @Cyronius No other model gets anywhere near that performance, what the heck did you do? Because it sounds like what you did is vaguely, Very vaguely, similar to what my llama.cpp build does itself, and the two seem to be playing stupefyingly well together. Chilling at ~6gb on the ram, which is nice.

qwen 3.6 35b a3b is 40 blocks. Each block is 3 gated delta net layers and 1 full attention layer. What I did to this model is rather nasty; i chopped off 10 of those blocks, then did a lora fine-tune to heal most of the damage. The model is substantially faster. It is definitely also a bit dumber but you can still use it agentically. For some reason everyone knows about REAP which cuts out experts. This is such a silly thing to do because the experts cost you NOTHING in performance and EVERYTHING in smarts. All REAP pruning does is make it easier for a model to live in your RAM. And at a quantized 35b that just doesn't seem smart to me.

the full writeup is at https://github.com/Cyronius/model-experiments

I also did a nasty thing to qwen 3.8 flash next. This one wasn't as smart, very misguided actually, but for some reason people like it.

Cyronius avatar Oct 19 '26 16:10 Cyronius

@Cyronius people like experiments! Especially experiments with new and hard-to-run models. I use my Guanaco extension patches to run Qwen3.8-Flash-Next on llama.cpp due to my system having 48gb (single channel!) total. It actually runs okay. I'd have bought the thing with 96gb in the first place if I knew the ram cost would become this bad.

That said, 35b a3b is fast on every system I've ever tried it on. I'm sure there's more than Guanaco to run a model larger than total ram, but I'm on a laptop with uma so that's how I do it for now. It only keeps recently used experts pinned and pages the rest.

Atomic-Germ avatar Oct 21 '26 13:10 Atomic-Germ