Repository navigation
Qwen 3.8 Next (Flash-Next): native Qwen4 provider integration and qualification - #1030
Conversation
|
@jonathan308 is attempting to deploy a commit to the EigenLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
@codex review this |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfe556c135
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Independent Qwen 3.8 Next verification for 0.9.5
Assessment: the native serving path has substantial passing evidence, but I would hold an unconditional release thumbs-up until the failures below are resolved or explicitly scoped. This review was prepared with Codex from local testing; the runtime source was not modified.
Tested provider a4692e70e12ed190391f8d35af291bea56c6cadc with SDK 96199527fe3fb36dd0dfd656faaf36776df724f4, Apple M5 Max / 128 GiB, macOS 27.0 / Swift 6.3.2. Artifact: EigenLabs/Qwen3.8-Flash-Next-MLX-4bit-mtp, revision e555958420096f695d449111693a6647b698479b; canonical serving ID DarkBloom/Qwen3.8-Flash-Next-Q4-mtp. All 21 shards and all 35 manifest-listed files passed SHA-256 verification: 3,748 tensors, 76 MTP entries, 333 BF16 vision entries, 384 PLE entries, 106,294,664,646 weight-file bytes.
The saved release executable reports 0.9.4, SHA-256 a9b97dc3a20c18829521cb74ffb1af85b6d07940cf43fd4b89da4ed10826bcc2; source-matched metallib 2129f6132794d84243c02631bc7478417dba0e0dbd10467beab56c11bf20bdd2. This is feature qualification for 0.9.5, not a signed 0.9.5 bundle certification.
Passing results
| Check | Independently observed result |
|---|---|
| Real coordinator Chat/Responses API matrices, OFF/AUTO | 118/118 required cases pass; reasoning, tools/history, stream/plain, identity/usage, encrypted dispatch, signed/hash-bearing receipts and request/KV drains. Two unsupported-effort observations excluded. |
| Selected full-checkpoint native state | 25/25 exact logit/KV/QSA/GDN/PLE retention, rollback and serialized continuation cells; actual trained-head replay/discard; output budgets 1–9 exact between target-only and MTP at test-only fixed depth five. The native SDK test binary was built at 3752331, with these test/fixture/math files verified byte-identical at 9619952; diagnostic grants and test-only draft depth five are not serving defaults. |
| Independent corpus | Per mode: 24/24 wire and runtime checks, 18/20 exact semantic values, plus one additional NFC-equivalent value. All three image questions, malformed-input handling and cancellation/recovery pass. |
| Actual Responses output replay | 4/4 per mode, including real returned reasoning and parallel function calls replayed with matching result IDs; bounded cleanup passes. |
| Bounded context | 4,070- and 8,166-token prompts retrieve the opening value correctly; oversized-output rejection and recovery pass in both modes. |
| Cache mechanisms with a separately declared 30-second base | 16/16 OFF/AUTO: tenant isolation, four 4,096-token hits per arm, return to the first tenant, sidecar outage cold fallback/restart hit, exact outputs/usage and accounting. Eight encrypted dispatches and eight signed/hash-bearing receipts per arm. AUTO actually executed 250 MTP rounds, 609 proposed / 238 accepted. |
The 30-second diagnostic is not a normal-policy pass. The original 9-second-base failure below is preserved. The first diagnostic OFF attempt crossed midnight UTC and failed the unchanged accounting-date guard; a fresh unchanged diagnostic after midnight passed. No date/content/accounting assertion was bypassed. Likewise, an instantaneous post-response cleanup assertion was corrected only after preserved samples proved cleanup 4.1–4.2 ms later, before any next request; separate bounded drain probes then passed.
Fresh current coordinator checks also pass: 28 package suites, targeted races, and 413 native-Postgres store pass events without failures/skips. Earlier scoped prompt/sidecar checks included 126 byte-exact prompt vectors and 471 load requests. Earlier broad SDK/provider suites on this M5 needed MLX_ENABLE_TF32=0 for unrelated numerical fixtures; representative failures also reproduced on the pre-PR SDK. The real provider serving/API/performance runs used default precision and memory policy. The cache diagnostic changed only the deadline base; the SDK numerical fixtures used the explicit diagnostic grants/depth noted above. An initial cap-0.93 readiness experiment is excluded from normal-policy qualification.
Failures and proposed fixes
-
Ordinary CLI benchmark crashes on first inference. With the full selected artifact,
darkbloom benchmark --model DarkBloom/Qwen3.8-Flash-Next-Q4-mtp --iterations 1 --max-tokens 1loads successfully, then SIGTRAPs at its first iteration. Matching-binary crash analysis identifies the PLE catalog error-handler trap.ModelBenchmark.runuses the generic factory/generation path, which lacks PLE binding; details and typed-error corroboration are on companion #149. Fix: route Next benchmarking through its supported native CBv2 loading/generation path and repair or explicitly reject unsupported generic SDK entrypoints. Disabling SSD offload is not a substitute. -
Warm long-prompt admission rejects a request just served within the allotted time. The unchanged
TestIntegration_FlashNextCacheScopeserves its 4,207-input/64-output unscoped reference with first content at 7.274 s, then rejects the identical-body first scoped cold miss: provider capacity/503, coordinator HTTP429. Its learned prefill EWMA is 582.189 tok/s; the existing 0.5 haircut predicts at least 14.452 s, exceeding the 11.373 s request budget. The test already inherits the documented production-like 9 s base + prompt allowance, not the 5 s unconfigured fallback. This policy predates the PR; this model/hardware combination exposes the mismatch. Fix: align model/provider throughput forecasts, routing token estimates and coordinator deadlines; retest both the unmeasured first request and subsequent measured misses. The larger-budget diagnostic proves the cache mechanisms, not this policy. -
A genuinely cold first request times out before loading finishes. A separate probe verified the model was not resident, omitted backend prewarming, and sent one short 8-token request under the normal 9 s base / 120 s queue policy. It returned HTTP429 after 9.015 s (
timeout waiting for first response). Cache-enabled loading separately took about 173 s after registration, including intentional fresh pre/post artifact hashes. Fix: make readiness/routing account for model loading, or provide a distinct bounded loading phase before the inference first-content deadline. This is local reproduction, not a claim of a hosted outage. -
The provided AUTO cancellation/unload/reload gate fails on this 128 GiB host. Twice, actual quiet-prefill cancellation (two steps, no content), drain, readmission and weak model/PLE release checks passed, then the second load was refused: 65.1 / 61.6 GiB usable vs 89.5 GiB required. The correctly monitored test helper still had 51.07 GiB process footprint near the second rejection. Unload and the load gate already clear allocator cache. Investigate rather than assume a permanent leak: the fixture retains
firstBridge, its weak checks cover the container/outer VLM model rather than every inner array owner, and ordinary production retirement may differ. Add phase-aligned MLX active/cache and OS availability observations; compare a diagnostic that releases the old handle, then fix ownership/reclaim/admission as the evidence warrants. Keep the unchanged failing gate visible. -
Cold-load headroom is understated. Repeated default loads peaked near 110.3 GiB, settling around 68–71 GiB. The current padded load requirement is about 89.5 GiB before the OS reserve. Header accounting finds 42.1875 GiB of split routed gate/up inputs; retaining them while creating fused outputs predicts almost exactly the observed peak. This is strong source/artifact evidence, not a per-buffer allocator trace or an observed OOM. Fix direction: incrementally materialize/release fusion staging and measure the result, or account for the real transient in admission. PLE is already filtered before evaluation and whole-shard prefetch is skipped, so charging all offloaded tables as resident compute is not the targeted remedy. 96 GiB support is a desired target, not verified support; steady footprint alone does not qualify that tier. Proposed details are in the existing memory thread and companion SDK review.
-
Conversion metadata race confirmed. A controlled metadata mutation after initial pin validation still produces a success receipt. I am adding the independent reproduction to the existing thread, rather than duplicating that finding. The selected published checkpoint itself passed full hashing.
Performance and quality boundaries
Six matched warm 256-token text/code pairs: client-observed decode 40.5–41.8 tok/s OFF (median 41.3) versus 46.5–63.9 AUTO (median 58.5), median paired rate increase 41.6%; all six output/finish/usage comparisons exact. The client rate proxy is (completion_tokens - 1) / (terminal_time - first_visible_content_time); MTP chunking can affect that proxy. Median paired end-to-end time was also 28.7% lower. This is a bounded sample, not native-kernel or sustained throughput.
These serving runs used the default posture, with no explicit full-KV-parallel/layer-async opt-ins; an optimized-profile comparison remains to be done.
The generated maintenance-log 4,207-token sample recorded 7.223995 s internal prefill (582.365 tok/s), first content 7.274 s, and 63 post-first-token decode intervals over 2.467281 s (25.534 steps/s). Repetitive 4K/8K one-token probes yielded 876–971 prompt tok/s using client TTFT. These are different prompts and timing definitions. We have not established why another setup might reach 1.5–2K, isolated GPU-only prefill time, or causally attributed the difference to SSD PLE; identical-prompt warm-page/IO profiling and optimization-path checks are the next performance investigation. The admission haircut changes prediction, not execution speed.
Both modes preserve the visible limitations: literal <think> copying became <|im_start|> inside a tool value; decomposed Unicode normalized to NFC; the independent video answered dominant/first-frame red correctly but missed one brief blue frame (2/3). The frame sampler retained it. No output repair or weakened semantic oracle was used.
Before a blanket 0.9.5 approval, rerun the failed normal-policy/CLI/lifecycle gates after fixes and qualify the final signed bundle/catalog. Full positive 82K context, other physical tiers including 96 GiB, disabled multirow serving, BF16 equivalence, hosted traffic, live APNs and signed persistence/account trust remain outside this local qualification.
|
@codex review this |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
SDK merged and provider repinned — 2026-09-17
The consumer gitlink
libs/mlx-swift-lmnow pins729fa45c67a8b1cb26b1debeacf7f1d16ef3a21e, the merged commit of SDK PR #149. Gajesh2007 approved the exact review headae3ecdc835a895091f8929749fdb3e14383295a9; the GitHub-verified merge contains that head and has an identical complete Git tree.This follow-up changes only the dependency gitlink and dependency documentation/changelog. No new inference code, model weights, numerical baseline, MTP defaults or private prefill/memory experiments are included. The provider PR remains open; this does not deploy a release or alter HF/R2 artifacts.
Repin checks: merged-head ancestry and complete-tree equality; unchanged core/C/MLX-Swift and package-resolution pins; locked release provider build; documentation impact and 305-file documentation lint. GPU performance testing was paused at the human's request. Earlier model results below retain their original source/binary scope, and the 4K MTP performance follow-up and existing open gates are not declared resolved by this repin.
Prior runtime qualification — native Qwen4 loading and MTP memory (2026-09-17)
Paired review heads: provider
6b313942f8cc5235075d865e653988fe85ca4c9d, SDKae3ecdc835a895091f8929749fdb3e14383295a9. Runtime qualification binds provider77d1d1d86; the later provider commit is documentation-only.This update includes the native SSD-offload loading bound and physical-reclaim recheck, bounded MTP catch-up, consistent cold/restored unprimed carry, and ordered selected-page KV reads. It also includes the reviewed generic reasoning-control and recurrent output-gate fixes. Weights, tokenizer, trained heads, default SSD ngram offload, version 0.9.5, and other models' loading policy are preserved. Experimental prefill/NAX ports are excluded.
The selected load estimate is 75.026 GiB plus unchanged serving headroom (81.526 GiB total), not the former generic 89.5 GiB requirement. Actual MLX weight residency is about 69.2 GiB. On the clean package, the bounded 4K/192-token counting screen measures about 43 tok/s OFF and 79 AUTO with full acceptance; these are client proxies, not universal speeds. No 1.2K–2.5K prefill claim is made.
Source-bound results, evidence identity, failures and scope. Local compatibility is not hosted OpenRouter certification. This is a review update, not a merge, deployment, model upload, or all-green production sign-off.
Prior qualification notes (historical source scopes retained)
Integrates Qwen 3.8 Next (Flash-Next) using native Qwen4, retained multimodal processing, SSD n-gram/PLE, embedded MTP, paged storage and complete prefix checkpoints. This is not the 27B model or a Qwen3.5 architecture alias.
Current provider head:
5dc058abde416872525d7f3696de97d80c9c610e. Companion mlx-swift-lm #149 is pinned to publicly fetchable, GitHub-verified559c045fd61bfc2d55fc2e0c149f34d208149a66. Provider/coordinator version metadata is 0.9.5; the historical App Attest safety floor is unchanged. These updates do not merge or deploy either PR.Latest review fixes and upstream reconciliation
0rollback, compact-KV opt-in, all geometry/fault/media gates and existing prefill policy.0f7b1e6113efd91bb0a7a6586b57589527192724, retaining its contributor/docs-impact checks, warm-pool telemetry and security reports. Resolve documentation stamps and retain both the Qwen and security report links. The merge does not change the tested provider Swift sources, manifests or SDK pin.The earlier native prompt/tool framing, normalization-v5, metadata/usage, media-prefix, mixed-position and CI-isolation fixes remain included. No argument repair, weaker oracle, precision change or replacement numerical baseline is introduced.
Default performance profile
DARKBLOOM_QWEN4_QSA_PARALLEL_FULL_KV0selects original dispatch; independent QK plus unchanged ordered PVDARKBLOOM_QWEN4_QSA_PARALLEL_VALUE_PARTITIONSDARKBLOOM_QWEN4_LAYER_ASYNC0selects original scheduling; singleton native text widths 1–6 onlyThese paths primarily affect decode and short MTP verification. Larger prefill chunks retain existing paths; blocked GDN, shape-eligible affine QMM and PLE gather were already ON. The change does not establish 1.5K–2K prefill. Shell overrides still follow the documented foreground/local versus LaunchAgent passthrough boundary.
Matched M3 Ultra/256-GiB HTTP target-only runs on the unchanged selected artifact preserve output/usage and improve approximately 18 → 34 tok/s. Two warmed repeats give approximately 850–910 tok/s prefill TTFT proxies across natural and repeated-text fixtures; warmup is separate. Native 19-arm fixed-depth OFF/ON/unset comparisons retain exact token IDs and MTP traces, with new defaults matching the old explicitly enabled profile. Different prompt/acceptance distributions are not a like-for-like comparison to earlier ~60 tok/s measurements. Adaptive MTP settings are unchanged.
Validation ledger for this update
Latest change: before / after
flowchart LR subgraph Before A[Verify source metadata then convert shards] --> B[Late metadata copy may use changed bytes] C[Ordinary Qwen4 benchmark] --> D[Generic loader and generation assumptions] E[Unset speed flags] --> F[Qualified paths inactive] end subgraph After G[Capture verified metadata bytes] --> H[Convert and copy only pinned payloads] I[Factory binds and validates native resources] --> J[Native CBv2 benchmark and bounded lifecycle] K[Paired SDK defaults full-KV PV32 and layer submission] --> L[Existing exact fast paths; explicit zero rollback] M[ProviderCore version and coordinator fallback] --> N[Matching 0.9.5 metadata] endReproduction:
scripts/qwen38_validation/README.md,scripts/qwen38_conversion/README.md, and the SDK qualification guide. Runtime CLI SHA256 iscb575190ff2a413c82f76f20ca459bdfc24b10114068b2f7a5de8ebb7f749e42; metallib remains2129f6132794d84243c02631bc7478417dba0e0dbd10467beab56c11bf20bdd2. These local artifacts are not signed-release/notarization claims.Required/named constrained text tools and media remain target-only under the existing safety gates; eligible ordinary text/automatic tools retain MTP. Complete native caching, SSD learned-weight offload and one-row admission remain intact. After an approved SDK merge, repin to its observed merged SHA and recheck integration. Model visibility, uploads, PR merging, release signing, catalogs and deployment are separate operations.
Earlier qualification history — original commits, artifacts and limitations retained
The following is historical evidence from the preceding PR revisions. Statements marked “current” below refer to those earlier revisions, not the new update above.
Integrates Qwen 3.8 Next (Flash-Next) using native Qwen4, retained multimodal processing, SSD n-gram/PLE, embedded MTP, paged storage and complete prefix checkpoints. This is not the 27B model or a Qwen3.5 architecture alias.
The human-reviewed update includes all qualified native prompt/framing, response/accounting and cache fixes, with the existing speedups preserved. Provider head:
a4692e70e12ed190391f8d35af291bea56c6cadc. Companion mlx-swift-lm #149 is pinned to signed, publicly fetchable96199527fe3fb36dd0dfd656faaf36776df724f4.The reviewed integration includes upstream
605651bb95d71c1da9bb122107925143e9441973. Seven documentation conflicts are resolved, retaining both the Qwen and upstream recovery/report content. SDK main also merges cleanly; its extra two workflow files change CI action pins, not runtime code. No upstream PR merge, deployment or model publication is performed.Fixes included
Preserve original messages and the trained template for native Qwen4 required/named text tools. Keep declaration filtering, native name/schema/cardinality validation and other-model/media policies. Swift/Rust/Go now use synchronized normalization v5; older cache contracts fail cold.
Require a declared native function opening or framed JSON at every constrained tool-frame opening. Keep argument values opaque/model-generated and preserve reasoning boundaries; no heuristic unescaping, invented values/closures, tag stripping or weakened oracle is added.
Preserve response ID and creation time on coordinator terminal extras. Report authoritative Responses usage totals and finalized reasoning-item status while preserving a truncated root response's incomplete status, provider signatures, hashes and job identity.
Preserve validated cached-token/reasoning-token details on combined Chat finish-plus-usage events. A separate usage event takes precedence; do not duplicate details, invent missing usage or change token totals/content.
Retain qualified full-KV parallel attention, early safe layer submission, canonical media-prefix reuse and mixed-position provenance through ordinary/direct MTP target paths. Weights, heads, numerical baseline, sampler and safety caps are unchanged.
Add source-relocation, real-coordinator API, complete-manifest/catalog-binding and account-scoped cache regressions. The exact failing controls are retained; fixture corrections do not relax semantic assertions.
Wire the two mandatory GPU-global CI assertions into separate opted-in test processes. Ordinary invocations clear inherited exclusive-test flags. Preserve the existing nonempty/no-skips guard, and continue the isolated gate even when another test invocation fails. That earlier CI-only cleanup changed no runtime or numerical assertions. The current merge additionally retains upstream Hugging Face test isolation and verifies its failure propagation.
Fix standalone Responses reasoning/tool-call replay through the SDK pin, retaining explicit message/result boundaries and exact argument bytes. The coordinator prompt-contract implementation and normalization version are unchanged.
Before / after
flowchart LR subgraph Before A[Required or named text tool] --> B[Additional forcing prompt and older contract] C[Tool opener] --> D[Incomplete header boundary permits prose] E[Coordinator terminal extras] --> F[Changed identity or incomplete usage and reasoning status] G[Native SSD reuse] --> H[Combined terminal misses client cache detail] end subgraph After I[ToolChoicePromptPolicy and Rust normalization v5] --> J[Original native Qwen4 prompt with fail-cold contract parity] K[Qwen4NativeToolConstraint] --> L[Declared header or framed JSON plus final validation] M[Chat metadata and Responses builders] --> N[Stable identity, authoritative totals and item status] O[consumer_stream combined-terminal handling] --> P[Validated cache and reasoning detail exactly once] endNarrow review follow-up — local validation complete
The reviewed finding affects a client replaying separate Responses reasoning and function-call items as the next input. It does not mean ordinary reasoning/tool generation was broken. Typed item provenance now keeps the thought and adjacent calls in one assistant turn without coalescing unrelated explicit messages or crossing tool-result boundaries. No output repair, argument rewriting or numerical-baseline change is added.
Responses replay: before / after
flowchart LR subgraph Before A[Responses reasoning then function_call items] --> B[OpenAIResponseInput requires previous toolCalls] B --> C[Reasoning-only assistant turn plus separate call turn] end subgraph After D[OpenAIResponseInputMessage.Kind retains item origin] --> E[OpenAIResponseInput coalesces adjacent reasoning and calls] E --> F[One assistant turn with unchanged reasoning and arguments] F --> G[Existing native template and model] endCurrent rebuilt native binary:
e6212230902052fd1c84ec9695dcc7a20bae8c92b3a5e204a4dcf56146fde788; source-matched metallib remains2129f6132794d84243c02631bc7478417dba0e0dbd10467beab56c11bf20bdd2.Earlier broader qualification and remaining release gates
Earlier broader record:
docs/reports/2026-09-15-qwen38-native-api-qualification.md. Native executable assessed:e092f806305dbd9fe91e3558343dfbc9e5871f0b9d7eb3c6ea5ed437c0b264a3; metallib:2129f6132794d84243c02631bc7478417dba0e0dbd10467beab56c11bf20bdd2. Those earlier results retain their original source scope. The current follow-up above binds the rebuilt binary and narrow decoder change; full Qwen4 model code and numerical controls remain unchanged. Fresh public CI builds have their own binary identities.dfe556c135head. Both mandatory exclusive-GPU functions execute individually and pass without skips: the allocator/retained-alias assertion and paged decode batch-composition invariance. Seven CI jobs succeed; the push-only cache job is an explicit skip. The separate integration/benchmark workflows and Vercel deployment authorization remain separate checks.The selected artifact is unchanged: 21 shards/3,748 entries, 76 embedded MTP entries, 333 BF16 vision entries, 384 PLE entries/128 parts, and 106,294,664,646 weight-file bytes. Its latest approximately 7K/192 code cases give client decode estimates of 32.25–32.43 tok/s OFF and 50.49–52.67 AUTO. These are not native-phase or sustained-agent rates. Original-artifact native fixed-depth measurements remain in the earlier performance report and must not be substituted for this target.
Serving and release boundaries
DARKBLOOM_QWEN4_BATCHED_QSA=1is not promoted. The qualified speed switches remain explicit opt-ins, not a fleet activation.After an approved SDK merge, repin to its observed merged SHA and recheck integration. Roll back paired pins together and retain the previous immutable model revision. HF/R2 writes, model visibility, merge, release signing, catalogs and deployment remain separate operations.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.