Skip to content

feat(server): stream DiffusionGemma denoising snapshots - #3624

Merged
inureyes merged 2 commits into
lablup:mainfrom
Jaeyeong-CHOI:feat/diffusing-stream-2878
Dec 1, 2026
Merged

inureyes merged 2 commits into
lablup:mainfrom
Jaeyeong-CHOI:feat/diffusing-stream-2878

Conversation

@Jaeyeong-CHOI

Copy link
Copy Markdown
Contributor

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": true to 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 as world keeps its leading space after Hello. 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 N controls preview frequency (default: every step). Unchanged snapshots are skipped. Both OpenAI endpoints accept per-request max_denoising_steps, diffusion_sampler, and diffusion_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-4bit at a7a81407613811e8ba63af92ac0d852b809e191f.

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: Hello plus world retained 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.

@inureyes inureyes added status:review Under review type:enhancement New features, capabilities, or significant additions priority:medium Medium priority labels Dec 1, 2026
@inureyes

inureyes commented Dec 1, 2026

Copy link
Copy Markdown
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
inureyes merged commit b5005bd into lablup:main Dec 1, 2026
38 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority status:review Under review type:enhancement New features, capabilities, or significant additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(server): Inception-compatible diffusing streaming mode for block-diffusion models

2 participants