Repository navigation
Releases
Releases · dllm-labs/mojo-dllm
mojo-dllm 0.3.0
Added
- A
scorecardworkflow runs the OpenSSF Scorecard weekly, on pushes to main and when branch protection changes, and
publishes the result, so the Scorecard API and a README badge have data. It reports and never gates, and it uploads
no SARIF. mojo-dllm --versionprints a second line,commit: <id>, with the 12-character short id of the commit the binary was
built from (issue #113, pull request #167).-dirtyfollows the id whengit statusreports changes undersrc/at
build time, andunknownstands in for a build without Git metadata or one that did not go throughscripts/build.sh.
scripts/build.shpasses the id as-D MOJO_DLLM_GIT_SHA=g<id>andbuild_id()removes theg: the compiler reads a
define of digits only as a number and would drop the leading zeros of an id such as000000123456.
scripts/check_build_id.shbuilds the binary and compares the line (CI andci-local.sh --fullrun it), and
tests/python/test_build_stamp.pypins the stamp rules against real temporary repositories. Therun --jsonkey set
is unchanged.- A Dream run accepts
--remasking originand--remasking random(issue #40, pull request #68).originfollows the
Python reference: each masked position commits independently with probability1 - s/t, forced to 1 at the final
step.randomfollows llama.cpp: a uniform random confidence per candidate, then the scheduled top-k. Both use
--seed; the default staysentropy.--no-suppress-maskallows the mask token as a sampled answer again. - Optional DiffusionGemma graph traces (
--trace-dir,--trace-only) and
ordinary-buffer replay (--no-repack).scripts/build_dg_ref.shalso builds
dg_matmul. The projection, matrix, softmax and tiny-model checkers, together
withcompare_dg_traces.py, record the cached/unified arithmetic differences
and independent forward comparisons for #163. runandtokenizetake--prompt-file PATHin place of--prompt(issue #104, pull request #157).-reads standard
input, one trailing newline is removed, and a file that cannot be read exits 1 before the model is mapped. Both flags, or
neither, exit 2. Tests now reach the flag throughexecutefor each command: the unit tests calledresolve_prompt
directly, so deleting either call inmain.mojopassed all of them.runreads a default for ten value flags fromMOJO_DLLM_*variables (issue #122, pull request #191):MODEL,
MAX_TOKENS,STEPS,BLOCK_LENGTH,SEED,TEMPERATURE,THREADS,DEVICE,REMASKINGandTHRESHOLD. A flag on
the command line wins, an empty variable counts as unset,--verbosereports each value that came from a variable on
stderr, and a bad numeric value names its variable.scripts/check_env.shdrives the real binary through those rules
(CI andci-local.shrun it), anddocs/cli.mdsays which scripts need the variables unset.- Dream takes
--eps F, the final timestep of its schedule (issue #30, pull request #283): 0.001 by default, at least 0
and below 1. LLaDA and DiffusionGemma refuse it. The schedule lives indream_transfer_probabilityand
dream_n_transfer, sooriginremasking and the top-k paths both follow it.
Changed
- DiffusionGemma's
dg-fixed-input-v1comparison uses the reference's cached/unified
spread for each prompt and self-conditioning state. It checks the local reference
against the recorded calibration before evaluating candidate logits, verifies the
candidate receipt, and checks the model's absolute soft-cap. The calibration and
fault controls are inbench/checks/2026-11-05-dg-sensitivity.json.
bench/check_dg_bound.py make-mutant --recordsaves the changed tensor, sizes and hashes. - The mask token can no longer be sampled (issue #40, pull request #68): argmax, the softmax normalizer and Gumbel
selection skip it, and the Gumbel draw for the skipped candidate is still consumed, so the random stream does not
move.--no-suppress-maskrestores the old behavior for parity experiments. On GPU, suppression turns the device
row-statistics path off, so LLaDA at temperature 0 and every Dream run copy the logits back to the host (32 rows of
126,464 floats per LLaDA step);--no-suppress-maskkeeps the device path. Excluding the mask inside the
row-statistics kernel is tracked in #284. GenConfig.mask_idis gone again, as 0.2.0 announced: pull request #68 had added it back with -1 meaning "the model's",
and no code outside the tests set it. The loops readmodel.config().mask_id.
Fixed
- DiffusionGemma refuses an untied
output.weightand the seven per-block projection scales (attn_q,attn_k,attn_v,
attn_output,ffn_gate,ffn_up,ffn_down) by name (issue #170, pull request #293). llama.cpp applies them and this
loader ignores them, so such a file used to answer with wrong logits.logitsnow says how many tokens--tokensmust
hold, and an unknown--devicegets the same message in option validation and in dispatch. - The gemma4 tokenizer ends generation on the set llama.cpp builds (issue #171):
<eos>,<turn|>and
<|tool_response>by their text, plus the ids undertokenizer.ggml.eos_token_id,eot_token_idandeom_token_id,
each once. A file whoseeos_token_idis missing or names another token now stops at<eos>too. The special tokens
are sorted longest first with a stable merge sort instead of an insertion sort, which was quadratic in their number.
Neither change moves an id on the DiffusionGemma file. - The action-pin check fails when the TruffleHog
versioninput insecret-scan.ymlis not the release its pin comment
names without thev(issue #146): a Dependabot bump moves the pin and leaves the scanner image tag behind. The
workflow comments now say what runs: a push to main and the weekly run pass no base, so each scans the full history
that leads to the commit, not the working tree. The check also refuses a TruffleHog step with noversioninput, whose
default islatest, and it reads the steps of composite actions under.github/actionsas well as those of workflows. ./mojo-dllm doctorrefuses any argument with exit 2 and runs no probe (issue #80, pull request #288):doctor --jsno
used to print the normal report and exit 0.doctor -handdoctor --helpstill print the help.--remasking originwas refused before the model loaded: the accepted names listed five values and left outorigin.
docs/cli.mdnow says Dream takes all six names and LLaDA refusesentropy,maskgit_plus,topk_marginandorigin../mojo-dllm runwith the default--device autono longer stops whennvidia-smiprints a line the launcher cannot
read (issue #81): like a missing, failing or timed-outnvidia-smi, it runs on the CPU and prints
device: cpu (nvidia-smi failed: nvidia-smi printed a line the launcher cannot read: '...').doctorandsetup
already went on with the CPU.
mojo-dllm 0.2.0
Added
bench/engines/sglang.py, an engine forbench/eval_engine.pythat answers GSM8K through the OpenAI-compatible
endpoint of a running SGLang server (issue #180):--engine sglang --base-url URL, with the declared--dtype,
--algorithm,--checkpoint,--max-running-requestsand--chat-template. The request has four fields (model,
one user message,max_completion_tokens,streamfalse) and never carries a field that the DiffusionGemma algorithm
rejects with HTTP 400 (logprobs, a grammar, a penalty, a seed) or ignores (temperature,top_p,top_k). SGLang
has no/versionroute, so the release,
the diffusion algorithm, the dtype and the batch size come fromGET /server_infoand the checkpoint from
GET /model_info. A declared value that contradicts a reported one is refused, a server that runs no diffusion
algorithm or reports a quantization is refused, and the batch size must be 1 (reported or declared). The arm's
modelcarries the dtype, socompare --across-weightssees different weights, andflags.model_matches_serveris
true only when--modelis the checkpoint the server reports (false for an alias that matches the served name only).
forward_passesis null in every
row: SGLang exposes no per-request step count onmainor in v0.5.23 (sgl-project/sglang#48675 was open and
unmerged on 2026-11-09), and the engine never reads/metrics. The model-list and completion checks moved from the
vLLM engine intobench/engines/_openai.py, unchanged, and both engines use them. The shared HTTP client also
strips control characters from, and caps, the text of a connection or transport error, as it does for server text.
docs/benchmarks.mdhas the runbook with the cookbook's serve command as read on 2026-11-09, the note that the bf16
checkpoint is 48.1 GiB, the Vast.ai API key read intoVAST_API_KEYinstead of passed as an argument (a test scans
the fenced blocks of the file for a key in an argument list), and a
DiffusionGemma section that lists the llama.cpp reference, vLLM, SGLang and mojo-dllm rows, each marked
no committed run yet. No server was run and the evaluation on a rented machine has not happened.bench/engines/vllm.py, an engine forbench/eval_engine.pythat answers GSM8K through the OpenAI-compatible
endpoint of a running vLLM server (issue #179):--engine vllm --base-url URL --served-model NAME --quantization Q
(and the declared--checkpoint,--attention-backend,--chat-template). It sends one chat message at
temperature 0 and never starts or stops a server.versionrecords the releaseGET /versionreports plus the
declared checkpoint, quantization and attention backend, and the arm'smodelcarries the quantization so
compare --across-weightssees different weights.forward_passesis the change of vLLM's
vllm:diffusion_num_denoising_stepscounter (read under that name and under its_totalexposition name) across
one request, null when the server has none, and refused unless--max-num-seqs 1is declared, because the counter
is server-wide. Server text in errors is stripped of control characters and capped, and the arm's--modelmust
equal the server's reportedrootor served name. The
run is refused for a served model the server does not list, an HTTP error, an empty completion or a response
with no token counts.flagssays"server": "remote": the isolation checks see only the client machine.
bench/engines/_http.pyis the shared standard-library client (no credentials, no cookies, no redirects, no
retries, no environment proxy unless asked, a size bound and one deadline per request).docs/benchmarks.mdhas
the runbook (rent, serve, run, destroy) with the recipe page's serve commands as read on 2026-11-09. No server
was run and the evaluation on a rented GPU has not happened.bench/engines/hf.py, an engine forbench/eval_engine.pythat runs GSM8K through the authors' own sampling
code (issue #178):generatefrom a checkout of ML-GSAI/LLaDA (--llada-repo, imported and never copied) and
diffusion_generatefrom Dream's remote code, at temperature 0 with steps equal to the generation length.
Options:--hf-model,--quant none|4bit,--model-revisionand the shared--device. Each row'sversion
records the model repository's commit sha (nullwhen none was given), the LLaDA checkout's commit and the
transformers,torchandbitsandbytesversions;flagsrecords where a Dream run departs from its README.
The adapter importstorchandtransformersonly when it loads a model, so the frozen environment and CI
never need them.eval_gsm8k.py compare --across-weightscompares arms that ran different model files and writes
both names andweights_differ(comparewritesmodelsandweights_differon every run now, and still
refuses different models without the flag).docs/benchmarks.mdexplains why the arm's accuracy includes
quantization and how to set up one environment per model. A Hugging Face repository now needs
--model-revision(or--allow-unpinned), because the loader runs the repository's Python; the arm'smodel
includes|4bitsocomparesees quantization; the load is refused beforefrom_pretrainedwhenMemAvailableis below an estimate from the weights'
size (and when that size or/proc/meminfois unknown), and the preflight after the load asks for the 3 GB of
working memory only. The memory-fit spike and the GSM8K arm of #178 have
not run.scripts/capped.shruns a command in its own memory-capped systemd scope: a hard cap, no swap and a
whole-scope kill on an OOM, so a job that outgrows the machine dies alone instead of taking its terminal with
it. It refuses to start when less memory is available than the job needs or when the user manager cannot
enforce limits.docs/development.md("Heavy jobs") explains the settings and what does not isolate a job.- The DiffusionGemma reference (issues #66 and #62).
scripts/build_dg_ref.sh
builds the ggml-org/llama.cpp#24423 branch at a pinned commit, CPU only and
offline, into its own tree beside the mainline checkout.tools/ref/dg_ref.cpp
writes the canvas logits of one denoising step for a fixed prompt and canvas:
the unified[prompt | canvas]pass or the prompt K/V path (prefill, then one
decode step), each with or without self-conditioning from a given
previous-step buffer.bench/parity.py --arch diffusion-gemmaruns the
reference phase, and a comparison phase that stops with a message until
mojo-dllm's own outputs exist (#64). The comparison's bound comes from the
LLaDA evidence plus a check on each row's largest logit, and every case
records how far the reference lies from itself.bench/check_dg_bound.py
shows the bound rejecting a missing final soft-cap and a dropped layer scale
(bench/checks/2026-11-04-dg-bound.json). The tokenizer goldens forgemma4
are intests/fixtures/gemma4-tokenizer-golden.tsv, with their provenance. - DiffusionGemma's entropy-bounded denoiser (
_generate_diffusion_gemma,
issue #65): a random canvas over the whole vocabulary, a per-position
argmax, entropy and draw from one pass over each logits row, acceptance of
the lowest-entropy positions while the entropies before them sum to at most
the bound, and a stop once the argmax canvas holds and the mean entropy is
small. Six flags (--eb-steps,--eb-t-min,--eb-t-max,--eb-bound,
--eb-stability,--eb-confidence) default to the llama.cpp branch's
values.--jsongainssteps_takenandstop_reasonfor every model. The
forward pass is #64, and #277 tracks wiring it to this loop; tests use a scripted model. scripts/check_weights.pycompares GGUF tensor shapes with safetensors
headers, with LLaDA/Dream name mapping and a standalone self-test.- Q8_0 and Q5_K reference decoders, with GGUF type sizing and reference tests
for Q8_0, Q5_K and BF16. Matrix kernel support remains Q4_K and Q6_K. - A Q5_0 reference decoder (22-byte blocks of 32 weights) with GGUF type sizing,
a reference test against gguf-py's decoder and a hand-built block test of the
high-bit layout. It is the first piece of the DiffusionGemma reader (#61). - A
diffusion-gemmabranch ofModelConfigreads the DiffusionGemma
metadata (per-layer sliding/global pattern and K/V head counts, head sizes and
RoPE bases per kind, experts, canvas length, soft cap) and checks the tensor
directory against it:attn_vexactly on sliding layers, K width, the 3-D
expert tensors and the rope table. A wrong key or tensor is refused by name,
as are non-zeroattention.shared_kv_layersand
embedding_length_per_layer_input.inspectprints the config.DiffusionLM
and the GPU model stop on these files (#61). The key names come from the
unmerged ggml-org/llama.cpp#24423. DiffusionGemma, the CPU forward pass of DiffusionGemma, in
models/diffusion_gemma.mojo(#64): one unified pass over [prompt | canvas]
with sliding and global layers, the region masks, RoPE withrope_freqs,
attention scale 1, the dense MLP plus 128-expert MoE, the two embedding and
layer-scalar regions, the tied Q6_K head and the soft cap.mojo-dllm logits
runs it. A numpy forward pass written from the llama.cpp branch
(scripts/dg_numpy.py) checks it on a tiny fixture: most rows agree to 2e-7,
a few to 7e-3 where an int8 rounding step lands on a tie.prefillandstep
run the prompt once and then the canvas against its cached K and V; they agree
with the unified pass bit for bit on the tiny model.forward_scandstep_sc
add self-conditioning: the previous step's logits, softmaxed at the previous
temperature, go through the transposed embedding table and theself_cond
MLP into the canvas embedding.logits --path cached --prev FILE --prev-temp-inv Xreaches all four. The real-fi...
mojo-dllm 0.1.0
First release: CPU inference for two diffusion language models from GGUF.
Measured speed against llama.cpp and diffuse-cpp is in
docs/benchmarks.md; agreement with llama.cpp is in
docs/correctness.md.
Added
- LLaDA-8B and Dream-7B from Q4_K_M GGUF files (F32, Q4_K and Q6_K tensors).
- GGUF v2/v3 reader over a memory map, with
mojo-dllm inspect. - Int8-activation GEMM over weights repacked 8 rows per register, using
AVX-VNNI when present, with a work-claiming thread pool for hybrid CPUs. - Bidirectional attention with grouped-query heads; NORM and NEOX RoPE; Q/K/V
bias; logits computed only for the positions a step samples. - Byte-level BPE tokenizers (
bailingmoe,qwen2) matchingllama-tokenize
id for id on a 36-case multilingual corpus each. - LLaDA's block sampler (low-confidence or random remasking, Gumbel
temperature) and Dream's timestep sampler (entropy, maskgit_plus,
topk_margin). mojo-dllm run,tokenize,inspectandlogits.- Benchmark, parity and quality harnesses, with every published number
rendered from their result files. - Local-first CI (
scripts/ci-local.sh, git hooks) mirrored in GitHub
Actions; mdBook documentation.
Measured (LLaDA-8B-Instruct Q4_K_M, i5-13420H, 12 threads, 32 steps)
| Runtime | ms / step | tokens / s | peak RSS |
|---|---|---|---|
| mojo-dllm | 3,005 | 1.33 | 5.9 GB |
llama.cpp llama-diffusion-cli |
5,807 | 0.69 | 8.4 GB |
Medians of 9 runs from bench/results/2026-10-03-cpu-llada.json; the full tables, Dream-7B and diffuse-cpp included, are in docs/benchmarks.md.
Requirements
Linux on x86-64 with AVX2, about 6 GB free memory, and pixi. Build from source: pixi install && pixi run build. No binaries are attached: the Mojo runtime libraries a build links against ship under Modular's own terms (see NOTICE).