Repository navigation
feat(server): stream DiffusionGemma denoising snapshots - #3624
Merged
Merged
Conversation
Member
|
Reviewed #2878 against the canvas callback, request-level cap, cancellation and streaming implementation. Preview work is gated by cadence, duplicate decoded frames are skipped, and committed results use the normal decode state. CI passed. CUDA checkpoint and route validation are recorded in the PR body and were not repeated locally. |
inureyes
added a commit
that referenced
this pull request
Dec 1, 2026
* fix(server): pass swa_full through the diffusing-interval constructor main does not compile since #3658 and #3624 landed together. #3658 threads `swa_full` through `ModelProvider` and passes it to `new_with_full_config_and_diffusing_interval`, while #3624 introduced that constructor without the parameter, so `cargo build` fails with E0425 (`swa_full` not in scope) and E0061 (41 arguments where 40 are expected). Add `swa_full: bool` to the constructor after `context_retention`, where the call from `start` already passes it, and forward it from `new_with_full_config`, which takes it but did not pass it on. The body already uses it. Validated with `cargo build --profile test-fast --features cuda` on Linux (the lib, `mlxcel`, `mlxcel-server`, `mlxcel-bench-decode` and `examples/logit_trace`). * chore(docs): drop a raw JSONL record the binary-assets check rejects #3334 committed `docs/benchmark_results/paged-sliding-decode-gb10-2026-11-23/gemma3-1b-first-run-partial.jsonl`, a partial raw record stream. `scripts/ci/check_benchmark_raw_logs.py` rejects JSONL under benchmark data, so the `binary assets` job fails on main and on every PR based on it. Nothing references the file; the directory keeps its README and JSON results.
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(server): stream DiffusionGemma denoising snapshots
Closes #2878.
DiffusionGemma's ordinary stream exposes tokens only after each canvas commits. Clients can now request
"stream": true, "diffusing": trueto show how the model revises its answer. Each preview replaces the displayed completion, rather than appending to it. Chat previews replace both reasoning and answer text so a revision can clear either field. The finish frame contains the committed result. Chat snapshots parse the echoed assistant prefix and generated continuation together, so a continuation such asworldkeeps its leading space afterHello. Tool-call syntax is separated from answer text and reasoning using the same parser as non-streaming chat; only committed calls are emitted as structured deltas.--diffusing-interval Ncontrols preview frequency (default: every step). Unchanged snapshots are skipped. Both OpenAI endpoints accept per-requestmax_denoising_steps,diffusion_sampler, anddiffusion_threshold; the configured step limit still applies. Requests do not change settings for later callers. Ordinary streaming keeps append semantics, including on autoregressive models. The existing Rust provider constructor keeps its signature and defaults to a one-step preview interval.Verification
The focused tests exercise preview cadence, replacement frames, committed text, usage and request option resolution. The real-model HTTP harness compares request overrides with equivalent server flags and checks that subsequent requests retain the defaults. Checkpoint:
mlx-community/diffusiongemma-26B-A4B-it-4bitata7a81407613811e8ba63af92ac0d852b809e191f.Spark2 verification used commit
c6f86ac766ab22eb37dc623bf85666996245d7ed; all 8,234 tracked files matched. Formatting, Clippy with-D warnings, and the CUDA release build passed. The server route suite had 660 passes, no failures, and one ignored video fallback test requiring FFmpeg 5.0+. Both new route regressions passed:Helloplusworldretained the space, and the Gemma tool call matched non-streaming output without exposing its syntax. All 14 diffusion worker tests and the canvas cadence test passed. With the checkpoint above, both completion endpoints returned HTTP 400 for a zero step cap, and the final streamed text matched the non-streaming response. On the text endpoint, an override changed the generated answer; the next request without overrides again returned “ Paris.” The full test suite was not run.