Qwen3-0.6B-diffusion-mdlm-ONNX (fused fp16, for the browser)

ONNX export of dllm-hub/Qwen3-0.6B-diffusion-mdlm-v0.1 (Tiny-A2D: Qwen3-0.6B adapted to masked text diffusion) packaged to run client-side in a web browser on WebGPU via onnxruntime-web. To our knowledge this is the first text-diffusion LM whose denoising loop runs in-browser (image diffusion in-browser is common; text diffusion has been server-side until now).

Generation is a JS denoising loop โ€” start fully masked, run a full forward over the canvas, lock the highest-confidence tokens, repeat โ€” implemented in kohra (web/kohra.js), a small transformers.js-style module.

Use it

Grab the loader (kohra.js, one file โ€” it's in this repo, or in the kohra project at web/kohra.js) and import it locally; the model + tokenizer load from this HF repo:

import { pipeline } from './kohra.js';

const generate = await pipeline('text-diffusion', {
  model: 'https://huggingface.co/naklitechie/Qwen3-0.6B-diffusion-mdlm-ONNX/resolve/main/onnx/model_fp16_fused.onnx',
  tokenizer: 'naklitechie/Qwen3-0.6B-diffusion-mdlm-ONNX',
});

const { text, tokensPerSecond } = await generate('Lily runs 12 km/h for 4 hours. How far in 8 hours?');
console.log(text, `(${tokensPerSecond.toFixed(1)} tok/s)`);

Requires a WebGPU browser (Chrome/Edge 121+) served over https or localhost. ~1.4 GB download (fp16, cached by the browser after first load); ~9.8 tok/s on an M-series Mac at 128 denoise steps.

Files

  • onnx/model_fp16_fused.onnx (+ .onnx.data) โ€” fp16 weights with RMSNorm fused to SimplifiedLayerNormalization. The fusion is required: a decomposed Pow(x,2) RMSNorm overflows native fp16 on WebGPU and silently produces all-zero logits; the fused contrib op reduces in fp32. Recipe + forensics: the kohra repo's reference/MDLM-algorithm.md.
  • Tokenizer files (Qwen3 ChatML).

Notes

  • No KV cache โ€” bidirectional attention, one full forward per denoise step. Cost is steps ร— forward, not tokens; parallel block denoising is what plays to WebGPU.
  • q4f16 (~500 MB) exists and is correct on CPU, but ORT-web's WebGPU MatMulNBits kernel miscomputes it on Apple GPUs โ€” parked pending an upstream fix.

Attribution & license

Derivative of dllm-hub/Qwen3-0.6B-diffusion-mdlm-v0.1 (built on Qwen/Qwen3-0.6B, Apache-2.0; MDLM adaptation by dLLM). See the source repos for exact terms.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for naklitechie/Qwen3-0.6B-diffusion-mdlm-ONNX

Finetuned
Qwen/Qwen3-0.6B
Quantized
(1)
this model

Space using naklitechie/Qwen3-0.6B-diffusion-mdlm-ONNX 1