Skip to content

serve: connect dense qwen35 to the existing native Qwen seat - #251

Closed
Burntgogi wants to merge 3 commits into
midagedev:mainfrom
Burntgogi:contribution/dense-qwen-pr-20261015
Closed

Burntgogi wants to merge 3 commits into
midagedev:mainfrom
Burntgogi:contribution/dense-qwen-pr-20261015

Conversation

@Burntgogi

@Burntgogi Burntgogi commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Connect dense qwen35 generation to the existing Qwen seat and CUDA Body35, as requested in #88. An explicit bloomery-serve --model qwen3 or the native generate_qwen3moe CLI reaches the same app Session, GPU model, common context/load planner, placements, resident slots and checkpoints; no new seat or libllama model loop is added.

The 27B head shape (24/4 heads, width 256) selects the existing scalar pair flash, while routed group-of-eight/quad shapes retain MMA. File architecture is read once by the planner from its existing Split, and load/listening/placement records name qwen35. No-word decision selection, in-file decision refusal beside a generative word, and head inference remain intact. Dense generation refuses drafts.

Exact model

  • HF repo lmstudio-community/Qwen3.8-27B-GGUF, revision 5a7da681f60570ab5b439a587e912d2e5eddb582.
  • File Qwen3.8-27B-Q4_K_M.gguf, 16,810,714,336 bytes.
  • Full downloaded-file SHA-256 verified against HF LFS: e00082f779fa385cee8c68a3ec8833a75778cc87272240b942f74e0b8243e520.
  • Actual types: F32 360, Q4_K 439, Q6_K 67 (866 tensors). Dense qwen35, 65 declared / 64 trunk layers; 15 unused next-token tensors.

Other files advertised as Q4_K_M were screened and rejected for additional quant types. The original mixed IQ3_S file is not the initial target; no weight conversion or IQ format expansion is included.

Code shape

  • No second copy: the seat, Session, Body35 and common context/load/placement owners are reused. The serving planner now derives the body family from its existing file instead of an independent architecture argument; its existing gate callers use that owner.
  • Model code holds only architecture facts; no model/kernel/app implementation changed.
  • Dead code is gone.
  • No silent failure: unknown architectures, decision layouts, missing flash entries and requested dense drafts are named errors.
  • Comments state what is true now.
  • No relaxed gate or lint. The complete host coverage check still returns nonzero for its missing tool-call parser.
  • Format and clippy are clean with warnings denied on all touched Rust targets.

Duplication found or removed: independently supplied ServeOpts::arch removed; model and serving orchestration are not copied.

What I ran

Base e98d6c43f95bc75475cadaf1043c1735962dcc5d; source head 49cd2b21baebb8f938d47c9c95838818b9e368c5.

cargo test --locked -p bloomery-gpu-gates --lib
  117 passed; 3 ignored
cargo test --locked -p bloomery-model --lib
  350 passed; 4 ignored

Static cargo check and cargo clippy --no-deps -- -D warnings passed for bloomery-serve, generate_qwen3moe, gate_routed_legs, gate_qwen3moe_types and the admission example, with glm5next,clef,vision,mimo2. These used the pinned nightly, CUDA 13.3 headers, libclang 18 and Intel target-cpu=native, and built no CUDA executable.

The parent d63f1ba passed full T0: DONE tier=t0 total=82 red=0 wall=266s. The review fix was checked in its own Cargo target: 117 host library tests, warnings-denied static clippy, format and comments pass. CI reruns full T0 on this push. The gate table retains every upstream selector.

The actual-file host admission output is preserved in the prior snapshot; the reader/coverage owners are unchanged by this rebase:

tensor_types={"F32": 360, "Q4_K": 439, "Q6_K": 67}
metadata arch=qwen35 layers=65 trunk=64 embedding=5120 heads=24 kv_heads=4 head=256 vocab=248320 experts=0 flash_mma=false
coverage unsupported=1 unused_tensors=15
unsupported layer=None a tool-call parser for this template

The complete example exits 1, as required by its full-coverage contract. There are no unsupported tensor-format/role entries, but this is not a full-admission pass. No parser/coverage guard was waived. The optional structured tool-call feature remains unimplemented/unverified.

Exact file identity, source identity, commands, current logs and complete local affected list.

NVIDIA lane still needed

The contributor host has an i5-12600K, 64 GiB RAM and RX 7900 GRE, with no NVIDIA card. Per #88, maintainer A6000 48GB validation is still required: cargo-oxide build, exact-file independent reference dump, forced-ID logits, eager/graph agreement, HTTP vs native CLI --last-step at short and 4K prompts, sampling/reset/checkpoint reuse/resident slots, plus existing routed and decision gates. The local static affected list (--no-box, without unavailable maintainer remote dep-info) is included; no unavailable GPU gate is described as run.

Native whole-model AMD serving, MTP, media, tool calling and performance versus llama.cpp/Strata are unverified. The existing routed gate_qwen3_serve cannot substitute for a new dense reference clause.

Rebase review: latest main's /props placement and RoPE stage-memory accounting are preserved. The gate-map conflict retains all upstream selectors and adds only the four consumers of the new host shape helper. Maintainer has offered A6000 verification after 0.3.3 in #88.

Release notes: dense Qwen generation frontend attach, gated as unverified until the maintainer's NVIDIA evidence; no new AMD serving support or speed claim.

Review corrections: both frontends use the shared model_file::decision_type reader, which rejects a present non-string marker before model loading. A minimal-GGUF header regression fails when the former permissive lookup is restored. The CLI now constructs Open35 through the existing serve_open35 owner, removing the duplicate Hparams/flash/ubatch configuration and unused imports. Current source, regression and isolated checks.

@github-actions github-actions Bot added documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Oct 15, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MUST_FIX: The new generation route accepts malformed decision metadata and duplicates shared load configuration.

Must fix

1. Reject a present decision type with the wrong GGUF type

crates/gpu-gates/src/bin/bloomery_serve.rs:282 enables generation with an explicit Qwen word. With qwen35.decision.type=U32(1), crates/gpu-gates/src/bin/bloomery_serve.rs:321 silently reads the present marker as None. A valid dense body then loads for generation instead of reporting the malformed metadata. The native CLI rejects this same file.

Validating the marker now prevents the two frontends from acquiring different decision contracts. Replace the decision lookup in file_facts with:

let key = split.arch_key("decision.type");
let decision = split
    .value(&key)
    .map(|v| {
        v.as_str()
            .ok_or_else(|| format!("{key}: expected a string"))
    })
    .transpose()?
    .map(str::to_owned);

Add a header regression case with a numeric decision marker. It must fail before model loading.

2. Construct CLI load options through the existing owner

crates/gpu-gates/src/bin/generate_qwen3moe.rs:2165 repeats the header read, flash selection and ubatch defaults in crates/gpu-gates/src/bin/shared/qwen3moe_place.rs:861. These hold the same load contract, contrary to R14.

Reusing the existing owner reduces code and prevents future defaults from diverging. Replace the hp binding and Open35 construction with:

let o = q3place::serve_open35(&file, ctx, kv, false)?;

Remove the now-unused Hparams, Open35 and ubatch_size imports from this CLI.

Checked

Duplicates: 8 new types/functions checked; shared Open35 construction is duplicated. No dryer pairs were supplied.

Complexity: CLI run 148→150 adds the dense draft branch; open_qwen35 26→28 adds header/shape error paths; serve_load 19→20 expands family matching.

Silent failure: 6 sites followed. Five <missing> fallbacks are guarded or lead to refusal; the decision-type lookup drops malformed metadata as described above.

Tests: static mutation review only. Mapping qwen35 to None, admitting clef, or flipping decode_mma's comparison fails the new assertions. The Python unreadable-arm mutant reaches SourceError. No test covers a non-string decision marker. No builds or tests were run during this review.

Gates: no thresholds or pins moved. Zero KV heads, unsupported flash shapes and insufficient dense-model card memory have explicit refusals.

Escape catalog: no C1–C4 patterns matched.

Notes

Dryer did not run; diagnostics reports no changed Rust files under crates/, although this diff contains them.

The PR supplies host/static results but no NVIDIA gate evidence. Dense reference logits, graph agreement and HTTP/native parity remain unverified.

Card check: needs-gpu. This pull request changes crates/gpu-gates/examples/qwen35_admission.rs, crates/gpu-gates/src/bin/bloomery_serve.rs, crates/gpu-gates/src/bin/generate_qwen3moe.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@Burntgogi

Copy link
Copy Markdown
Contributor Author

Addressed both must-fix items in49cd2b21baebb8f938d47c9c95838818b9e368c5. Server and CLI now share model_file::decision_type, which refuses a present non-string marker before model loading. A minimal-GGUF regression covers absent/string/empty/numeric metadata; restoring the old permissive lookup makes the numeric case fail.

The CLI now uses q3place::serve_open35 and removes its duplicate header/flash/ubatch configuration and unused imports. An isolated build passes117 host library tests, static clippy with warnings denied, format and comments. No NVIDIA runtime evidence is claimed.

Current source, regression negative/positive logs and static results. Diagnostic draft #254 inherits these corrections and passes119 isolated host tests plus clippy/Python checks. The agreed A6000 execution remains pending.

github-actions[bot]
github-actions Bot previously approved these changes Oct 15, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the last review:

Verdict: CLEAN: Both earlier findings are fixed, and the new commits introduce no must-fix issue.

Checked

Duplicates: 2 new functions checked; neither duplicates an existing contract. No dryer pairs were supplied.

Complexity: diagnostics reports CLI run 148→150 and serve_load 19→20 from earlier dense-family branches. Neither function changes in this increment.

Silent failure: 2 changed frontend sites followed. A non-string decision marker returns a named error before GPU model loading. Absent and empty-string markers remain distinct.

Tests: static mutation analysis of model_file.rs:36: restoring Ok(file.arch_get_str("decision.type")) makes the numeric-marker case fail at line 319. The new test also asserts absent, named-string and empty-string results. No builds or tests were run during this review.

Gates: no thresholds, pins or gate cases moved.

Performance: changes affect load-time metadata and configuration; no per-token work is added.

Escape catalog: no C1–C4 patterns matched.

Notes

Dryer did not run: diagnostics says no changed Rust file is under crates/, although this increment changes Rust files there.

The PR supplies host/static results but no NVIDIA gate evidence. Dense reference logits, graph agreement and HTTP/native parity remain unverified.

Card check: needs-gpu. This pull request changes crates/gpu-gates/examples/qwen35_admission.rs, crates/gpu-gates/src/bin/bloomery_serve.rs, crates/gpu-gates/src/bin/generate_qwen3moe.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the last review:

Verdict: CLEAN: The increment consistently changes the regression fixture's architecture prefix and preserves its assertions.

Checked

Duplicates: 0 new items; no dryer pairs supplied.

Complexity: diagnostics flags CLI run 148→150 and serve_load 19→20 from earlier commits. Neither changes in this increment.

Silent failure: 0 new production sites. The fixture still asserts distinct absent, string, empty-string and malformed-marker outcomes.

Tests: static mutation analysis of model_file.rs:36: replacing validation with Ok(file.arch_get_str("decision.type")) makes the malformed-marker assertion at line 319 fail. Hard-coding the old architecture prefix at line 32 makes the named-string assertion at line 318 fail. The GGUF reader accepts the synthetic architecture. Tests were not executed during this review.

Gates: no cases, thresholds or pins removed or relaxed.

Performance: this increment changes test data only.

Escape catalog: no C1–C4 patterns matched.

Notes

Dryer did not run: diagnostics reports no changed Rust file under crates/, although this increment changes one there.

The PR provides no NVIDIA gate run with the required card, commit and command-output evidence. GPU validation remains outstanding.

Card check: needs-gpu. This pull request changes crates/gpu-gates/examples/qwen35_admission.rs, crates/gpu-gates/src/bin/bloomery_serve.rs, crates/gpu-gates/src/bin/generate_qwen3moe.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@juliankang4

Copy link
Copy Markdown
Collaborator

지금 마스터 브랜치랑 충돌하는 상황이라 리베이스 한 번 부탁드립니다!

@Burntgogi

Copy link
Copy Markdown
Contributor Author

Closing in favour of #339, which review has since chosen as the front line for dense qwen35 — the typed CardBudgetFloor shortage fix and the dense 27B on GB10 load are already queued there, so the work continues in one place instead of two.

Handover from this branch, in case review wants any of it in #339 or a follow-up:

The same-seat HTTP diagnostics follow-up stays with #254, which follows #339 as its parent.

@Burntgogi Burntgogi closed this Oct 16, 2026
@juliankang4

Copy link
Copy Markdown
Collaborator

Burntgogi님, 고맙습니다. #339가 ea4b6228로 main에 들어갔습니다. 세 커밋은 author와 내용을 그대로 두어서 main 기록에 Burntgogi님의 기여로 남습니다. 먼저 정리해서 닫아 주셔서 고맙습니다.

(AI 코딩 에이전트가 작성한 코멘트이며, 내용은 제가 확인했습니다.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation gpu The card engine: crates/gpu*, crates/app needs-gpu Changes code a card must check, and carries no gate run on a card tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants