Skip to content

Releases

Qwegn v0.48.2

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 05 Dec 21:32

Patch release delivering HyperStream & speculative-decoding performance optimizations across Apple Silicon M1–M6 (0-ULP deferred GDN state replay, 128-GPR HC/AQ/MoE specialization unlocked on both M5+ and M1/M2, 0 B-spill HQ4_G32 GEMV across M1–M6, Apple9 96-GPR tier + Metal 3.2 QSA simdgroup_half8x8 MMA + 65K two-stage radix top-K, pipelined greedy DFlash-2 + on-device GPU PLE hashing), offline qwg export-taps with canonical tap == numLayers capture, .pkg SHVQ LUT bundling, FC 242 MoE softcap deduplication, and Wave P1–P2 host/loader/door-planner convergence.

Performance Gains (5-Sample Paired Interleaved A/B, --kv-mode q4 --no-profile, 0 Steady Allocs)

Native Apple M5 Max (40-Core Apple10 NAX, 128 GiB UMA) — Pre-Wave 2 Baseline (c81fca67) vs v0.48.2

Model / Workload Baseline v0.48.2 Paired Ratio (±MAD) Gain SHA-256 Parity
Qwen4-35B-A3B-QWP_4 (code_edit, d=3 hybrid, --strict) 206.99 tok/s 324.43 tok/s 1.608× ±0.052 +60.8% Exact
Qwen4-35B-A3B-QWP_4 (code_edit, w=8 ngram, --strict) 206.79 tok/s 318.13 tok/s 1.564× ±0.016 +56.4% Exact
Qwen4-35B-A3B-QWP_4 (code_edit, d=0 serial, --strict) 108.69 tok/s 136.12 tok/s 1.235× ±0.026 +23.5% Exact
Qwen4-35B-A3B-QWP_4 (novel, d=3 hybrid) 127.95 tok/s 165.37 tok/s 1.287× ±0.025 +28.7% 1-ULP tie*
Qwen3.8-Flash-Next-QWP-Mixed + DFlash-2 (w=8 k=16) 62.08 tok/s 94.98 tok/s 1.533× ±0.012 +53.3% Exact
Qwen3.8-Flash-Next-QWP-Mixed + DFlash-2 (w=8 k=1) 61.13 tok/s 93.29 tok/s 1.520× ±0.029 +52.0% Exact
Qwen3.8-27B-QWP_4 + DFlash-2 (w=8 k=1) 55.98 tok/s 61.28 tok/s 1.082× ±0.065 +8.2% Exact
GigaChat4-37B-A4B-QWP_4 + DFlash-2 (w=8 k=1) 90.69 tok/s 96.18 tok/s 1.074× ±0.098 +7.4% Exact
Qwen3.8-Flash-Next-QWP-Mixed (d=1 ngram, M=2 HQ4_G32 fix) 89.21 tok/s 89.38 tok/s 1.015× ±0.0003 +1.5% Exact

Qwen4-35B-A3B-QWP_4 r=8 verify GPU latency dropped from ~30.1 ms (pre-Wave 2) to 19.01 ms med (Wave 2) and 17.61 ms med (17.33 ms min) in v0.48.2 (+6.58% ±1.03% Wave 2 to Wave 3 direct gain on d=3 hybrid to 343.31 tok/s, and 339.05 tok/s post-M1/M2 non-regression check 1.0042× ±0.0058). novel reflects a single 1-ULP FP32 tie-break between simd_sum (fast1_body) and simd_shuffle_xor (mr_body).

Apple M1/M2 (.staticM1M2, Simulated applegpu_g13g + kernel_m3.metallib, --strict) — 128-GPR Unlock & HQ4_G32 Zero-Spill

Model / Workload Pre-Fix (.staticM1M2 on lowGPR) v0.48.2 (128-GPR + 0 B HQ4_G32) Paired Ratio (±MAD) Gain SHA-256 Parity
Qwen4-35B-A3B-QWP_4 (code_edit, w=8 ngram) 179.78 tok/s 293.36 tok/s 1.701× ±0.006 +70.1% Exact
Qwen4-35B-A3B-QWP_4 (code_edit, d=3 hybrid) 197.98 tok/s 329.84 tok/s 1.671× ±0.008 +67.1% Exact
Qwen4-35B-A3B-QWP_4 (code_edit, d=0 serial) 99.35 tok/s 122.16 tok/s 1.237× ±0.016 +23.7% Exact

Offline metal-tt on applegpu_g13g/applegpu_g14s also verified 0 B inner-loop stack spills across qwg_gemv_q4g_f32_v4 (#m2: 128r/176sp -> 72r/0sp, #m4: 128r/192sp -> 104r/0sp), _am#m4 (128r/160sp -> 100r/0sp), and _am2 (128r/160sp -> 68r/0sp).

Added

  • HyperStream 0-ULP Deferred GDN State Replay (qwgdn_f32.metal, QWGDNF32.swift, FNGPUWeights.swift, FNGPUScratch+Budget.swift, FNGPULayer.swift, FNGPUDecodeStack.swift, FNGPUSession.swift, FNPrefixCache*.swift, FNGPUBatchScheduler.swift, Scripts/agx_codegen_ceilings.json, Qwen4Wave2ParityTests.swift):
    • Eliminated intermediate [VH, DK, DK] GDN state-ring DRAM writes during 2..8-row speculative verification (503 MB -> 63 MB on Qwen4-35B-A3B at r=8, 0 B AGX stack spill across M1–M6, qwg_gdn_recurrent_rows_f32 ceiling 93 -> 96 in same 96-GPR granule) by logging only per-row (k, delta, exp(g)) rank-1 vectors into a double-buffered 2×12-row replay log and writing S_end once.
    • On partial draft rejection, rollbackVerifyRows tracks the accepted log prefix for exact 0-ULP (#pragma clang fp contract(off) reassociate(off)) in-register replay on the next step, fusing T=1 drain, single-S_mid bank flips when pending + (T - 1) > 12, and explicit R=0 materialization before T>8 prefill, prefix-cache save, and FNGPUBatchScheduler slot sync (+6.58% ±1.03% on Qwen4 d=3 hybrid vs Wave 2, r=8 GPU median 19.01 -> 17.61 ms / min 17.33 ms, 100% SHA-256 bit-exact across Qwen4 & Flash-Next).
  • Qwen4 / HyperStream Wave 2 Speculative & Multi-Row Verify Unblock (qwhc_aq.metal, qw_dequant_multi_b.metalh, qw_dequant_f32.metalh, qw_gemm_f32_common.metalh, qw_moe_f32_common.metalh, qw_moe_compact_hq_aq.metal, qwple.metal, qwdflash_capture.metal, QWGemmF32.swift, QWGemmMoE+CompactQWP.swift, QWMoEOperator.swift, FNGPUHCEncoders.swift, FNGPUPLEEncoders.swift, FNGPUScratch+Budget.swift, FNGPUHead.swift, FNGPUDecodeStack.swift, FNGPUPrefillStack.swift, FNGPUDFlash.swift, QWDFlashDrafter*.swift, DriverPrefill.swift, DriverDecode.swift, MTPVerification.swift, QwgExportTaps.swift, Scripts/agx_codegen_ceilings.json, Scripts/kernel_inventory.json, Qwen4Wave2ParityTests.swift):
    • 128-GPR (!QW_LOW_GPR) Fast HC Mixers, AQ GEMV, and MoE Specialization: Restored zero-barrier in-register qwg_hc_{norm_down_inject,up_mix_h32}_aq_f32_fast1_body (grid.y = rows single-dispatch for rows = 1..8 on .gpr128Max, 4.4× faster HC at T = 8), fast ActSlice AQ GEMV (m1), parallel single-x-load 4-row AQ GEMV (m4), and register-resident ActSlice #m1 MoE paths on !QW_LOW_GPR, while preserving 0 B-spill QW_LOW_GPR paths across M1–M6 (g13g–g17s + M6).
    • Concurrent <= 4-Row f32_v4 / f32_v4_am Chunking & Direct CompactQWP Grid: Chunked rows > 4 in encodeHQ4F32V4 and encodeHQ4F32V4Argmax into concurrent <= 4-row zero-spill #m4/#m2/#m1 passes (removing redundant rows4_m8 helpers), replaced same-encoder dispatchThreadgroups(indirectBuffer:) in QWGemmMoE+CompactQWP.swift with direct upper-bounded host grids (min(experts, pairs)), tightened canCompactQWP .f32 dnAcc checks, and fixed FNGPUScratch.MemoryBudget qsaVerifyLayers to include DFlash.
    • Pipelined Greedy DFlash & On-Device GPU PLE Hashing: Added qwg_ple_ngram_row_ids on-device 64-bit n-gram hashing (bit-exact with CPU writeRowIds, zero host PLE waits when GPU-resident while preserving --stream-ngrams SSD overlap), fused greedy unconstrained DFlash proposal (encodePropose) + verify across pipelined [0, 1, 8, 40] decodeCuts (forwardRowsFusedWithDFlash, zero host wait between DFlash and verify), tiled qwg_dflash_capture_{target,hc}_hidden across 256 threads/TG ([[threads_per_threadgroup]]), and trimmed redundant pre/post capture barriers.
    • Canonical tap == numLayers Capture: Widened QWTapCaptureSink, QWDFlashDrafter, and qwg export-taps --layers to 0...layerBound, capturing FNGPUHead.mixedHidden (post-hyper_connection_mixer) on QWHyperStreamRuntime (encodeMixerOnly / encodeCaptureMixedTaps) and post-finalNorm ln1/normalized on QWEngineDriver uniformly with QWInkling2Runtime without altering existing 0..<numLayers drafters.
  • Qwen4 / HyperStream Wave 1 Spill Elimination & 65K QSA Two-Stage Radix Top-K (qw_dequant_f32.metalh, qwdflash.metal, qwqsa.metal, qwrouter.metal, QWQSACacheState.swift, QWQSAEncoders.swift, FNGPULayer.swift, FNGPULayer+Batch.swift, FNGPUScratch+Budget.swift, FNGPUHead.swift, FNGPUDFlash.swift, Scripts/agx_codegen_ceilings.json, Scripts/kernel_inventory.json, QWKernelInventory.swift, Qwen4Wave1ParityTests.swift):
    • Stacked Wave 1 improvements atop perf/m4-hyperstream-decode (df606b38): eliminated remaining offline metal-tt stack spills in #m4 qwg_gemv_q4g_f32_v4 (336–752 -> 0 B on g15g–g17s) and _am, and qwg_dflash_rmsnorm (80 -> 0 B), and unioned qwrouter.metal QWRUnionScratch (6164 -> 5960 B tgmem).
    • Added dynamic tgmem on qwg_qsa_scores (16384 -> 0 B static) + 2-stage 8-partition register-resident radix top-K (qwg_qsa_topk_part_radix & qwg_qsa_topk_merge_radix, 32–37r/0sp across M1–M5).
    • Removed the redundant GDN inProjBA/qkv buffer barrier in FNGPULayer.swift, wired fused FNGPUHead encodeFnHCNormDownInjectDecode(..., hc: 0), and enabled skipGreedyLogits on greedy unconstrained DFlash verify (FNGPUDFlash.swift).
  • Banner PLE Residency Telemetry (FNPLEBackingMode, FNGPUPLEEncoders.swift, QWEngineReport.swift, QWHyperStreamRuntime*.swift, QWModelBackend.swift, QWHardwareInfo.swift, QWHardwareInfoTests.swift): Surfaced the resolved PLE backing mode (GPU shared (UMA zero-copy), CPU mmap stream, or CPU pread stream) and GPU byte footprint in the headless QWServer startup banner via pleResidencyNote whenever PLE layers are present.
  • Wave P1.1 HAL Intrinsics & M6 AGX Codegen Coverage (QWHal.swift, QWHal+Diagnostics.swift, Scripts/check_metallib_target.py, QWHALTests.swift): Added QWRegisterBudgetTier (.staticM1M2, .gpr96Pro via applegpu_g17p, .gpr128Max), QWDeviceCaps.architectureName (with QW_SIMULATE_GPU_ARCH override), QWDeviceCaps.slcBudgetBytes(forGPUCores:) (6/12/24/48 MiB tiers), architecture-keyed referenceBandwidth (applegpu_g17s fallback-safe), fallbackGPUCores = 16, arch=... regTier=... slcMiB=... PSO diagnostic header fields, and optional M6_AGX_ARCHS (applegpu_g18{g,p,s,d} at 27.0) offline codegen validation.
  • **Apple9 (M3/M4) ...
Read more

Qwegn v0.48.1

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 04 Dec 21:27

Patch release adding automatic poisoned MTLCommandQueue fault recovery and QW_CMD_BUFFER_DIAG=1 encoder diagnostics across QWHyperStreamRuntime, QWEngineDriver (DriverBatchDecode, QWStandardTrunkExecutor, MTP guard fallbacks), speculative drafters (DFlash/DSpine, ECHO, DSpark, QWMTPDraftChain), and QWInkling2Runtime, wiring 128 GiB HyperStream prefill scratch eviction and PLE live-memory admission, deferring streaming HTTP 200 OK headers with atomic QWSSESession.cancelPreStartIfUnstarted() pre-start cancellation so prefill failures return HTTP JSON errors (with named mid-stream event: error frames without trailing data: [DONE]), filtering server auto-discovery through supported primary models (QWServerConfigurationResolver.swift), restoring HyperStream ple: true layer-kind validation, unifying hybrid HQ8_G32 onto interleaved Block_AQ8_G32 with fail-loud planar rejection, enforcing the macOS 26.2 NAX runtime OS floor with dynamic HCA SLC chunking, and completing Wave P0 architecture/code hygiene.

Changed

  • Wave P0 Architecture & Code Hygiene (QWHead.swift, QWHead+BF16.swift, QWLayerKernel.swift, QWGemmF32.swift, QWMTPBatchedMLP.swift): Removed all 8 throw-only HyperStreamPLELayerKernelBase stubs (QWQSALayerKernels.swift), collapsed QWHeadWeight into typealias QWHeadWeight = QWWeightView, cleaned the dead || true expression in QWGemmF32.selectDenseSGBm (preserving the v0.47.0 DIRECT_STORE BM=64 default), and removed the redundant !weight.isSHVQ / minSimdRows branch in QWMTPBatchedMLP.encodeProjection.

Fixed

  • Server Auto-Discovery Supported-Model Filter (QWServerConfigurationResolver.swift): Filtered fallback model discovery through $0.supported using the configured modelsDir so alphabetically earlier DFlash2/DSpine drafter packs or unsupported folders cannot hijack primary-model auto-discovery.
  • HyperStream ple: true Layer-Kind Validation (QWHyperStreamRuntime.swift, QWLayerKernel.swift): Replaced QWLayerKernelRegistry.resolve(plan:) in QWHyperStreamRuntime.init with QWHyperStreamRuntime.validateLayerKinds(plan:) after commit 394b4c02 removed unused ple: true stubs from QWLayerKernelRegistry, restoring model loading for PLE-equipped packs (Qwen3.8-Flash-Next, Qwen4-35B-A3B) while keeping (ple=...) explicit in missing-kernel errors.
  • Command-Queue Poison Recovery, QW_CMD_BUFFER_DIAG=1, HyperStream 128 GiB Scratch Eviction & Deferred SSE Error Framing (QWHal+CommandQueueRecovery.swift, QWHal.swift, QWHyperStreamRuntime.swift, QWHyperStreamRuntime+Seam.swift, FNGPUDecodeStack.swift, FNGPUPrefillStack.swift, FNGPUBatchScheduler+Drive.swift, QWEngineDriver.swift, DriverDiagnostics.swift, DriverDecode.swift, DriverPrefill.swift, DriverBatchDecode.swift, QWStandardTrunkExecutor.swift, MTPVerification*.swift, QWDFlashDrafter*.swift, QWDSparkDrafter*.swift, QWEchoDraftEncoder.swift, QWMTPDraftChain.swift, QWInkling2*.swift, QWSSESession.swift, QWHttpServer+{ChatCompletions,Completions,Anthropic,Responses,OllamaChat,OllamaGenerate}.swift, FNGPUPLEEncoders.swift, QWQSAEncoders.swift, FNGPUHCEncoders.swift, check_metallib_target.py):
    • Detected MTLCommandBufferErrorDomain / IOGPUCommandQueueErrorDomain queue faults across QWHyperStreamRuntime, QWEngineDriver (DriverBatchDecode, QWStandardTrunkExecutor, async/MTP verification commits and guard fallbacks, DriverDecisionEval, QWActivationTracer, weight conversion), speculative drafters (DFlash/DSpine, ECHO, DSpark, QWMTPDraftChain), and QWInkling2Runtime (including Wavefront, DSpark, DFlash, Echo, and prefix-cache paths), automatically replacing poisoned MTLCommandQueue instances, re-priming residency, enabling MTLCommandBufferDescriptor.errorOptions = .encoderExecutionStatus diagnostics (QW_CMD_BUFFER_DIAG=1 or post-fault via hal.makeCommandBuffer(retained:)), preserving underlying Metal error domains across async/drafter boundaries, and invalidating stale session/KV state so later requests recover instead of failing in ~3 ms.
    • Wired QWPrefillScratchEvictionPolicy.shouldEvict(wiredEngineBytes:) (>= 75% UMA ceiling on 128 GiB hosts) into QWHyperStreamRuntime (--evict-prefill-scratch auto) instead of hardcoding ramGB <= 36.5, and forwarded osReserveGiB + QWLiveDeviceMemorySnapshotSource into FNGPUPLETable admission.
    • Deferred streaming HTTP/1.1 200 OK headers and initial role/message_start/response.created chunks in QWSSESession.armDeferredBegin until first token emission or keepalive firing, added atomic QWSSESession.cancelPreStartIfUnstarted() to prevent pre-start keepalive races so prefill failures return HTTP 500/400 JSON errors, and updated QWSSESession.finishWithOpenAIError to emit named event: error frames without trailing data: [DONE].
    • Routed additional HyperStream PLE/HC/QSA 256-thread dispatches through dispatchCheckedThreadgroups/dispatchCheckedThreads and added core HyperStream QSA/PLE/HC kernels to CRITICAL_KERNELS in Scripts/check_metallib_target.py (applegpu_g13g–g16s).
  • Hybrid HQ8_G32 Convergence & Fail-Loud Planar Rejection (Scripts/quantize/pack.py, QWAdmission.swift, QWQuantTypes.swift, QWCheckpointTensorLoader.swift, QWRuntimeDoorPlanner+Quant.swift): Unified pack.py --hybrid-hq8-from onto interleaved 36 B Block_AQ8_G32 (hq8_g32), updated QWAdmission.hybridModelResidentBytes from 34 B to 36 B per 32-element group, removed orphaned QWQuantError.hq8SwitchOff and silent QWRuntimeDoorPlanner hq8_off misrouting, and enforced explicit QWCheckpointLoaderError.unsupportedLegacyPlanarHQ8 rejection for deprecated planar hq8_off planes.
  • macOS 26.2 NAX Runtime Guard & HCA SLC Chunk Scaling (QWHal.swift, QWHCAAttnOperator+Snapshot.swift): Added QWDeviceCaps.supportsMetal4OSFloor (ProcessInfo.isOperatingSystemAtLeast(26.2.0)) gating isMetal4TensorCapable and supportsMetal4Library, and replaced the hardcoded 24 MiB SLC chunking in QWHCAAttnOperator.encodeGroupedWoA with QWGemm.naxRowChunk.

Qwegn v0.48.0

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 04 Dec 13:42

Minor release adding Day-0 Qwen4 Dense and Qwen4-MoE family support (Qwen4-35B-A3B-QWP_4), generalized GDN/QSA/Hyper-Connections/HyperPLE/YaRN mscale runtime & quantization paths across Apple Silicon M1–M5, QWHyperStreamRuntime & Metal kernel throughput optimizations, chat-template reasoning_effort / <tool_call> decoding harmonization, and M1–M5 dispatch and capability hardening.

Added

  • Day-0 Qwen4 Dense & MoE Family Support (QWModelDescriptor+Qwen4.swift, QWModelDescriptor+{Capabilities,ConfigEnvelope,Decode,Families,Hybrid}.swift, QWAdmission.swift, QWHyperStreamRuntime.swift, FNGPUWeights.swift, FNPackLoader.swift, QWQSACacheState.swift, QWQSAEncoders.swift, QWGDNF32.swift, QWRopeCPU.swift, qwattn_prep.metal, qwqsa.metal, qwgdn_f32.metal, Scripts/quantize/{pack,pack_ngram,audit_release}.py, Scripts/oracle/emit_pack_identity.py, Tests/QWFlashNextMetalTests/Qwen4Day0OracleTests.swift): Added Day-0 config decoding, capability seams, GDN output_gate_type (sigmoid/silu/swish), generalized QSA / Hyper-Connections (hc_count/hc_lowrank) / partial-layer HyperPLE (ple_layer_ids), YaRN mscale RoPE support, HyperStream memory admission pricing (HC projections, index_qk_proj, VQ2 PLE tables, indexK/pooled, and MTP KV), --stream-ngrams / --no-stream-ngrams forwarding on qwg index, --source-id provenance sanitization in pack.py, and Qwen4Day0OracleTests (QWP1 HQ4_G64 + VQ2_G32 PLE on Qwen4-35B-A3B-QWP_4 across M1–M5).

Changed

  • QWHyperStreamRuntime & Metal Kernel Throughput Optimizations (FNGPUDecodeStack.swift, QWGDNPrefill.swift, QWHyperStreamRuntime+Seam.swift, QWAdaptiveDraftPolicy.swift, FNGPUSession+Speculative.swift, FNGPUHead.swift, FNGPUMTP.swift, QWGemmF32.swift, qw_gemm_f32_common.metalh, qwhc_aq.metal): Added early GPU PLE cut flush, .concurrent GDN prefill barriers, quarter-SIMD AQ HC up-mix (nBlocks <= 8 && realHC == 4, keeping R = 512 untouched), division-free 4-way unrolled RMSNorm, optional skipping of unused full-vocab DRAM logit writes during greedy decode/verify, and calibrated sparse-MoE activeScale < 0.85 MTP acceptance priors + QWAdaptiveDraftPolicy.neuralDepthCap chain capping (with QWG_MTP_CHAIN env override), lifting Qwen4-35B-A3B-QWP_4 (d=3) to 192.89–196.48 tok/s (+5.46 tok/s max over Qwen3.6-35B-A3B-QWP_4) and improving Qwen3.8-Flash-Next-QWP-Mixed (d=3) from 84.07–85.33 to 88.98–88.99 tok/s with bit-exact parity.

Fixed

  • Chat Template enable_thinking / reasoning_effort Harmonization & Special Tool-Envelope Token Decoding (QWChatTemplate.swift, QWChatPolicyResolver.swift, QWServerSchema.swift, QWChatTurnPreparer.swift, QWEngineLifecycleActor+Chat.swift, qwg.swift, QwgReplAndServe.swift): Added structural QWChatTemplate.supportedReasoningEfforts detection and normalizeReasoningEffort(..., supportedEfforts:) mapping (e.g. "medium" → "high" for ('xhigh','high','low','off') templates) while omitting reasoning_effort when thinking is disabled, and preserved active tool-envelope special token IDs (<tool_call> / </tool_call>) in ChatStreamCapture when hasActiveTools is true.
  • M1–M5 QSA Dispatch Guards & HyperStream Fail-Closed Safety (QWQSAEncoders.swift, QWQSACacheState.swift, FNGPULayer.swift, FNGPUWeights.swift, FNPrefixCache.swift, QWHyperStreamRuntime.swift, DriverStartup.swift, QWModelCapabilities.swift, QWModelDescriptor+Qwen4.swift, Scripts/verify_m_family.sh): Added PSO threadgroup ceiling guards (effectiveMaxThreadsPerThreadgroup + dispatchCheckedThreadgroups) on qwg_index_prep, qwg_index_pool, and qwg_qsa_scores_mat, aligned NAX out16 attention output checks in FNGPULayer.swift, eliminated force-unwraps and added explicit dimension guards in FNGPUWeights.swift / QWQSACacheState.swift, resolved FNPrefixCache index head dim from recorded KV geometry, fixed computeEchoPromptLogprobs greedy logit write in QWHyperStreamRuntime.swift, rejected non-HyperStream packs declaring QSA or HyperPLE in DriverStartup.swift, exposed .ropeYaRN when yarnRopeConfig != nil in QWModelCapabilities.swift, and wired QWFlashNextMetalTests across all apple7/apple8/apple9 simulation passes in Scripts/verify_m_family.sh.

Qwegn v0.47.4

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 04 Dec 06:21

Patch release restoring M2 / Apple8 sparse-MoE NextN speculative verification throughput and B >= 2 batch coalescing via a register-resident 512-thread GDN verify kernel, fused zero-allocation verify argmax across .f16/.bf16/quantized heads with finite-logit rejection, and deterministic QWSpeculationBackoff, alongside BSD pgrep preflight and internal release runbook fixes.

Fixed

  • M2 / Apple8 Sparse-MoE NextN Batch Coalescing, 512-Thread GDN Verify Kernel, Fused Verify Argmax & Deterministic Speculative Backoff (DriverBatchDecode.swift, DriverDecode.swift, EngineSession.swift, QWEngineSessionState.swift, QWGreedyGenerationLoop.swift, QWEngineDriver+Init.swift, QWRuntimeDoorPlanner*.swift, QWGDNDecode.swift, qwgdn_decode*.{metal,metalh}, QWHead+BF16.swift, qwhead*.metal, qwgemm_shvq_dense.metal, QWVerifyWindow.swift, MTPVerification*.swift, check_metallib_target.py, kernel_inventory.json, QWKernelInventory.swift, fixes #3):
    • Kept concurrent B >= 2 sparse-MoE NextN decoding coalesced (allowsSpeculativeBatch) while keeping DFlash/DSpark MoE dropping to solo at B == 2, validated all batched head token readbacks against 0..<geometry.vocab before session/KV mutation, and gated batched greedy argmax on softcap == 0 || QWHead.supportsStage1SoftcapArgmax(headStorage).
    • Added register-resident 512-thread qwg_gdn_recurrent_rows_k4 for Apple8 speculative verification (hd == 128), sharing suffix-stability helpers in qwgdn_decode_types.metalh with 0 B spill across Apple7–Apple9 (g13g–g16s).
    • Enabled zero-logit-allocation fused verify argmax (QWHead.encodeBatchedGreedyArgmax with symmetric FWHT32 input restoration on .f16/.bf16) for unconstrained greedy rounds, rejected non-finite (NaN/±Inf) logits with -1 across batched and single-row (Q4G/AQ/SHVQ/MTP) fused GEMV argmax paths, DriverBatchDecode/EncodeKernels+HeadAndEmbed/encodeGreedyQ4g checked (rejectNonFinite: true) fallbacks, and qwg_head_argmax_fin_variational while preserving qwg_head_argmax / qwg_head_argmax_softcap IEEE totalOrder (so -Inf constraint masks keep ranking strictly below finite tokens) and preserving non-finite values across qw_head_softcap (.bf16) and qwg_head_softcap_f32, retained head_f16_* for .bf16 doors, and prewarmed batched head/argmax/_m16/SHVQ pipelines.
    • Added session-snapshotted integer-threshold QWSpeculationBackoff (neuralDraftBackoff) recording non-PLD neural acceptance on commitPreparedVerification and decrementing on serial and batched decode steps, while letting zero-cost PLD/canonical drafts run through cooldown across canRunSpeculativeRound, prepareAsyncNeuralDraft, and proposeHybridRound.
  • Preflight BSD pgrep Co-Runner Regex, Engine-Lock Detection & Internal Skill Runbooks (Scripts/preflight.sh, Scripts/test_sdlc_scripts.py, .agents/skills/{qwegine-sdlc-and-architecture,qwegine-inference-qa-and-sampling,qwegine-release}/SKILL.md): Replaced BSD-incompatible \s with [[:space:]] in Scripts/preflight.sh (detecting qwg serve/run on custom ports, xctest, and qwegn_gym training while excluding qwg-smc-helper), added live .qwg/qwg-engine.lock PID checking to --require-quiet-gpu, and updated internal SDLC, inference QA, and release skills with sibling-conversation timer coordination, three-space drafter vocabulary rules, and asynchronous gh run rerun attempt polling.

Qwegn v0.47.3

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 03 Dec 15:49

Patch release separating DFlash 2 and DSpine physical codebook rows, target sampling vocabulary, and sliced/unpadded candidate bounds across QWHyperStreamRuntime, QWEngineDriver, and QWInkling2Runtime, while hardening constrained speculative verification, stop/budget rollback, single-slot drafter batch isolation, and conv_kernel_size == 0 layer residual progression.

Fixed

  • Cross-Model DFlash 2 / DSpine Vocabulary Separation, Constrained Speculation & Multi-Slot Isolation (qwdflash_selector.metal, qwdflash_mla.metal, QWDFlashDrafter+{Capture,Propose,Stochastic,DSpine,MLA}.swift, QWDFlashConfig.swift, QWDFlashFootprint.swift, FNGPUDFlash.swift, FNGPUSession+Speculative.swift, QWHyperStreamRuntime*.swift, FNPrefixCache*.swift, FNGPUBatchScheduler+Drive.swift, MTPVerification+Hybrid.swift, QWInkling2Runtime*.swift, QWServerConfigurationResolver*.swift, QWServerLogger.swift, specs/08-agentic-speculation-and-radix-scheduling.md): Separated physical codebook rows (codebookVocab), ambient target sampling vocabulary (distributionVocab), and sliced/unpadded candidate bounds (scoreVocab) across QWDFlashDrafter, selectStochastic, selectDSpineStochastic, and qwg_dflash_selector_greedy (buffer(13)), resolving stochastic QWMTP protocol: Gumbel proposal does not match the reserved round failures under sliced draft heads (98,304 vs 248,320 on Qwen3.8-Flash-Next and QWG_DRAFT_VOCAB) and padded vocabularies (unpadded_vocab_size on Inkling-2) while preserving anchorToken >= scoreVocab codebook lookups and clamping encodeStageProp indices to physical embedTable rows; wired draftVocab and targetVocab into QWEngineDriver; enforced row-by-row QWTokenConstraint verification (greedyHead: false) on QWInkling2Runtime DFlash 2 and dynamic serial/cooldown/DSpark fallback after unconstrained <think> prefixes; enforced stopIDs and remainingMaxNew truncation with exact draft-row rollback on QWHyperStreamRuntime (FNGPUDFlash and FNGPUMTP), preserved QWMTPRandomStream stochastic verification on canonical and .ngram rounds while keeping GPU QWVariationalAcceptance fast paths on unconstrained greedy rounds, and isolated single-slot QWDFlashDrafter (sessionSlotCount: 1) from multi-slot batch prefill/decode/cache paths; wired conv_kernel_size == 0 layer residual and norm progression across GQA and non-sandwich MLA DFlash 2 drafters (mode == 3), sliced .bf16 heads in encodeSlicedHeadLogits, generalized adjustedPerTokenKVBytes from QWModelDescriptor, validated conv_kernel_size (0 or 2) and context_input_norm while lifting the 393,216 vocab cap; recorded load-phase breakdown timings on QWHyperStreamRuntime and QWInkling2Runtime; inferred mtpBackend / mtpDrafts from --dflash-draft-pack; and eliminated duplicate qwg.log writes for preformatted child lines in QWServerLogger.logChildOutputLine.

Qwegn v0.47.2

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 01 Dec 07:07

Patch release calibrating Scripts/check_metallib_target.py AGX register/spill ceilings across Xcode 26.6 (macos-26) and Xcode 27.2 toolchains while fixing an out-of-bounds uLatOut test allocation (QWMLAAttnOperatorTests), packaging all v0.47.1 cross-family Metal kernel speedups, Cognitive Vault v2 recall, and security hardening.

Fixed

  • Cross-Toolchain Xcode 26.x AGX Ceiling Calibration & Violation Aggregation (Scripts/check_metallib_target.py, Scripts/test_sdlc_scripts.py): Added detect_xcode_major() and effective_ceiling(...) so Xcode 27+ enforces exact per-kernel (temp_regs, spill_bytes, tgmem_bytes) ceilings while Xcode 26.x (macos-26 Xcode 26.6) retains exact tgmem bounds with bounded register/spill headroom (min(128, max_r + 16) regs, max(max_spill * 2, 1024) spill, resolving applegpu_g15g qwg_moe_route_decode 27r/16spill vs 26r/48spill), and collected all violations across all four passes before raising.
  • MLA NAX h32 Parity Test Allocation (Tests/QWAttnTests/QWMLAAttnOperatorTests.swift): Allocated full rows * qHeads * rank (512) instead of rows * qHeads * halfRank (256) for uLatOut in testSparseAttnNAXH32BitExactMatchesH16AcrossKVModes, eliminating intermittent kIOGPUCommandBufferCallbackErrorPageFault crashes from trailing writes past the 16 KiB VM page boundary.

Cumulative Highlights Since Previous Public Release (v0.47.0 -> v0.47.2)

  • Eliminated or shrank AGX register spills across M1–M5 Metal 3.2 & NAX/SHVQ/AQ/GDN/MLA/HCA/QSA/MBSA/Vision kernels (enforcing 0 B spill across 51+9m1 critical AGX kernels), delivering quiet-GPU simulated M2 (apple8) decode speedups of +11.81% (Qwen3.8-Flash-Next-QWP-Mixed, bit-exact), +6.84% (GigaChat4-37B-A4B-QWP_4, +2.83% prefill), +5.23% (ERNIE-5.5-Flash-Preview-QWP-Mixed-Fast, +4.37% prefill), and +2.58% (Inkling-2-Mini-QWP-Mixed-Fast, bit-exact) with 0 regressions on M5 Max and 0 steady-state allocations across all 80 measured invocations.
  • Verified 6/6 flagship llmprobe conformance at 211/211 (100%), 100% greedy token fidelity, 100.0% top-1 greedy parity (3/3 paths identical, KLD mean 0.0000–0.0007), and 0 server errors (Qwen3.6-35B-A3B, GigaChat4-37B+DFlash2, Qwen3.8-Flash-Next, ERNIE-5.5-Flash, Qwen3.8-27B+DSpine, Inkling-2-Mini).
  • Shipped Apple9 (M3/M4) Metal 3.2 kernel_m3*.metallib routing (-mmacosx-version-min=15.0), extension-agnostic Cognitive Vault v2 structural span recall + occurrences mode, Inkling-2 standalone .qwcache Cortex parity, SMC fan helper & HTTP server hardening, and CLI/MenuBar/WebUI knob parity.

Qwegn v0.47.1

Qwegn v0.47.1 Pre-release
Pre-release

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 01 Dec 06:27

Cross-family Metal kernel spill elimination and compatibility release across M1–M5 (Apple7–Apple10), alongside Universal Cognitive Vault v2 structural span recall, Inkling-2 standalone .qwcache Cortex parity, SMC/HTTP security hardening, and CLI/MenuBar/WebUI parity — verified at 211/211 (100%) llmprobe API conformance, 100% greedy token fidelity, and 100.0% top-1 agreement across 6 flagship model packs.

Verified Performance & Quality

Benchmark / Verification (master f358ee6b, quiet GPU) Baseline (4708d878 / 3e8fb74f) Candidate (f358ee6b) Gain / Parity
Qwen3.8-Flash-Next-QWP-Mixed (apple8 M2 sim, q4, 2K+64) 661.1 pre / 50.65 tok/s dec 655.6 pre / 56.18 tok/s dec +11.81% decode (1.1181× ± 0.0182, bit-exact SHA-256, 0 allocs)
GigaChat4-37B-A4B-QWP_4 (apple8 M2 sim, q4, 2K+64) 1,178.7 pre / 86.52 tok/s dec 1,211.5 pre / 92.21 tok/s dec +6.84% decode (1.0684× ± 0.0026) · +2.83% prefill (1.0283× ± 0.0050, 0 allocs)
ERNIE-5.5-Flash-Preview-QWP-Mixed-Fast (apple8 M2 sim, q4, 2K+64) 315.0 pre / 40.68 tok/s dec 331.9 pre / 43.14 tok/s dec +5.23% decode (1.0523× ± 0.0067) · +4.37% prefill (1.0437×, 0 allocs)
Inkling-2-Mini-QWP-Mixed-Fast (apple8 M2 sim, q4, 2K+64) 819.4 pre / 68.16 tok/s dec 844.5 pre / 68.81 tok/s dec +2.58% decode (1.0258× ± 0.0096, bit-exact SHA-256, 0 allocs)
Native M5 Max non-regression (GigaChat4, Inkling-2, Qwen3.8-27B) 89.62 / 70.50 / 31.61 dec 90.93 / 71.44 / 31.38 dec 0 regressions (all within 1 MAD, 0 allocs)
llmprobe 6-pack sweep (35B, GigaChat4+DF2, Flash-Next, ERNIE-5.5, 27B+DSpine, Inkling-2) 211/211 conf · 100% fid (3e8fb74f) 211/211 (100%) · 100% fid · 0 srv err 100.0% top-1 greedy parity (3/3 paths identical, KLD mean 0.0000–0.0007)

Added

  • Universal Language- & Format-Agnostic Cognitive Vault v2 Recall & Occurrences Mode (QWDocumentIngestor.swift, QWMemoryInvertedIndex.swift, QWMemorySymbolGraph.swift, QWMemorySemanticIndex.swift, QWMemoryVault.swift, QWMountedVaultSet*.swift, QWEngineLifecycleActor+VaultV2.swift, QWHttpServer+VaultV2.swift, QWMCPTools+CognitiveAndVault.swift, QwgIndex.swift): Added extension-agnostic structural span segmentation (extractStructuralSpans), persisted "QWGIDX01" span-level Okapi BM25 + exact-identifier + decompounded inverted index (span_index.qidx), universal indented declaration parsing (7,357 AST declarations across 971 files including 3,468 Swift funcs), 24 KiB head/mid/tail e-means sampling, multi-span dense .qvec chunking, query/declaration-centered windowing, non-destructive screening with default fast local-only mode on trusted packs (saving rerank: true for explicit model reranking), and mode: "occurrences" + path_prefixes / exclude_paths filters on qwg_vault_query and /v1/memory/query (raising 32-query code recall from 14/32 to 30/32, eliminating 3/32 zero-hit drop-outs, reducing #L1 blind header truncation from 75% to 6.8%, and cutting 32-query replay time from 35.0 s to 5.43 s).
  • Standalone .qwcache Cortex Parity on QWInkling2Runtime (QWInkling2PrefixCache+Save.swift, QWInkling2Runtime+TrunkConformance.swift, QWInkling2Forward.swift, specs/08-agentic-speculation-and-radix-scheduling.md): Implemented atomic 0o600 binary .qwcache (QWGINK2C) export, validation (geometryDigestV3Hex, kvMode, sliding window, visitKVs, DSpark/DFlash/LSA state), and shared-base pinning (buildStandalonePrefixCache, mountStandalonePrefixCache, and unmountSharedBasePrefixes() via removeSharedBaseEntries()), extending standalone .qwcache Cortex support across all three generative runtimes.

Security

  • Privileged SMC Fan Helper Hardening (QWSMCHelperManager.swift, QWSMCHelperProtocol.swift, QwgFanHelper.swift): Removed unverified CommandLine.arguments.first elevation fallbacks, enforced non-writable regular-file + parent checks (S_ISREG, (st_mode & 0o022) == 0) and SecStaticCodeCheckValidity team-ID / UID validation before admin elevation or system daemon installation, restricted default allowedUIDs == nil Unix-socket peer auth to uid 0, geteuid(), or the active console user (SCDynamicStoreCopyConsoleUser), scoped umask(0o117) around bind, and replaced blocking single-client socket reads with a 250 ms poll budget so the 15 s watchdog cannot be starved.
  • HTTP Server Containment, DNS-Rebinding, Redirect & Log Hardening (QWHttpServer+Routes.swift, QWHttpServer.swift, QWHttpSecuritySupport.swift, QWHttpIncrementalParser.swift, QWServerLogger.swift, QWModelPullService.swift, QWCli+PullAndQuantize.swift, QWUpdateDownloader.swift, QWEpisodicTranscriptStore.swift, QWHttpServer+Cognitive.swift, QWImageDecodePolicy.swift): Enforced registered pack-path containment (validateRegisteredPackPath) on decisionModelPackPath and dflashDraftPackPath in POST /v1/settings; restricted logDir updates to loopback peers with sensitive credential-directory exclusions; created server log files with 0o600 (O_CLOEXEC); added loopback Host header validation (isLoopbackHostHeader, bracketed IPv6-safe) on unauthenticated loopback listeners; tightened HTTP/1.x request-line parsing; enforced .ephemeral URLSessions with willPerformHTTPRedirection host allowlisting across Hub, CLI pull, and Updater downloads; capped QWEpisodicTranscriptStore / shadow route JSONL logs at 16 MiB with Darwin.lstat regular-file checks, O_CLOEXEC | O_NOFOLLOW 0o600 appends, and limit clamped to 1...100; tightened QWImageDecodePolicy + QWPinnedHTTPResponseParser against ASCII control scalars and colonless/whitespace header smuggling with monotonic headerScanOffset; scoped QWDFlashDrafter+SafeTensors buffer reads outside GPU waits; converted manual .lock()/.unlock() in async/concurrent paths (PrefixCache, QWHttpServer, QWEngineLifecycleActor, QWCli+PullAndQuantize, QWModelBackend, QWSMCClient, QWSystemMetricsSampler) to lock.withLock; and synchronized mutable state inside QWChatStreamParser, StreamBlockState, and StreamLogprobBox.

Performance

  • Apple10 M5-Family Wave 3 Spill Elimination in MLA DFlash 2, AQ GDN in_proj & Compact SHVQ Decode (qwdflash_mla.metal, qwgemm_aq_gdn.metal, qw_moe_compact_shvq_fast.metalh, Scripts/check_metallib_target.py): Unrolled 4u chunk/RoPE loops with half4 context tile registers in qwg_dflash_mla_attn (89r/464B -> 103r/0B on g17g/g17s/g17d, 91r/464B -> 96r/32B on g17p, 96r/496B -> 104r/0B on g13g); replaced 8 row/group pointers with base + stride offsets and 4-row mBase chunking in qwg_gemv_aq_gdn_inproj_rows4_m_body (aq3: 126r/528B -> 107r/0B on g17g/g17s/g17d, 96r/608B -> 96r/48B on g17p; aq4: 160B -> 64B); wired slice_dot_rows4_m1_acc into QW_AQ_SINGLE_ROW qwg_moe_compact_shvq_gateup_impl (shvq15_g64_gateup#srow: 96r/32B -> 80r/0B on g17p, 102r -> 84r on g17g/g17s; shvq4_g32_gateup#srow: 96r/32B -> 61r/0B on g17p, 99r -> 62r on g17g/g17s, 112r -> 60r on g13g); tightened M5_CODEGEN_CEILINGS, M5_SINGLE_ROW_KERNELS, and M1_CODEGEN_CEILINGS in Scripts/check_metallib_target.py; and verified on idle M5 Max via quiet-GPU paired interleaved ABBA across 8/8 runs (100% bit-exact SHA-256, 0 steady allocs, 0 regressions, GigaChat4-37B-A4B-DFlash2 decode 121.41 -> 124.71 tok/s +2.71% / +16.67 MAD, ERNIE-5.5-Flash prefill 1424.4 -> 1442.8 tok/s +1.25% / +2.05 MAD).
  • Apple10 M5-Family (M5 / M5 Pro / M5 Max / M5 Ultra) Kernel Spill Elimination, Occupancy-Aware NAX BM Sizing & 4× G17 Codegen Gates (qwattn_decode_general.metal, qwgdn_prefill.metal, qwdspine.metal, qwgemm_shvq_mlp_gdn.metal, qwgemm_aq_mlp.metal, qw_dequant_multi_b.metalh, qw_quant_traits*.metalh, qw_moe_f32_common.metalh, QWGemmF32.swift, QWGemmAQ.swift, EncodeKernels.swift, QWDFlashDrafter+Quant.swift, QWGemmM2M3UltraTests.swift, Scripts/check_metallib_target.py): Zeroed or cut M5-family (applegpu_g17g/g17p/g17s/g17d) per-thread stack spills across qwg_decode_combine_general_row (32 B -> 0 B via #pragma unroll + half4 packing), qwg_gdn_prefill_solve (1,296 B -> 528 B via threadgroup decay tables within 9,344 B TG mem), qwdspine (464–752 B -> 0 B, <= 94 regs via 4-candidate chunking + streamed x reads), SHVQ/AQ silu_pair & rows4_m decode (0 B spill on g17g/s/d, streamed w=0..3 using raw FP16 step-scaled qwg_shvq_unpack_oct8_tg<15>), and MoE gateup_f32_r1_body (16 B -> 0 B on g17p single-row, 544 B -> 48 B multi-row via has_streamed_rows4() + hoisted QW_AQ_SINGLE_ROW); added QWGemm.selectDenseNAXBm (BM=32 when nTiles * ceil(rows/64) < gpuCores) across all 5 NAX dense dispatchers; added M5_AGX_ARCHS (g17g/g17p/g17s at 26.2, optional g17d at 27.0), M5_CODEGEN_CEILINGS, and 96-GPR M5_SINGLE_ROW_KERNELS (FC 238=True) gates in Scripts/check_metallib_target.py; and verified on idle M5 Max via quiet-GPU paired interleaved ABBA (7/7 causal LM packs 100% bit-exact SHA-256, 0 steady allocs, 0 regressions, GigaChat4 decode 99.77 -> 101.2 tok/s +0.84% / +6.70 MAD, Qwen3.8-27B-DSpine prefill +2.10% / +2.93 MAD).

Fixed

  • **Zero-Spill Vision Flash Attention, M1–M4 QSA Split-K & MBSA Metal 3.2 MMA Prefill (qwvision.metal, qwattn_sparse.metal, qwattn_sparse_nax.metal, qwattn_mbsa_mma.metal, QWQSAEncoders.swift, QWQSACacheState.swift, QWMBSAAttnOperator.swift, QWNaxKernelRegistry.swift, Scripts/nax_kernels.json, QWKernelInventory.swift, `Scri...
Read more

Qwegn v0.47.0

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 29 Nov 18:51

Delivers major cross-family Apple Silicon (M1–M6) performance breakthroughs — double-buffered cross-layer cold MoE prefill prefetch (2.10× on M1 Pro 16 GB, +29–32% cold on M5 Max) with 1024-row cold chunks, 16–32 GB adaptive UMA auto-sizing (2.4×–2.7× out-of-the-box cold MoE decode), zero-spill Metal 3.2 MMA prefill attention/MLA/HCA & qwg_moe_route, BM=64 dense SG prefill GEMMs, rows2 decode tier (M2/M3 Max & UltraFusion), #m1 AQ/SHVQ/MoE PSO specialization, and 16 KiB packed SHVQ4 LUT — alongside strictly-offline WebUI Mermaid diagrams (12 families), offline syntax highlighting, live allowedWorkspaceRoots overrides, and composer Reasoning Effort + Decision Sidecar observability.

Performance Improvements

Workload (q4 KV, paired interleaved ABBA on fresh release binaries) Baseline (v0.46.0) v0.47.0 Gain / Impact
Qwen3.6-35B-A3B-QWP_4 (M1 Pro 16 GB, cold MoE 1.6K / 3K prefill) 172.0–174.9 / 179.2–181.6 tok/s 363.6–364.4 / 327.1–336.1 tok/s 2.10× (99.1% GPU util) · 1.85× at 3K (100% SHA-256)
Qwen3.6-35B-A3B-QWP_4 & GigaChat4-37B-A4B-QWP_4 (M1 Pro 16 GB, out-of-the-box decode) 5.76 / 2.89 tok/s 15.57 / 7.00 tok/s 2.70× (+170.3%) · 2.42× (+142.2%) (Ink2 FAIL -> 13.84)
GigaChat4-37B-A4B-QWP_4 (M1 Pro 16 GB, cold MoE 1.6K prefill cumulative) 145.6–145.7 tok/s 232.0–232.4 tok/s +59.4% cumulative (+36.3% prefetch + +12.5% BM=64, 99.7% GPU)
SenseNova-Loop-9B-QWP_4 (M1 Pro 16 GB, decode / 2K / 4K prefill) 16.57 / 80.5 / 71.5 tok/s 18.87 / 100.7 / 91.1 tok/s +14.0% dec · +25.1% 2K pre · +27.4% 4K pre (3.8× attn)
Inkling-2-Mini-QWP-Mixed-Fast (M1 Pro 16 GB, matched-flag decode) 11.37–11.38 tok/s 13.79–13.84 tok/s +21.5% (88 -> 72 ms/tok, 16 KiB packed SHVQ4 LUT + #m1)
M5 Max 128 GB cold Qwen3.6 (res=96) & resident non-regression 3,909–3,932 cold · 6,260–6,313 res 4,927–5,183 cold · 6,272–6,328 res +29–32% cold · 1.00× resident parity (0.00 GiB delta, exact SHA-256)

Performance

  • Apple7–Apple9 (M1 / M2 Max / M3 / M3 Max / M3 Ultra / M4) BM=64 Dense SG Prefill GEMMs, rows2 Decode Tier, UltraFusion 48 MiB SLC Chunking, Pre-MoE skipRot32, & Zero-Spill qwg_moe_route (qw_gemm_sg.metalh, qwgemm_sg_*.metal, qwgemm.metal, qwrouter.metal, QWGemmF32.swift, QWGemmAQ.swift, EncodeKernels.swift, QWGemmM2M3UltraTests.swift, QWM2M3UltraDispatchTests.swift):
    • Upgraded dense simdgroup prefill GEMMs (qwg_gemm_*_sg, qwg_gemm_*_sg_f32, qwg_gemm_*_sg_gdn_inproj, and fused qwg_gemm_*_sg_swiglu across HQ4/AQ/SHVQ) from BM=32 (8 KiB) to BM=64 (10 KiB, DIRECT_STORE for dense/F32 and 2-phase coalesced tg.c epilogue for splitGdn/SwiGLU) with GPU-core-aware QWGemm.selectDenseSGBm (>= 2 TGs/core, scaling cleanly from 10-core M3 to 80-core M3 Ultra), halving weight DRAM reads and dequant ALU during prefill while keeping 0 B stack spill across g13g/g14s/g15g/g16s.
    • Wired the rows2 (0x8000_0000, 8 rows/TG) middle decode tier in EncodeKernels.selectIncumbentGemvRowsMode (n >= gpuCores * 48 on !isMetal4TensorCapable, M5+ untouched) and added qwg_gemv_q4g_gdn_inproj_rows2_body in qwgemm.metal, eliminating the N = 4,096 rows4 → rows1 cliff on 38-core M2 Max & 40-core M3 Max and the N = 4,096..8,192 cliff on 60–80-core M3 Ultra.
    • Added an UltraFusion gpuCores >= 56 (48 MiB / 1024-row) SLC tier in QWGemm.naxRowChunk, unlocked canSkipPreMoERot32 for M1–M4 resident MoE prefill (supportsSimdgroupMMA), and eliminated the 1,008 B (g13g/g14s) / 976 B (g15g/g16s) per-thread stack spill in qwg_moe_route (1,008 B / 976 B → 0 B, 19–20 regs) via scalar bitmasks and threadgroup scratch.
    • Verified with metal-tt (0 B spill across all 12 kernels × 4 AGX archs), MTL_DEBUG_LAYER=1 (0 errors, 0 steady allocs), and paired interleaved ABBA on fresh release binaries (100% bit-exact SHA-256 parity): on real M1 Pro 16 GB, GigaChat4-37B-A4B-QWP_4 1.6K prefill 206.5–211.4 → 232.0–232.4 tok/s (+9.9% to +12.5%, 99.7% GPU util), SenseNova-Loop-9B-QWP_4 2K prefill 92.6–92.7 → 96.3–100.7 tok/s (+4.0% to +8.7%), Qwen3.6-35B-A3B-QWP_4 1.6K GPU prefill 337.3–363.7 → 372.3–375.2 tok/s; on M5 Max 128 GB, resident Qwen3.6 (6,260–6,313 → 6,272–6,328 tok/s) and GigaChat4 (4,450–4,469 → 4,435–4,448 tok/s) confirmed 0 regression and bit-exact SHA-256 parity.
  • Generalized M1–M6 Double-Buffered Cross-Layer Cold MoE Prefill Prefetch & 1024-Row Cold Prefill Chunking (DriverColdPrefetch.swift, QWWeightAllocationPlan.swift, DriverTypes.swift, ColdExpertStreamer.swift, DriverWeightLoading*.swift, QWCommandFrame.swift, DriverResidency.swift, DriverPrefill.swift, QWMoELayerKernel.swift, QWScratchArenaBuilder.swift, QWColdPrefillPrefetchTests.swift):
    • Added a capability-gated ping-pong second cold-expert staging bank (coldE > 0 && moeLayerCount >= 2; 0 extra bytes and untouched codepaths when resident coldE == 0) with PrefillColdPrefetcher, overlapping layer k+1 NVMe cold-expert reads on a dedicated background queue behind layer k's unified single-pass tileFilter: .all MoE GEMMs + layer k+1's Attention/GDN/Router/SharedExpert command buffer while eliminating mid-layer curCB.waitUntilCompleted() stalls, split double-SiLU dispatches, and redundant per-chunk GPU-to-GPU LRU copies.
    • Promoted default cold-streaming MoE prefill chunks from 512 → 1024 rows when scratch delta <= 192 MiB and resident-expert cost <= 4 (respecting explicit user --prefill-chunk-size overrides and leaving resident models unchanged), cutting total NVMe expert passes per long prompt by up to 50%.
    • Verified via paired interleaved ABBA on fresh release binaries (0 steady allocs, 0 post-freeze PSOs, MTL_DEBUG_LAYER=1 PASS, 100% bit-exact SHA-256 parity): on real Apple M1 Pro 16 GB, Qwen3.6-35B-A3B-QWP_4 1.6K prefill 172.0–174.9 → 363.6–364.4 tok/s wall (2.10×, 99.1% GPU util) and 3K prefill 179.2–181.6 → 327.1–336.1 tok/s wall (1.85×, bit-exact vs base at 1024), GigaChat4-37B-A4B-QWP_4 1.6K prefill 157.0–159.9 → 215.7–215.9 tok/s (+36.3%, 99.8% GPU util) and 3K prefill 154.9–156.3 → 197.9–198.0 tok/s (+27.2%, 99.9% GPU util); on Apple M5 Max 128 GB, resident Qwen3.6 (6,315–6,384 → 6,379–6,444 tok/s, 21.72 GiB) and GigaChat4 (4,194–4,305 → 4,253–4,282 tok/s, 21.04 GiB) show 0.00 GiB delta and zero regression, while cold-streaming Qwen3.6 (res=96) jumps 3,909–3,932 → 4,927–5,183 tok/s (+29–32%, bit-exact with resident output).
  • Apple7–Apple9 (M1–M4) 16–32 GB Adaptive UMA Auto-Sizing, Zero-Spill MLA/HCA MMA Prefill, #m1 SHVQ/MoE Specialization & 16 KiB Packed SHVQ4 LUT (QWCapacityPlan.swift, QWResidencyAdmission.swift, DriverResidency.swift, QWScratchArenaBuilder.swift, QWInkling2Runtime+Admission.swift, qwattn_mla_mma*.metal, qwattn_hca.metal, qwgemm_shvq_*.metal, qw_dequant_shvq.metalh, qw_moe_f32_common.metalh, QWGemmAQ.swift, QWGemmMoE.swift, QWHead*.swift, QWRuntimeDoorPlanner*.swift):
    • Scaled default OS reserves and live-memory headroom on 16–32 GiB Macs (4 / 5 / 6 GiB base reserve; 6.25 / 7.5 GiB MoE reserve and 2 / 3 GiB headroom on 16 GB) while keeping >= 64 GiB defaults unchanged (8 / 16 / 24 GiB), fixing available=0.00 GiB resident-expert collapse on cold-streaming MoE packs and maxFitting=0 startup refusal on ~10 GiB resident packs on 16 GB Macs.
    • Eliminated 8,480 B per-thread stack spills across all 5 Metal 3.2 MLA/DSA/HCA simdgroup MMA prefill kernels (qwg_mla_sparse_attn_mma{,_split}, qwg_mla_dsa_sparse_attn_mma{,_split}, qwg_hca_attn_mma: 8,480 B → 0 B on applegpu_g13g) via split 1D oacc0[16]/oacc1[16] accumulators and always_inline #pragma clang loop unroll(full) helpers.
    • Extended QW_FC_AQ_SINGLE_ROW (function_constant(238), #m1) to all SHVQ GEMVs, SHVQ head argmax, and HQ4/AQ/SHVQ MoE gateup_f32_r1 & down_shared_combine_f32 decode kernels (eliminating 320–688 B MoE stack spills), and switched Metal 3.2 (__METAL_VERSION__ < 400, M1–M4 only; Metal 4 / M5+ untouched) SHVQ4 dequantization from the 32 KiB kShvqLut4DirectBits constant table to the bit-exact 16 KiB kShvqLut4PackedU8 table (0 / 16,384 bit diffs).
    • Verified on real Apple M1 Pro 16 GB (100% SHA-256 token parity, 0 post-freeze PSO misses, 0 steady allocs, MTL_DEBUG_LAYER=1 PASS, and 3K-token out-of-the-box prefill stress PASS): out-of-the-box auto-sizing Qwen3.6-35B-A3B-QWP_4 5.76 → 15.57 tok/s (+170.3% / 2.70×, 83.3% MTP accept), GigaChat4-37B-A4B-QWP_4 2.89 → 7.00 tok/s (+142.2% / 2.42×), Inkling-2-Mini-QWP-Mixed-Fast FAIL → 9.69 tok/s (mtp=3) / 13.84 tok/s (mtp=0); paired interleaved ABBA (matched flags) Inkling-2-Mini decode 11.37–11.38 → 13.79–13.84 tok/s (+21.5%, 88 → 72 ms/tok), GigaChat4 res=64 decode 6.58–6.63 → 7.01–7.02 tok/s (+6.2% wall, -14% to -16% across SHVQ4 GEMVs) and 1.6K prefill 145.6–145.7 → 149.4–149.6 tok/s (+2.7% wall / +3.2% GPU, mla.sparse_attn -23% per chunk).
  • Apple7–Apple9 (M1–M4) Zero-Spill MMA Prefill Attention & AQ4/HQ4 Decode Occupancy (qwattn_paged_mma.metal, qwattn_sink_rel_mma.metal, QWAttnPagedPrefillApply.swift, qwgemm_aq*.metal, qwgemm.metal, qw_dequant*.metalh, QWHAL, QWGemmAQ.swift, EncodeKernels.swift):
    • Eliminated 14,112 B (head_dim=256) and 7,968 B (head_dim=128 & sink_rel) per-thread stack spills across all 18 Metal 3.2 simdgroup MMA prefill kernels (14,112 B → 0 B, 7,968 B → 0 B on applegpu_g13g) via ...
Read more

Qwegn v0.46.0

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 29 Nov 05:44

Ships the unified WebUI Models Hugging Face Hub (qwegnai) with per-model download progress, parallel capability-scoped PSO prewarming (~30 s+ -> 1.51–2.04 s cold model load with 0 post-freeze misses), Apple7–Apple9 (M1–M3) threadgroup dispatch fixes (#2) and M1–M4 simdgroup prefill speedups (+3.1% to +9.3%), opt-in QW_DUMP_PSOS=1 / QW_TRACE_ACTIVATIONS=1 diagnostic tracing with bug-reporting guide and skill, standalone qwegnai/GigaChat4-37B-A4B-DFlash2-QWP_4, and standard npx skills MCP packaging.

Performance Improvements

Workload (q4 KV, paired interleaved A/B & live QWServer) Baseline (v0.45.0) v0.46.0 Gain / Impact
Cold model load (QWServer parallel prewarm, 0 post-freeze misses) ~30 s+ serial prewarm 1.51 s (27B) · 1.78 s (Ink2) · 2.04 s (GigaChat4) ~15×–20× faster load (0.01 s PSO time, 235/320/238 compiled)
Inkling-2-Mini-QWP-Mixed-Fast (M1/M2/M4 profiles, prefill & decode) 835.3–837.4 pre / 80.8 tok/s dec 911.1–914.7 tok/s pre / 88.5 tok/s dec +9.1% to +9.3% prefill (1.0907×–1.0926×) · +9.5% decode
Qwen3.8-27B-QWP_4 (M1/M2/M4 profiles, prefill) 244.9–245.0 tok/s 252.6–255.2 tok/s +3.1% to +4.2% prefill (1.0314×–1.0416×, 100% SHA-256 match)
GigaChat4-37B-A4B-QWP_4 (M1/M2/M4) & native M5 Max non-regression 1,374.3–1,385.9 / 857.4 / 3,697.9 / 2,839.4 1,376.7–1,378.9 / 856.1 / 3,692.3 / 2,851.5 tok/s 0.994×–1.004× parity · 4/4 multi-turn QWServer QA (B=4, 0 misses)

Added

  • User & Agent Diagnostic Tracing (QW_DUMP_PSOS=1, QW_TRACE_ACTIVATIONS=1) and Bug-Reporting Guide/Skill (QWHal+Diagnostics.swift, QWActivationTracer.swift, docs/reporting-bugs.md, .github/ISSUE_TEMPLATE/bug_report.md, skills/qwegn-bug-report/SKILL.md):
    • Added opt-in QW_DUMP_PSOS=1 in QWHAL to log startup device/metallib metadata and deterministic per-PSO (name, metallib, maxTPTG, effMaxTPTG, simdWidth, staticTGMem) rows across lazy and prewarmed pipelines.
    • Added opt-in QW_TRACE_ACTIVATIONS=1 (with QW_TRACE_ACTIVATIONS_STEPS and QW_TRACE_ACTIVATIONS_LAYERS filters) across QWEngineDriver (Dense/HybridMoE/GDN/mHC), QWInkling2Forward, and FNGPUSession (HyperStream) to log per-layer/per-stage (l2, min, max, nan, inf, sha256, first4) fingerprints and logits_top5 for one-round-trip cross-Mac bisection.
    • Upgraded .github/ISSUE_TEMPLATE/bug_report.md, added docs/reporting-bugs.md (with human and external AI-agent workflows, isolation matrix, sanitization rules, and mandatory confirmation gate), and packaged the installable skills/qwegn-bug-report/SKILL.md skill.
  • Pre-Release M1–M4 Cross-Target & Dispatch Hardening Gates (Scripts/check_metallib_target.py, Scripts/lint_metal_dispatches.py, Scripts/verify_m_family.sh, Makefile, Scripts/ci.sh): Added an offline applegpu_g13g / g14s / g15g / g16s (M1–M4) metallib cross-compilation and FlatBuffer __GPU_METADATA (tgmem <= 32 KiB and per-family register pressure) gate with content-addressed .build/metallib_cache stamp caching, a scope-aware dispatch_metal linter enforcing clamped*/effectiveMaxThreadsPerThreadgroup/checked dispatch guards on threadsPerThreadgroup > 256 and dynamic widths, and Scripts/verify_m_family.sh for full M1–M4 metallib + Metal debug-layer simulated 512-thread Apple8 test verification.
  • qwegnai/GigaChat4-37B-A4B-DFlash2-QWP_4 Standalone Hugging Face Release (docs/models.md): Published the standalone 456.07 MiB (632.4 M params, 6.05 bpw, 51 SHVQ4_G32 + 119 BF16 tensors) 5-layer Matrix-Absorbed MLA DFlash 2 speculative drafter pack to Hugging Face (qwegnai/GigaChat4-37B-A4B-DFlash2-QWP_4), cross-linked it from qwegnai/GigaChat4-37B-A4B-QWP_4, and updated docs/models.md.
  • WebUI Models Hugging Face Hub (qwegnai) & Per-Model Download Progress (QWCli, QWServer, QWMenuBar, /ui): Unified the WebUI Models tab (GET /v1/models/hub, POST /v1/models/pull, POST /v1/models/pull/cancel, POST /v1/models/reveal, css/models.css, js/models-hub.js) to list all available qwegnai Hugging Face repositories alongside locally installed packs; added exact pack byte sizes (QWModelDiskStats / /tree/main aggregation), host UMA fit pills, filter chips (All, Installed, Available, Drafters) and search, HF Card ↗ links, native <progress> download bars backed by a cancellable single-flight QWModelPullService reusing QWCli.pullCheckpoint, pre-flight free disk space checks (409 under 2 GiB reserve), and a live modelsDir setting (~/.qwg/models default, QWG_MODELS_DIR override) across QWServerSettings, QWSettingsCoherence, WebUI Settings, and Qwegn.app SettingsView.

Changed

  • M1–M4 (!isMetal4TensorCapable) Simdgroup Prefill Optimizations (qwgemm_sg_*, qwattn_paged_mma, qwattn_sink_rel_mma, qw_ink2_ctrl_sg_batch, QWMoEOperator, EncodeKernels):
    • Switched dense simdgroup_half8x8 GEMM, GDN in_proj, SwiGLU (QWSGDenseSwigluMem), and BF16 SG kernels/dispatchers (QWGemmFP, EncodeKernels, QWGemmF32, QWGemmAQ, QWDFlashDrafter, QWBenchKernels) from BM=64 to BM=32, BN=64 (8,192 B SRAM, 4 threadgroups/core, halved accumulator register footprint, 2× grid parallelism), with a 2-phase 8 KiB epilogue in QWSGSwigluMem for MoE BM=64.
    • Tuned Metal 3 attention prefill kernels (qwattn_paged_mma.metal + new _hd128{,_q4,_q8} kernels, qwattn_sink_rel_mma.metal) to BM=16 single-shared SRAM stages with preloaded Q / relative-bias fragments (QWAttnPagedPrefillApply, QWAttnSinkRelApply, QWAttnSinkRel+Sparse, QWRuntimeDoorPlanner), cutting attn.gqa and flashAttn latency.
    • Added batched simdgroup_half8x8 Inkling-2 loop controller kernels (qwg_ink2_ctrl_down_sg_batch and qwg_ink2_ctrl_fg_blend_sg_batch in qw_ink2_ctrl_sg_batch.metal, registered in Scripts/kernel_inventory.json and capability-gated in QWInkling2Forward / QWRuntimeDoorPlanner), cutting loopResCtrlNorm >2× on M1–M4; also generalized QWMoEOperator.encodeResident smallShNaxAct16 shared-expert path to supportsSimdgroupMMA.
  • Public-Safe Infographic & Doc Path Gate (qwegine-infographics-and-cards, Scripts/lint_style.py, Scripts/test_sdlc_scripts.py): Enforced docs/open-source-standards.md Rule S11 in Scripts/lint_style.py (make lint) using context-managed file opens to reject leaked host/operator paths across assets/, docs/, README.md, and CHANGELOG.md, and updated qwegine-infographics-and-cards with S11 public-safe naming and multi-series legend spacing rules.
  • Standard npx skills Packaging for Qwegn MCP Skills & Reorganized README.md (skills/, .agents/skills/, .claude-plugin/marketplace.json, Scripts/lint_skills.py, README.md): Flattened the 5 external developer Qwegn MCP skills (qwegn-mcp-setup, qwegn-vault, qwegn-guard, qwegn-compaction-and-episodic, qwegn-orchestrate) and skills/README.md to top-level skills/ with .claude-plugin/marketplace.json so npx skills add qwegnai/qwegn -g and Claude Code plugin marketplaces discover only the public MCP suite; marked all 9 internal contributor runbooks in .agents/skills/ with metadata.internal: "true" enforced by Scripts/lint_skills.py rule S9; updated qwegn-mcp-setup to cover both co-resident HTTP/proxy (qwg serve) and standalone stdio (qwg mcp -m d1-2B-bf16) modes; and reorganized README.md with a Table of Contents, streamlined Quick Start, server curl smoke, and Qwegn MCP + Agent Skills installation and use-case reference.

Fixed

  • M1–M6 Runtime Dispatch Guards, 64 * gqaRatio Prefill Fallbacks & qwrouter.metal Partial-SIMD Mask (QWHal+DispatchGuard.swift, QWHal.swift, QWGDN, QWAttn, QWGEMM, QWNorm, QWDFlashDrafter, QWBenchKernels, qwrouter.metal):
    • Added QWHalSimulation, MTLComputePipelineState.effectiveMaxThreadsPerThreadgroup (honoring QW_SIMULATE_MAX_TPTG and QWDeviceCaps.probe), fixed under-SIMD/non-power-of-two clamping edge cases in clampedSimdThreads and clampedPowerOfTwoThreads, and enforced fail-loud dispatchCheckedThreadgroups/dispatchCheckedThreads across GPU operators and QWBenchKernels.
    • Fixed qwg_moe_route_decode (qwrouter.metal) zero-masking out-of-range lanes before qwg_route_fwht32_f32 when IS % 256 != 0, corrected QWGDNDecode threadgroup unit clamping to max(128, headDim), added 64 * gqaRatio <= effectiveMaxThreadsPerThreadgroup guards and Apple7–9 fallback paths across QWAttnPagedPrefillApply, QWHybridLayerKernels, QWAttnSinkRelApply, QWInkling2Forward+Attn, QWMBSAAttnOperator, QWAttnDecodeApply, QWMLAAttnOperator, QWNorm+Gated, QWGemmFP+MoE, and QWDFlashDrafter+MLA, and bound non-nil dummy buffers with flag bits for optional qwgdn_conv / qwgdn_decode Metal validation under MTL_DEBUG_LAYER=1.
  • Apple7/Apple8 (M1/M2) Silent Over-Threadgroup Dispatch Drops (#2, QWHal, QWGDN, QWHead, QWGEMM, QWAttn, QWMTP): Clamped >= 512-thread dispatches to pso.maxTotalThreadsPerThreadgroup across QWGDNDecode, QWGDNF32, QWGemmMoERouter, QWGemmMoE, EncodeKernels, QWHead/QWTokenSelector, QWMTP/QWEcho/QWDSpark, and QWMLAAttnOperator, preventing Apple7/Apple8 static-register pipelines from exceeding maxTotalThreadsPerThreadgroup and silently executing 0 threads during decode and --gdn-prefill naive. Made qwg_gdn_recurrent, qwg_gdn_recurrent_batch, qwg_gdn_recurrent_rows, qwg_gdn_replay_state, qwg_gdn_rollback_rows, qwg_gdn_recurrent_f32, qwg_gdn_recurrent_rows_f32, qwg_head_argmax_fin, qwg_head_argmax_fin_variational, and qwg_mla_absorb_q[_sub2] adapt to threads_per_threadgroup with 0-UL...
Read more

Qwegn v0.45.0

Choose a tag to compare

@Andrei-cloud Andrei-cloud released this 28 Nov 14:19

Ships native GPU stochastic (T > 0) speculative MTP verification with batched Leviathan–Chen rejection sampling, fixes the Apple7–Apple9 (M1/M2/M3) LSA MTLCompilerService compiler crash and threadgroup WAR barrier races (#2), adopts the uniform QWP quantization naming convention (Law 35), and adds the GigaChat4-37B-A4B-QWP_4 12-suite peer evaluation card.

Performance Improvements

Workload (Apple M5 Max, 128 GB UMA, q4 KV, 32K ctx) Baseline (v0.44.1) v0.45.0 Gain / Impact
Qwen3.6-35B-A3B-QWP_4 (T=0.6, top_p=0.95, seed=-1, 3 drafts) 127.37 tok/s 188.61 tok/s (peak 199.96) +48.3% (1.4829× paired median, 89.6% accept, 1.90 tok/rnd)
Qwen3.8-Flash-Next-QWP-Mixed (T=0.6, --stream-ngrams, 3 drafts) 76.14 tok/s 81.92 tok/s +3.9% paired median (1.0387×, 79.50 GiB planned, 0 allocs)
Greedy T=0 non-regression (35B-A3B / 27B+DFlash2 / Flash-Next) 190.34 / 66.18 / 90.89 tok/s 186.95 / 63.93 / 90.93 tok/s (1.0028× / 1.0073× / 0.9971×) 5/5 stdout_sha256 exact match · 27/27 Law 28 QWServer QA

Added

  • Native GPU Stochastic (T > 0) MTP Speculative Pipeline & Unified Resolution (QWHead, QWMTP, QWEngine, Flash-Next): Added GPU-filtered top_k/top_p candidate collection, canonical Philox-4x32-10 sampling, and batched B = D+1 Leviathan–Chen ((p - q)^+) verification kernels in qwhead_spec_sample.metal + QWTokenSelector (Metal 3.2+, 0 B constant LUTs); unified stochastic/constrained round resolution and adaptive draft depth (QWSpeculativeRoundResolver, QWAdaptiveDraftPolicy, QWDFlashAdaptivePolicy compatibility alias) across QWEngineDriver (MTPVerification+*, QWMTPDraftEncoder, QWEchoDraftEncoder, QWMTPAdaptiveDepth, DriverConfig.decodeAndMTPScratchBytes), QWHyperStreamRuntime (Flash-Next), QWInkling2Runtime, and QWDSparkDrafter, removing synchronous per-draft waits in T > 0 speculative rounds and removing obsolete QWMTPGreedySelector.swift while preserving bit-exact T = 0 greedy parity and Law 11 timing guards.
  • qwegnai/GigaChat4-37B-A4B-QWP_4 Hugging Face Release, Model Card & 12-Suite Peer Evaluation (assets/, docs/models.md, docs/benchmarks.md, README.md): Published the performance-winning GigaChat4-37B-A4B-QWP_4 native QWP1 pack (20.34 GiB, 4.65 bpw, SHVQ4_G32) with its bundled 456.07 MiB 5-layer Matrix-Absorbed MLA DFlash 2 drafter (dflash_draft/), assets/qwegn_model_gigachat4_37b_a4b.svg, assets/qwegn_eval_35b_class_comparison.svg, and full 12-suite llmprobe (291/291 API, 100% 37/37 capability, 67/88 agentic, 70/100 Code-100, 45/92 Core-92 in 68.3K tokens, 29/50 Hard-50) plus external multi-harness (90.9% / 85.4%+ HumanEval+, 79.4% / 66.7%+ MBPP+, 87.5% IFEval, 50.0% GPQA Diamond, 66.7% MMLU-Pro, 20.0% AIME 2025, 86.7% GSM8K, 8/8 Promptfoo) peer comparison against Qwen3.6-35B-A3B-QWP_4, Apex-35B-V1.0-QWP_4, Maxwell-V1-Flash, Inkling-2-Mini-QWP-Mixed-Fast, Qwen3.8-27B-QWP_4, and Qwen3.8-Flash-Next-QWP-Mixed.

Changed

  • QWP Model Quantization Naming Convention (AGENTS.md Law 35, QWServer, QWMTP, docs/, Scripts/): Standardized qwegnai/* Hugging Face repositories and ~/.qwg/models/ packs to <Model>-QWP_{4,8,3,2,15,1} for uniform packs and <Model>-QWP-Mixed[-Fast] for mixed-precision packs, with exact plane/group recipes documented in each model card; updated QWEngineLifecycleActor.canonicalModelFamilyStem, QWDFlashConfig.stripQuantSuffixTokens, QWServerSettings.modelAffinityTokens, docs, and default script paths.
  • Apple7+ Diagnostic Messaging (EncodeKernels.swift): Updated the stale GDN in-proj batched GEMM capability error string to "GDN in-proj batched GEMM requires Apple7+ simdgroup or Apple10+ NAX hardware".

Fixed

  • Apple7–Apple9 (M1/M2/M3) LSA Metal Compiler Crash & Threadgroup WAR Races (#2, qwlsa_select.metal, check_metallib_target.py): Replaced the runtime ternary threadgroup_barrier(useSram ? ... : ...) in lsa_select_blocks_body with the compile-time constant threadgroup_barrier(mem_flags::mem_device | mem_flags::mem_threadgroup) to eliminate the MTLCompilerService @llvm.agx2.threadgroup.barrier.with.scope instruction-selection crash in qwg_lsa_select_blocks and qwg_lsa_select_finalize on Apple7–Apple9 GPUs, added the missing threadgroup_barrier(mem_flags::mem_threadgroup) WAR barriers before tid == 0 resets chosenBin = 1u; greaterAccum = 0u; after radix pass 3 and before greaterAccum += chunkTies in lsa_select_blocks_body (eliminating intermittent QWLSASelectParityTests failures), and added constant-barrier static linting plus offline metal-tt (applegpu_g13g / applegpu_g14s / applegpu_g15g) regression gates to Scripts/check_metallib_target.py.
  • Relaxed-Margin Stochastic GPU Verify, Arena Accounting & CDF Tail Guard (MTPVerification+Pipeline.swift, FNGPUSession+Speculative.swift, qwhead_spec_sample.metal): Restricted GPU Leviathan–Chen fast verification (gpuVerifyEligible) to effectiveRelaxedMargin == 0 so relaxed/variational rounds preserve readAsyncDraftProposals; cleared stale session.mtpDraft and session.mtpActive on non-sparse resync overflows in Flash-Next; guarded qw_sample_cdf_tg fallback index via the last positive-probability candidate (lastPos); and accounted for QWMTPDraftEncoder.allocationBytes inside DriverConfig.decodeAndMTPScratchBytes.