Repository navigation
Conversation
…r & TLA+ barriers
… vec-mat/MMA GEMM
…bitonic MoE fusion
…TP & graph executor
…logit parity tests
…SPLIT_ROW, ffma16)
…led multi-Q prefill FA)
…sum/ssm/mnorm fusions)
…-instr prefill GEMM)
…n DRM submit - Add in-place steady-state CDM graph replay (toggleable via GGML_AGX_NO_REPLAY=1) with atomic bo_epoch / record_gen invalidation: cuts steady-state cpu_encode from 2.62 ms -> 0.000 ms on decode steps. - Bake arg_bo hi32 + precomputed launch header words into agx_ioto_template, expand fast cache 64 -> 256 slots, and inline 44B launch+barrier emission (2.8x faster cold encode). - Track completed_timeline for ASAHI_BARRIER_NONE on synchronous submits and add shared-BO VM status mirror fallback (drm_oh 0.54 ms -> 0.141 ms).
… MMA (8.48 TFLOPS) - Introduce 6-op branchless min(raw, fma(raw, 2h, -1h)) SWAR2 E2M1 decoder and overflow-proof Q8_0 magic-bias norm decoder in dequant_supertile.glsl. - Upgrade nvfp4_vecmat.comp & mxfp8_q8_vecmat.comp for M=1..8 (8 rows/WG K_SGS=4, ffma16): NVFP4 M=1 rises 374.40 -> 473.91-482.30 GB/s; Q8_0 LM head 515.78 GB/s. - Switch agx_mma_gemm.comp TILE_MODE=0 to 4x1 TILE_K=32 split-phase software pipelining on double-buffered 0-bank-conflict sh_x: NVFP4/Q8_0 M=512 MMA rises from 6.76 / 7.23 -> 8.48 / 8.29 TFLOPS (cos=1.0000000, 0:0 spills).
…V & MoE SWAR2 - Upgrade fused_full_flash_decode.comp PASS_MODE=3 (M>=16, BQ=32) and add 2-SG D-split PASS_MODE=4 (M=2..15, BQ=8, 64 GPR32, 0:0 spills across F32/F16/Q8_0 KV) using hardware FP16 8x8 coopmat with FP32 online softmax. - Upgrade Q8_0 KV decode in fused_full_flash_decode.comp & fused_swa_ring_attn.comp to magic-bias f16vec2/f16vec4 dequantization (0 spills, 1,561/1,561 FLASH_ATTN_EXT). - Upgrade fused_moe_gate_up_situ_down.comp PASS_STAGE=0/1/4 to 6-op SWAR2 + 2x K-unroll prefetch (64 GPR32 / 892 instrs direct, 60 GPR32 / 972 instrs gemm32, 515/515 MUL_MAT_ID PASS).
… & micro-op fusions - Add exact ASAP VA-dependency wave scheduler (RAW/WAR/WAW + internal scratch, toggleable via GGML_AGX_NO_WAVE_SCHED=1): cuts B=1 STRONG_USC barriers 3,408 -> 2,039 (-40.2%). - Add GGML_TYPE_Q8_0 support to SET_ROWS (55/55 PASS; enables -ctk q8_0 -ctv q8_0 with 0 CPU splits) and bit-exact fused prep_norm_fwht_store (192/tok). - Fuse full_shortconv (192/tok), rel_bias_gather (48/tok), router_topk_norm (48/tok), mix_attn backward-absorb, and strided CONT inputs: cuts B=1 dispatches 4,239 -> 2,806 (-33.8%) at cos=1.00000000 vs unfused AGX0.
…fline tests - Audit PASS_MODE=3/4 F16 & Q8_0 KV flash attention and BATCH_M=8 NVFP4/Q8_0 vecmat kernels in test_agx_shaderdb_all (43/43 PASS, 0:0 spills). - Add M=8 NVFP4 (2304x2304) and Q8_0 LM head (2304x201024) cases to test_agx_gemm_roofline (10/10 PASS).
…akernel hook & TLA+ spec
…mat (254 GB/s) & 9.38 TFLOPS MMA
… M=2..8 bucket & Flash-Attn prefill
…m_pad in dspark_scratch_bo
… f32matmad8x8 (GGML_AGX_W61_ATTNIN_MMA=1)
…mpt-copy proposer
…..8) + auto_barrier
…pped prefetch + tail-first overlap + M>=4 gate
…roposer entry threshold to 8-gram
…/step GRP+RED+AUTO_BARRIER win)
…dditive-KV planner fix
…additive KV shift
…, -0.62ms/step 32k, bit-exact, GGML_AGX_W62_MOE=1)
…_rounds>=12, p_hat<0.20, 1.10x)
…mpty-draft diagnostics
…ing in --dspark-replay
…ubatches (GGML_AGX_SPLIT_MULTI_SEQ_SPEC=1)
… 64) Handle non-empty build_rs states_extra copies (n_rs > n_seqs, up to 7 extra slots) inside the 48-pass Inkling-2 megakernel so multi-slot (-np >= 2) single-sequence ubatches and split speculative batches hit the megakernel instead of falling back to the generic graph. Uses a lazily allocated 2-slot ping-pong BO (~1.07 MiB) with zero new shaders and zero extra barriers: - Phase A (start of visit v): k_w4_gather_f32 gathers r_l[il] rows from s_copy[n_seqs..n_rs-1] into slot (v & 1), overlapping with attn_in and draining at attn_in's STRONG_USC barrier before qkv_prep/hm3/hm4 mutate r_l[il] (WAR-safe even under cell swaps or rollback-slot gathers). - Phase B (after hm4 in visit v): k_copy_f32 scatters slot (v & 1) to states_extra_dst_va (disjoint rows of r_l[il]), overlapping with visit v+1's attn_in on slot ((v+1) & 1) and draining before lm_head/graph exit. Gated behind GGML_AGX_W64_STATES_EXTRA (default ON; set 0 to disable).
…decode is_large_pp previously scanned the first 64 cgraph nodes for any GGML_OP_GET_ROWS (src1->ne[0] > 8) or GGML_OP_MUL_MAT (src1->ne[1] > 8), which falsely triggered on non-token ops (e.g. rel_bias/rel_pos) on multi-slot / large-ctx graphs and bypassed agx_inkling2_try_execute(). Restrict is_large_pp detection to GGML_OP_GET_ROWS on token_embd.weight (src1->ne[0] > 8). Restores Inkling-2 target megakernel on -np 2 with states_extra: 2-slot combined throughput jumps 37.99 -> 55.35 t/s (+45.7%), 1-slot jumps 47.9 -> 60.8 t/s.
Mirror the target megakernel's GGML_TENSOR_FLAG_COMPUTE == 0 guard in agx_i2_discover_dspark_draft_cgraph() so unselected ggml_build_forward_select top_k sampler chains (e.g. inactive slots on -np 2 or adaptive n_draft < n_max) do not collide on row 0 and force DSpark onto the generic graph. On -np 2 llama-server: 1-slot decode jumps 60.77 -> 95.66 t/s (+57.4%), 2-slot combined decode jumps 55.35 -> 62.28 t/s (pure decode sum 70.34 t/s).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ggml-agx: Bare-Metal Apple Silicon AGX3 (drm_asahi+ CDM + Borealis) Backend forllama.cppA six-pillar bare-metal compute backend targeting Apple Silicon AGX3 (
G16C B1/ M4 Max, 40 cores, 4 clusters x 10 cores, 1578 MHz,auroradrm_asahi, HAL200/G17P CDM + Borealis JIT compiler,coopmat=1) with first-class support for Inkling 2 Mini (looped 48-pass MoE, 128 experts top-8, NVFP4 + Q8_0 + BF16 + F32, hybrid SWA/Full attention, shortconv, FWHT, SITU) and DSpark speculative decoding.Architecture (Six Pillars)
drm_asahi+ HAL200/G17P CDM + Borealis (agx-drm,agx-cdm,agx-compiler,ggml-agx.cpp)DRM_IOCTL_ASAHI_SUBMITCDM command stream submission with zero-encode steady-state CDM graph replay (GGML_AGX_NO_REPLAY=1toggle, atomicbo_epoch/record_geninvalidation ->cpu_encode = 0.000 ms,drm_oh = 0.141 ms), 256-slot Fibonacci fast cache, bakedarg_bohi32 + precomputed G17P launch headers (32.5 ns/dispatch cold encode), 40-bit USC executable Ioto arena (AGX_BO_EXEC), SLC cache policy separation (SLC_STREAMvsSLC_PINvsDEVICE_LOCAL), 32 MiB auto-flushing arg ring, persistent timeline syncobj withASAHI_BARRIER_NONEon retired synchronous submits, and zero-split offload (AGX0+AGX0_Repack).shaderdb0:0spill &<= 96GPR32 auditing.agx-repack,agx-gemm,kernels/{dequant_supertile,nvfp4_vecmat,mxfp8_q8_vecmat,agx_mma_gemm})NVFP4_32x16andQ8_0_8BLKsupertile repacking with 6-op branchlessmin(raw, fma(raw, 2h, -1h))SWAR2E2M1 -> f16vec2and overflow-proofQ8_0magic-bias decoding, fullF32/F16/BF16/Q8_0/NVFP4/MXFP8support.M <= 8vecmat(482.30 GB/sNVFP4,517.68 GB/sQ8_0 LM head) and4x1TILE_K=32split-phase software-pipelined 8x8simdgroup_matrix(coopmat=1) prefill GEMM on double-buffered 0-bank-conflictsh_x(8.48 / 8.29 TFLOPSNVFP4/Q8_0).Q8_0SET_ROWS, Inkling 2 Mini DAG Fusion & DSpark MTP (agx-inkling2,agx-graph-exec,kernels/{fused_ctrl_gates_sram,fused_loop_prep_qkv_conv,fused_softcap_argmax,dspark_mtp})GGML_AGX_NO_WAVE_SCHED=1): cuts B=1STRONG_USCbarriers3,408 -> 2,039(-40.2%) and dispatches4,239 -> 2,806(-33.8%) withcos = 1.00000000vs unfusedAGX0.GGML_TYPE_Q8_0SET_ROWSsupport (enabling-ctk q8_0 -ctv q8_0with 0 CPU splits!) + 13gallocr-safe DAG fusions (prep_norm_fwht_store,full_shortconv,rel_bias_gather,router_topk_norm,LLM_FFN_SITU,SOFTCAP,control()13-op DAG,mix()depth-mix attention,moe_wsum,RMS_NORM*w,ADD->SCALE,SIGMOID->MUL,L2_CLIP, plusGGML_OP_ARANGE).coopmatFlash Attention (agx-kv-hybrid,kernels/{fused_swa_ring_attn,fused_full_flash_decode})GGML_OP_FLASH_ATTN_EXTwithF16/F32/BF16/Q8_0KV (magic-biasQ8_0KV decode, 0 spills), GQA, causal/SWA masks, logit softcapping, learned attention sinks, Flash-Decoding split-KV reduction,PASS_MODE=3(BQ=32, 8x8coopmatprefill), and 2-SG D-splitPASS_MODE=4(BQ=8,64 GPR32,0:0spills across F32/F16/Q8_0 KV).agx-moe,kernels/{moe_bitonic_bucket,fused_moe_gate_up_situ_down})M=1roofline fastpath (PASS_STAGE=4: 64 rows/WG, 64 GPR32,892instrs, 6-op SWAR2 + 2x K-unroll prefetch) and 4x1TILE_K=32hoisted prefill MoE GEMM (PASS_STAGE=2/3: 60 GPR32,972instrs, 4.99 KB SRAM) + zero-CPU-round-trip bitonic bucketing & sparse skip-zero acrossNVFP4,Q8_0,BF16,F16, andF32.formal/AgxBarrier.{tla,cfg})AGX_BARRIER_NONE,WEAK_WFI,STRONG_USC,MEMORY_HOST) and 40-WG SLC-pinned sense-reversing atomic barriers.Verification Gate Summary (Apple M4 Max,
G16C B1, 40c AGX3,aurora 1.0.0, 0 GPU Faults)-DGGML_AGX=ON)0warnings inggml-agxtargets)AgxBarrier.tla)shaderdbAudit (test_agx_shaderdb_all)0:0spills across 100%, max 95 GPR32 (<= 96cap;fused_full_flash_dspark64 GPR32 across F32/F16/Q8_0,fused_moe_direct64 GPR32 / 892 instrs,fused_moe_gemm3260 GPR32 / 972 instrs)test-backend-ops test -b AGX0SET_ROWS55/55 (incl.Q8_0),MUL_MAT627/627,MUL_MAT_ID515/515,FLASH_ATTN_EXT1,561/1,561 (100.00% PASS, 0 GPU faults; full suite 6,832/6,832)AGX0:cos = 1.00000000,rmse = 0.000608,max_abs = 0.0037; vs Pure CPU FP32: 0 NaN / 0 Inf,cos = 0.99965592(matching unfused FP16coopmat0.99965642),top1 = 3/3 (100%),top5 = 5/5-ctk q8_0 -ctv q8_0KV)splits = 1/1), exact coherent"The capital of France is Paris."on both F16 and Q8_0 KVdspark-Inkling-2-Mini-Q8_0.gguf)"Paris is the capital of France."(12.7 t/s, Wave 4 target:M=8MoE/vecmat ->75+ t/s)Measured M4 Max Hardware Roofline (
AGX0, Bare-Metaldrm_asahi+ CDM)Raw Silicon & Barrier Microbenchmarks (
test_agx_roofline)256 MiB,SLC_STREAM)16 MiBx 8,SLC_PIN)simdgroup_matrixMMA0:0spillsCDM STRONG_USCvsELIDEDPillar 2 Repacked Kernel Roofline & Numerical Parity (
test_agx_gemm_roofline, Wave 3)cosine_simQ8_0_8BLKLM Head (2304 x 201024, M=1)514.09 GB/s0.952 ms, 94.8% peak)1.0000000Q8_0_8BLK(2304 x 3072, M=1)442.95 GB/s1.0000000NVFP4_32x16(2304 x 65536, M=1)374.40 GB/s+28.8%, 88.3% peak)0.9999999NVFP4_32x16(2304 x 2304, M=5)1,671.9 GFLOP/s0.115 ms)0.9999999NVFP4_32x164x1TILE_K=32MMA (2304 x 2304, M=512)6.76 TFLOPS0.641 ms,+25.4%)1.0000000Q8_0_8BLK4x1TILE_K=32MMA (2304 x 2304, M=512)7.23 TFLOPS0.656 ms,+14.7%)1.0000000llama-benchProgression (Inkling-2-Mini-UD-Q4_K_XL.gguf, 26.07B MoE, 48 Loop Layers, 0 CPU Splits,-r 3)f3c4e3cab)cf1cdb121)1a0a25872)d7ea93e3c)pp128135.22 ± 0.03 t/s207.32 ± 0.14 t/s215.10 ± 4.04 t/s253.66 ± 5.30 t/s252.00 ± 5.24 t/spp512232.73 ± 0.26 t/s328.21 ± 0.28 t/s349.74 ± 1.13 t/s403.83 ± 1.40 t/s399.87 ± 1.52 t/spp2048349.36 ± 0.27 t/stg324.82 ± 0.00 t/s24.67 ± 0.18 t/s27.19 ± 0.20 t/s32.89 ± 1.11 t/s32.46 ± 0.80 t/stg1284.82 ± 0.00 t/s24.65 ± 0.04 t/s27.30 ± 0.05 t/s34.13 ± 0.33 t/s33.58 ± 0.31 t/sWave 4 Verified Scoreboard (
92cbea69f) — Overtakes Vulkan S24 B=1 by 1.66x!Key Wave 4 Breakthroughs (
d7ea93e3c..92cbea69f):a574a85ab): Static 8 MiBAGX_BO_SLC_PINactivation arena + 128B sense-reversing barrier BO, TLC-verifiedformal/AgxMegakernelW4.{tla,cfg}, megakernel interception hook (GGML_AGX_NO_MEGAKERNEL=1fallback, dual-path CDM replay), andAGX0_Repackzero-size probe fix (16,340.95 MiB, 193 model tensors now live onAGX0_Repack+AGX_BO_SLC_STREAM!).2305e521e): Load-time vertical weight coalescing (W_attn_inQ8_0_8BLK, Theorem W4.1) +agx_gemm_dispatch_raw_q8_0, double-buffered XOR-swizzledM=2..8vec-mat (Q8_0 M=8:136 -> 254.10 GB/s,NVFP4 M=5/8:49 -> 134.81 / 105.10 GB/s), and transposed-RowMajordirect-epilogueagx_mma_gemm(NVFP4 M=512:8.48 -> 9.38 TFLOPS,Q8_0 M=512:8.29 -> 8.79 TFLOPS).be09b327f): Fused 2-stageM=1MoE (PASS_STAGE=5/6:gate_up + scale2 + SiTU -> SLC -> down + scale2 + wsum, 2 dispatches + 1 barrier), deduplicatedBATCH_CAP=4+gemm32M=2..8MoE, andPASS_MODE=3single-readsh_epmask cache + splitP*VFlash-Attention.a10bd8783): 48-passagx-inkling2megakernel engine on staticSLC_PINarena (auto-discovery +W_attn_incoalescing + fusedqkv_prep_store+ vectorizedstage_prepSTAGE_MODE=0..7+ fusedK=64loop controllers +exp_probs_b.bias+ per-expert NVFP4scale2) cutting B=1 dispatches2,806 -> 871(-69.0%) andSTRONG_USCbarriers2,039 -> 700(-65.7%), plus 40-core DSpark Markov head accelerator (25.1 ms -> 4.56 ms, 5.5x faster!).92cbea69f): 68/68 Borealis AGX3Bshaderdbaudit (0:0spills across 100% of kernels, max92GPR32 <= 96) and live unaliased step-1 logit tracer.AGX0,-r 3, 0 GPU Faults)d7ea93e3c)92cbea69f)-DGGML_AGX=ON)0warnings0warningsshaderdbAudit43/43PASS68/68PASS (0:0spills, max92GPR32)test-backend-ops -b AGX0100%SET_ROWS55/55,MUL_MAT627/627,MUL_MAT_ID515/515,FLASH_ATTN_EXT1,561/1,561cos=0.99966cos=0.99998294(0.99999997on Pass-8); MK vs Pure CPU:cos=0.99961749,0NaN/Inf,top1=3/3,top5=5/5Q8_0/NVFP4M=1Roofline517.7 / 482.3 GB/s511.8–516.4/471.0–475.4 GB/s450+ GB/sQ8_0/NVFP4M=5..8Roofline136 / 49 GB/s254.10/134.81 (M=5) / 105.10 (M=8) GB/s+87%/+114%NVFP4/Q8_0M=512MMA8.48 / 8.29 TFLOPS9.38/8.74–8.79 TFLOPS(cos=1.0000000)11–14 TFLOPS+10.6%/+6.0%tg128F16 KV (llama-bench -r 3)34.13 ± 0.33 t/s63.79 ± 0.54 t/s(tg32 = 63.02 ± 1.87 t/s)38.43 t/s+86.9%vs W3 /1.66xVulkan /13.23xbaseline!tg128Q8_0KV (-ctk q8_0 -ctv q8_0)33.58 ± 0.31 t/s62.53 ± 0.53 t/s(tg32 = 61.52 ± 1.84 t/s)+86.2%vs W3pp128/pp512/pp2048F16 KV (-r 3)253.7 / 403.8 / 349.4363.95/500.53/418.40 t/s(Q8 KV:362.3 / 495.6 / 414.2)1,093 t/s(pp2048)+43.5%/+23.9%/+19.8%-md -c 4096 -n 128,"Capital of France")12.7 t/s43.0 t/s(draft25.1 -> 4.56 ms, verify196 -> 42.0 ms,"Paris.")~79 t/s3.39xvs W3Wave 5 Verified Scoreboard (
f083af0d7) — Breaks 70+ t/s B=1 (1.83x Vulkan S24), 10.12 TFLOPSQ8_0MMA, 552 t/spp512, 497 t/spp2048, 95/95shaderdb!Key Wave 5 Breakthroughs (
92cbea69f..f083af0d7):de5110f01): TLC-verifiedformal/AgxPersistentW5.{tla,cfg}modeling 128B non-coherent USC L1 dirty-line ownership (NoUscFalseSharing), exact 48-pass arena liveness + DSparklayer_inp_devexport (DsparkExportFresh), and persistent 40-WGSENSE_BARRIERdeadlock-freedom.0fd787678):sh_w-staged64N × 64Mcooperative-dequant prefill MMA (TILE_MODE=0,68GPR32,0:0spills,9.5 KBSRAM =3WGs/core ->10.12 TFLOPSQ8_0/9.90 TFLOPSNVFP4) and native8×8M=2..8MMA (TILE_MODE=3/4, software-pipelinedWprefetch ->393.5–397.3 GB/sQ8_0 M=8(+55%) and135.0–135.5 GB/sNVFP4 M=8(+28.9%)).3dc10238e):matQ[16]-pinnedRowMajorPASS_MODE=3Flash-Attention prefill (8.00 KBSRAM =4WGs/core,0:0spills ->2.22xfasterFLASH_ATTN_EXT), transposedRowMajor+ direct-epiloguePASS_STAGE=2/3Bucketed-MMA MoE (5.5 KBSRAM =6WGs/core,68GPR32), and single-passBATCH_CAP=8+ lean 1-super-tilesh_xM=2..8MoE verify (42.0 -> 33.8 ms).a3a2de82d): Lean44–64GPR32 40-WGSENSE_BARRIERhybrid B=1 super-stages (agx_inkling2_attn_in_b1.comp,agx_inkling2_hybrid_b1.comp, opt-in full-persistentagx_inkling2_persist_b1.compdown to14disp /13STRONG_USC), collapsing steady-state B=1 dispatches871 -> 341(-60.8%) andSTRONG_USCbarriers700 -> 340(-51.4%) (gpu = 13.57–13.67 ms,70.37–70.66 t/s); fixed DSparkM=4l_out-4megakernel discovery (disp: 4,019 -> 971,46.8–49.8 t/ssustained); liftedagx-graph-exec.cpp:4997rel_bias_gathern_kv <= n_extent + 1cap (pp2048452 -> 497.0 t/s,+18.8%vs W4); added Lean-mirrored 128Bstatic_asserts and fail-loudAGX0_Repack/exp_probs_b/scale2guardrails.f083af0d7): Expanded Borealis AGX3Bshaderdbaudit to 95/95 kernels (100%0:0spills,<= 96GPR32).AGX0,-r 3, 0 GPU Faults)92cbea69f)f083af0d7)-DGGML_AGX=ON)0warnings0warningsshaderdbAudit68/68PASS95/95PASS (0:0spills, max96GPR32)test-backend-ops -b AGX02,758/2,758SET_ROWS55/55,MUL_MAT627/627,MUL_MAT_ID515/515,FLASH_ATTN_EXT1,561/1,5612.22xFA)test_agx_diff_logits)cos=0.999983cos=0.99999999(3st) /0.99999998(4st,max_abs=0.00731); MK vs CPU:cos=0.99971726,0NaN/Inf,top1=4/4,top5=5/5Q8_0/NVFP4M=8Roofline254.1 / 105.1 GB/s393.5–397.3/135.0–135.5 GB/s(cos=1.0000000)+55%/+28.9%Q8_0/NVFP4M=512MMA8.79 / 9.38 TFLOPS10.12/9.90 TFLOPS(0.537 / 0.549 ms,68GPR32,cos=1.0000000)11–14 TFLOPS+15.1%/+5.5%tg128F16 KV (llama-bench -r 3)63.79 ± 0.54 t/s70.37 ± 0.68 t/s(tg32 = 67.88 ± 1.73 t/s, peak70.66)38.43 t/s+10.3%vs W4 /1.83xVulkan /14.6xbaseline!tg128Q8_0KV (-ctk q8_0 -ctv q8_0)62.53 ± 0.53 t/s69.40 ± 0.77 t/s(tg32 = 67.16 ± 1.69 t/s)+11.0%vs W4pp128/pp512/pp2048F16 KV (-r 3)363.95 / 500.53 / 418.40385.42/552.62/497.00 t/s(Q8 KV:382.7 / 545.8 / 491.9)1,093 t/s(pp2048)+5.9%/+10.4%/+18.8%-md -c 4096)43.0 t/s(31.4long)47.9–49.8 t/s("Paris.",verify=33.8 ms,971disp) /46.8 t/ssustained (-n 256,3.05tok/step!)~79 t/s+15%short /+49%sustained!Wave 6 Verified Scoreboard (
71a594dd0) — Breaks 614 t/spp512, 551 t/spp2048, 74.1 t/s DSpark"Paris.", 70.61 t/s B=1, 10.17 TFLOPSQ8_0MMA, 100/100shaderdb!Key Wave 6 Breakthroughs (
f083af0d7..71a594dd0):9e61b0438): Software-pipelinedW-onlyuvec2prefetch + direct epilogue store (nosh_y) + unbranchedactive_im==4uin64N×32MBucketed-MMA MoE (8,064 B = 4 WGs/core,60–64GPR32,0:0spills), trimmeds0/s1m_cnt==1live regs (-530ins,-0.62 mson DSparkM=4), and lean 128T lockstep L1DX-sharings5/s6(64/68GPR32,0barriers /0 BSRAM ons5, deferred UE4M3 scales ->70.61 t/sF16 /69.54 t/sQ8_0 B=1).e57017654): Full 22-opITEM_FUSED_MOEprefill fusion (48/48MoE blocks fused) + non-adjacent DAGITEM_MIX_ATTNmatching (119–120/120hits), cutting prefill dispatches3,413 -> 2,543(-870) andSTRONG_USCbarriers2,357 -> 1,610(-747), plus 5 zero-dividevec4/uvec40-ULP fastpaths (bin_op,CONCAT(dim=1),CPY/CONT/DUP, multi-querymix_attn, 4-widerel_bias_gather) ->pp512 = 613.96 t/s(+11.1%) &pp2048 = 551.03 t/s(+10.9%).6cae349f8): LeanM=2..440-WGSENSE_BARRIERDSpark verify hybrid super-stages (HYBRID_MODE=3/4, 4 explicit scalar accumulatorsa0..a3,22.9–38.0 KiB,64–80GPR32,0:0spills,M=1untouched), cutting DSparkM=4verify dispatches971 -> 609(-362) andSTRONG_USCbarriers748 -> 436(-312) -> verify[REPLAY]33.77 -> 30.87–31.46 ms("Paris."74.1 t/s;-n 256sustained verify med37.27 -> 33.48 ms,-10.2%).7d5b05bdd): RoutedM=2..4dense GEMMs off 50%-padded8×8MMA to upgradedf16vec2vec-mat (Q8_0X_ALIGNED4=1+W-prefetch + adaptiveWG_SGS=4/8at64GPR32;NVFP4directf16vec4 sh_x+ fusedf16vec2FMA at72GPR32),shared f16vec4 sh_wTILE_MODE=3/4(Q8_0 M=8 = 404.23 GB/s), andT=0X_ALIGNED4=1(68GPR32 ->10.17 / 9.93 TFLOPSQ8_0 / NVFP4M=512).71a594dd0): Expanded Borealis AGX3Bshaderdbaudit to 100/100 kernels (100%0:0spills,<= 96GPR32) and verified 3,292/3,292test-backend-opsacross 12 ops.AGX0,-r 3, 0 GPU Faults)f083af0d7)71a594dd0)-DGGML_AGX=ON)0warnings0warningsshaderdbAudit95/95PASS100/100PASS (0:0spills, max96GPR32)test-backend-ops -b AGX02,758/2,758(4 ops)3,292/3,292PASS (12 ops:SET_ROWS55,MUL_MAT627,MUL_MAT_ID515,FLASH_ATTN_EXT1,561,ADD/SUB/MUL/DIV/CONCAT/CPY/CONT/DUP534)test_agx_diff_logits)MK vs NOMK 0.99999998cos=0.99994109(top1=4/4); MK vs CPU (3st):cos=0.99960118(TRUE-NOMK vs CPU 0.99972759,top1=3/3,0NaN/Inf)Q8_0/NVFP4M=1Roofline513 / 471 GB/s515.10/470.86 GB/s(cos=1.0000000)450+ GB/sQ8_0/NVFP4M=8Roofline393.5 / 135.0 GB/s404.23(6.01 TFLOPS) /136.30 GB/s(cos=1.0000000)+2.7%/+1.0%Q8_0/NVFP4M=512MMA10.12 / 9.90 TFLOPS10.17/9.93 TFLOPS(0.534 / 0.547 ms,68GPR32,cos=1.0000000)11–14 TFLOPStg128F16 KV (llama-bench -r 3)70.37 ± 0.68 t/s70.61 ± 0.70 t/s(tg32 = 68.06 ± 1.66 t/s,[REPLAY #1] = 13.644 ms)38.43 t/s1.84xVulkan /14.65xbaseline!tg128Q8_0KV (-ctk q8_0 -ctv q8_0)69.40 ± 0.77 t/s69.54 ± 0.63 t/s(tg32 = 67.13 ± 1.62 t/s)pp128/pp512/pp2048F16 KV (-r 3)385.4 / 552.6 / 497.0417.44/613.96/551.03 t/s(Q8 KV:413.5/609.1/547.5)1,093 t/s(pp2048)+8.3%/+11.1%/+10.9%!-md -c 4096)47.9–49.8(ver 33.8 ms,971disp)74.1 t/s("Paris.",ver 30.87–31.46 ms,609disp /436strong_usc) /46.1–49.0 t/s(-n 256,ver med 33.48 msvs37.27,drf 4.76 ms)~79 t/s-362disp /-10.2%verify ms!Wave 64 (
244ea9a98..7eab29bd9) — Multi-Slot (-np 2) Megakernel + DSpark Support244ea9a98):GGML_AGX_SPLIT_MULTI_SEQ_SPEC=1(default ON) insrc/llama-batch.cppsplitsn_keep_tail > 0 && n_seqs > 1ubatches into 1-seq ubatches so concurrent speculative decoding slots hit the megakernel cleanly.build_rsstates_extrain Inkling-2 megakernel (fbeb1cfd4): Lazily allocates a 2-slot ping-pong BO (~1.07 MiB, 0 new shaders, 0 extra barriers;GGML_AGX_W64_STATES_EXTRA=1, up to 7 extra slots) to gathers_copy[n_seqs..n_rs-1]beforeattn_in'sSTRONG_USCbarrier and scatter to disjointr_l[il]rows afterhm4.is_large_ppdecode fix (9f6312bd9): Restrictedis_large_ppinggml-agx.cpptoGGML_OP_GET_ROWSontoken_embd.weight(ne[0] > 8) so non-token ops (rel_bias/rel_pos) no longer falsely skipagx_inkling2_try_execute().7eab29bd9): AddedGGML_TENSOR_FLAG_COMPUTE == 0guard inagx_i2_discover_dspark_draft_cgraph()so inactiveggml_build_forward_selecttop_kchains on-np >= 2/ adaptiven_draft < n_maxdo not reject the DSpark megakernel.-np 2:8080(NVFP4-15G + Q8_0 KV + DSparkn=7adaptive)7eab29bd947.9 t/s95.66 t/s37.99/41.2 t/s62.28/70.34 t/spisessions (concurrent,7–12Kctx)~35 t/s~85 t/scombined (40.9 + 44.5 t/s)piturns (8–15Kctx)~38–50 t/s80–109 t/s(29.1 ms/step)Iterating Locally on
m4-nixosBuild tree:
/home/astaff/llama/llama-ggml-agx(launcher:/home/astaff/llama/inkling-server, symlinked at~/.local/bin/inkling-server).Diagnostic env vars (temporary drop-in at
~/.config/systemd/user/qwen-server.service.d/debug.conf, thensystemctl --user daemon-reload && systemctl --user restart qwen-server.service):GGML_AGX_MK_DEBUG=1— log megakernel hits andMK DISCOVER FAIL/DSPARK MK DISCOVER FAILreasons.GGML_AGX_STATS=1— per-submit GPU/CPU encode ms, dispatch and barrier counts.GGML_AGX_W64_STATES_EXTRA=0/GGML_AGX_SPLIT_MULTI_SEQ_SPEC=0— A/B toggles for Wave 64 features.Standalone parity test (stop
qwen-server.servicefirst to stay under the31.12 GiBper-client GEM limit):