Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
3797099
Support AProjQ4 GGUFs: Q4_K dense attention projections
GiorgioOppo Jul 28, 2026
f7695ea
Metal streaming: opt-in F_NOCACHE descriptor for expert preads
GiorgioOppo Jul 28, 2026
8f5a745
Metal streaming: split expert slab preads to raise NVMe queue depth
GiorgioOppo Jul 28, 2026
cbe484b
CUDA/ROCm: dense Q4_K matmul for the AProjQ4 attention projections
GiorgioOppo Jul 28, 2026
4a7d3aa
Accelerate Q4 CUDA prefill and add GGUF requantization
GiorgioOppo Aug 6, 2026
ef227db
Optimize Q4 CUDA prefill paths
GiorgioOppo Aug 7, 2026
fd1306a
Reuse Q4 activations across QKV projections
GiorgioOppo Aug 7, 2026
cdbcde3
Optimize Metal Q4 decode and SSD streaming
GiorgioOppo Aug 7, 2026
9720179
Stabilize Q4 CUDA paths and direct GGUF requantization
GiorgioOppo Aug 8, 2026
194b801
Enable DSpark SSD streaming across GPU backends
GiorgioOppo Aug 8, 2026
c5af879
Optimize DSpark inference across GPU backends
GiorgioOppo Aug 8, 2026
c14523e
Remove DSpark scheduler
GiorgioOppo Aug 8, 2026
b6eeda5
Optimize DSpark exact verification and Q4 GPU paths
GiorgioOppo Aug 9, 2026
3a383e9
Snapshot GPU optimizations before upstream merge
GiorgioOppo Aug 9, 2026
da17afc
Optimize speculative decode and GB10 CUDA kernels
GiorgioOppo Aug 10, 2026
db331f4
cuda: optimize AProjQ4 decode on GB10
GiorgioOppo Aug 10, 2026
40fa579
Optimize DSpark verification and GB10 GPU paths
GiorgioOppo Aug 10, 2026
d89028f
cuda: preserve canonical Q4 GB10 numerics
GiorgioOppo Aug 11, 2026
fc33759
cuda: harden Q4 K1024 persistent path
GiorgioOppo Aug 11, 2026
0976f67
cuda: add opt-in canonical Q8_1 producer fold
GiorgioOppo Aug 11, 2026
5363e0b
metal: add opt-in M1 IQ2 SSD mid-only producer
GiorgioOppo Aug 11, 2026
f9535a4
metal: fix direct-RHS threadgroup memory sizing
GiorgioOppo Aug 14, 2026
41b8265
metal: merge IQ2 selected router and shared work
GiorgioOppo Aug 14, 2026
61e35e2
metal: index live IQ2 SSD cache entries
GiorgioOppo Aug 14, 2026
801be18
metal: pack routed prefill maps without losing duplicates
GiorgioOppo Aug 14, 2026
753b82f
metal: group IQ2 SSD prefill address matmuls
GiorgioOppo Aug 14, 2026
6ed2199
metal: isolate stream state and persistent exact-row cache
GiorgioOppo Aug 14, 2026
6d39838
metal: add opt-in resident Q4 session overlap
GiorgioOppo Aug 14, 2026
7bdbff7
metal: add opt-in Q4 SSD session union
GiorgioOppo Aug 14, 2026
8498c81
cuda: batch selected expert SSD uploads
GiorgioOppo Aug 14, 2026
ed1cab3
cuda: overlap selected expert I/O with shared compute
GiorgioOppo Aug 14, 2026
95c78d4
cuda: add raw fused IQ2 Q2 MoE MMQ path
GiorgioOppo Aug 14, 2026
7c5b9a3
cuda: group IQ2 SSD prefill MMQ
GiorgioOppo Aug 14, 2026
f49cc0e
cuda: model persistent expert cache planning
GiorgioOppo Aug 14, 2026
d8958e1
cuda: allocate persistent expert cache arena
GiorgioOppo Aug 14, 2026
34d365d
cuda: separate selected cache binding ownership
GiorgioOppo Aug 14, 2026
7948478
cuda: cache streaming experts persistently
GiorgioOppo Aug 14, 2026
ad6ea5f
cuda/mmq: persist grouped Q8_1 scratch
GiorgioOppo Aug 14, 2026
db41283
cuda: add bit-exact Q8 HC split experiment
GiorgioOppo Aug 14, 2026
448ce12
metal: promote IQ2 SSD grouped prefill defaults
GiorgioOppo Aug 15, 2026
377b1ae
metal: skip redundant expert readahead during prefill
GiorgioOppo Aug 17, 2026
f34265b
rocm: add dense Q4_K projection support
GiorgioOppo Aug 18, 2026
28e6a6e
rocm: add tiled Q4 prefill path
GiorgioOppo Aug 20, 2026
a7d41d4
rocm: guard Metal-only Q4 overlap policy
GiorgioOppo Aug 20, 2026
f0c70f9
rocm: default Q4 TILE8 and group attention decode
GiorgioOppo Aug 20, 2026
e3e0a7e
backend: add Metal Q4 prefill path and review fixes
GiorgioOppo Aug 20, 2026
7e802d6
Update ENVIRONMENT_VARIABLES.md
GiorgioOppo Aug 22, 2026
f94e1cf
Update ENVIRONMENT_VARIABLES.md
GiorgioOppo Aug 22, 2026
b91bb77
Update ENVIRONMENT_VARIABLES.md
GiorgioOppo Aug 22, 2026
7bd98a9
Update metal/moe.metal
GiorgioOppo Aug 22, 2026
68a8ef9
docs: document all environment variables
GiorgioOppo Aug 22, 2026
8dd4bf5
Update CONTRIBUTING.md
GiorgioOppo Aug 23, 2026
c6f02bf
Update Makefile
GiorgioOppo Aug 23, 2026
c3b29fd
Update Makefile
GiorgioOppo Aug 23, 2026
d9d1c81
Update Makefile
GiorgioOppo Aug 23, 2026
af13247
Update Makefile
GiorgioOppo Aug 23, 2026
d545a1f
Update metal/moe.metal
GiorgioOppo Aug 23, 2026
1ab8a2f
Update metal/moe.metal
GiorgioOppo Aug 23, 2026
28623a3
Update metal/moe.metal
GiorgioOppo Aug 23, 2026
0d774a9
Update metal/moe.metal
GiorgioOppo Aug 23, 2026
03b97c0
Update cuda/mmq/test/test_mmq_parity.cu
GiorgioOppo Aug 23, 2026
de2efc9
Update cuda/mmq/ds4_mmq.cu
GiorgioOppo Aug 23, 2026
0e34a59
Update cuda/mmq/ds4_mmq.cu
GiorgioOppo Aug 23, 2026
86b1f61
perf(metal): specialize fixed-shape Q8 attention output
GiorgioOppo Aug 23, 2026
2262f13
perf(metal): use gathered attention for raw-only decode
GiorgioOppo Aug 23, 2026
15985cb
bench: support SSD-streamed Metal decode comparisons
GiorgioOppo Aug 23, 2026
758a31f
docs: record M1 raw-gathered decode results
GiorgioOppo Aug 23, 2026
60770f7
perf(metal): prune unused prefill indexer queries
GiorgioOppo Aug 23, 2026
39e43d9
perf(cpu): accelerate batched Q4_K matmul
GiorgioOppo Aug 23, 2026
072cb04
perf(cuda): share Q8_1 activations across Q4_K prefill pairs
GiorgioOppo Aug 23, 2026
b82b434
perf(rocm): fuse paired Q4_K projection launches
GiorgioOppo Aug 23, 2026
dd9bfae
docs: analyze Q4_K complexity and optimization opportunities
GiorgioOppo Aug 23, 2026
51f9b9e
docs: add detailed PR 621 review summary
GiorgioOppo Aug 23, 2026
859993c
docs: refresh environment variable inventory
GiorgioOppo Aug 23, 2026
5589ac1
fix(cuda): harden MMQ review edge cases
GiorgioOppo Aug 23, 2026
f762dba
test(cuda): harden persistent Q8 parity setup
GiorgioOppo Aug 23, 2026
fdfd7df
fix(cuda): reconcile Q8 oracle allocation diagnostics
GiorgioOppo Aug 23, 2026
dee75d4
build: preserve targets across ROCm merge
GiorgioOppo Aug 23, 2026
5532f5d
docs: document ROCm MXFP4 environment controls
GiorgioOppo Aug 23, 2026
8d84bda
Update metal/moe.metal
GiorgioOppo Aug 23, 2026
59636df
metal: fuse router finalize during SSD decode
GiorgioOppo Aug 24, 2026
d24c098
chore: ignore local speed benchmark outputs
GiorgioOppo Aug 24, 2026
fffc469
docs: remove detailed PR 621 summary
GiorgioOppo Aug 24, 2026
3aa7b2d
metal: fix batched Q8 static attention output
GiorgioOppo Aug 24, 2026
ec2f27c
cuda: centralize Q8 fold registry bridge ABI
GiorgioOppo Aug 24, 2026
fcea9f4
bench: support SSD-streamed Metal A/B runs
GiorgioOppo Aug 24, 2026
b878513
metal: speed up SSD-streamed IQ2 prefill
GiorgioOppo Aug 24, 2026
33f9865
Update metal/moe.metal
GiorgioOppo Aug 24, 2026
19c1d2c
Update metal/moe.metal
GiorgioOppo Aug 24, 2026
77f41ec
Update metal/moe.metal
GiorgioOppo Aug 24, 2026
31a97a9
Update metal/moe.metal
GiorgioOppo Aug 24, 2026
0c81342
Update metal/moe.metal
GiorgioOppo Aug 24, 2026
e086800
metal: fix grouped address-MM unroll integration
GiorgioOppo Aug 24, 2026
db6db18
test(mmq): report mismatch magnitudes in the fused-raw parity case
adamlawi Aug 24, 2026
9aec14a
metal: unroll fixed simdgroup matrix loops
GiorgioOppo Aug 24, 2026
2e5db89
Merge pull request #10 from adamlawi/parity-diag-magnitudes
GiorgioOppo Aug 24, 2026
94a763d
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
654da4c
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
378f718
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
0442c93
Update cuda/mmq/test/test_mmq_parity.cu
GiorgioOppo Aug 25, 2026
ea76e2a
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
a73fe10
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
f2cdaf2
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
e80ba77
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
5ff3e2b
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
988f8d9
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
4f34ec7
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
00bf2d0
metal: fix invalid loop unroll integration
GiorgioOppo Aug 25, 2026
a1e326f
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
8e41f36
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
39bbef3
Update metal/moe.metal
GiorgioOppo Aug 25, 2026
5dced7b
indexer: add Q4_K quantization and Metal support
GiorgioOppo Aug 25, 2026
71c9fed
metal: centralize stable SiLU and repair MoE stores
GiorgioOppo Aug 25, 2026
9d3e719
metal: speed up IQ2_XXS MoE prefill
GiorgioOppo Aug 25, 2026
24ea7be
metal: share Q4_K scale metadata in exact-N prefill
GiorgioOppo Aug 25, 2026
f639f48
metal: optimize resident Q4 attention output
GiorgioOppo Aug 26, 2026
0e80b90
metal: accelerate resident Q4 attn_q_b prefill
GiorgioOppo Aug 26, 2026
3f59fcc
cuda, rocm: accelerate resident Q4 attn_q_b prefill
GiorgioOppo Aug 26, 2026
bd92e16
metal: add transient F16 q_b prefill acceleration
GiorgioOppo Aug 26, 2026
8dbfa39
cuda, rocm: add transient F16 q_b prefill acceleration
GiorgioOppo Aug 26, 2026
49acc2e
tests, docs: cover transient Q4 q_b prefill policies
GiorgioOppo Aug 26, 2026
759605f
docs: remove obsolete PR621 complexity analysis
GiorgioOppo Aug 26, 2026
a490240
perf(gpu): optimize Q4 resident prefill across backends
GiorgioOppo Aug 27, 2026
750b5fc
Optimize greedy token decode across GPU backends
GiorgioOppo Aug 27, 2026
1d3fec3
bench(metal): isolate resident Q4 decode pair kernels
GiorgioOppo Aug 27, 2026
bdf2829
fix(metal): make IQ2 LUT staging geometry-safe
GiorgioOppo Aug 27, 2026
531e5bb
perf(metal): cull inactive IQ2 prefill SIMDgroups
GiorgioOppo Aug 27, 2026
86eb835
bench(metal): isolate resident IQ2 MoE prefill
GiorgioOppo Aug 27, 2026
8f6718e
perf(rocm): add opt-in IQ2 prefill wave culling
GiorgioOppo Aug 27, 2026
5789864
bench(gpu): isolate resident IQ2 MoE prefill
GiorgioOppo Aug 27, 2026
eec016c
perf(metal): cull inactive Q4 prefill SIMDgroups
GiorgioOppo Aug 28, 2026
301b9e3
perf(rocm): gate SSD Q4 K1024 tile4 on residency
GiorgioOppo Aug 28, 2026
cd25137
bench(rocm): isolate resident Q4 prefill kernels
GiorgioOppo Aug 28, 2026
06ed164
perf(rocm): add opt-in gfx1151 WMMA prefill attention
GiorgioOppo Aug 28, 2026
0539d76
docs(rocm): document prefill experiment controls
GiorgioOppo Aug 28, 2026
841c72f
fix(cuda): gate Q4 persistent kernel on residency
GiorgioOppo Aug 28, 2026
149d1aa
bench(cuda): isolate resident Q4 prefill kernels
GiorgioOppo Aug 28, 2026
ab6486f
perf(rocm): add compressed Q4 WMMA prefill kernel
GiorgioOppo Aug 28, 2026
53d2576
bench(rocm): cover Q4 attention output WMMA
GiorgioOppo Aug 28, 2026
01ff4ee
perf(cuda): eliminate Q4 prefill output passes
GiorgioOppo Aug 28, 2026
bdd28e3
bench(cuda): isolate grouped Q4 attention prefill
GiorgioOppo Aug 28, 2026
8c1d88f
perf(metal): stream transient q_b F16 from SSD
GiorgioOppo Aug 28, 2026
6962d61
perf(metal): write small prefill attention directly
GiorgioOppo Aug 28, 2026
21d5b25
perf(metal): share q4 prefill rhs across qkv projections
GiorgioOppo Aug 29, 2026
5d2e080
perf(rocm): quantize q4 prefill rhs per wave32
GiorgioOppo Aug 29, 2026
5a7505a
perf(cuda): submit grouped q4 prefill in one grid
GiorgioOppo Aug 29, 2026
278ee38
docs: register q4 prefill kernel controls
GiorgioOppo Aug 29, 2026
6ab475b
Update rocm/ds4_rocm_attention.cuh
GiorgioOppo Aug 29, 2026
fc76152
Update rocm/ds4_rocm_attention.cuh
GiorgioOppo Aug 29, 2026
7a69780
Update rocm/ds4_rocm_attention.cuh
GiorgioOppo Aug 29, 2026
38d8ec5
Update rocm/ds4_rocm_attention.cuh
GiorgioOppo Aug 29, 2026
9ee2beb
Update rocm/ds4_rocm_indexer.cuh
GiorgioOppo Aug 29, 2026
1ca0684
Update rocm/ds4_rocm_matmul.cuh
GiorgioOppo Aug 29, 2026
4c37ac8
Update rocm/ds4_rocm_matmul.cuh
GiorgioOppo Aug 29, 2026
7ab7fb9
Update rocm/ds4_rocm_norm_rope.cuh
GiorgioOppo Aug 29, 2026
40f7681
Update rocm/ds4_rocm_q4.cuh
GiorgioOppo Aug 29, 2026
e9bf171
Update rocm/ds4_rocm_q4.cuh
GiorgioOppo Aug 29, 2026
1d42ce4
Update rocm/ds4_rocm_q4.cuh
GiorgioOppo Aug 29, 2026
ccb2cf5
Update speed-bench/.gitignore
GiorgioOppo Aug 29, 2026
1ff1e15
Update .gitignore
GiorgioOppo Aug 29, 2026
3c8fbf3
Remove dead code across inference backends
GiorgioOppo Aug 29, 2026
701d4d1
Update metal/moe.metal
GiorgioOppo Aug 29, 2026
e6ee504
Update metal/moe.metal
GiorgioOppo Aug 29, 2026
441b55f
Update metal/moe.metal
GiorgioOppo Aug 29, 2026
a01b145
Update rocm/ds4_rocm_attention.cuh
GiorgioOppo Aug 29, 2026
ac319c1
Optimize ROCm DSpark verification prefill
GiorgioOppo Aug 29, 2026
1f88ece
Optimize CUDA persistent expert planning
GiorgioOppo Aug 29, 2026
dbc4eb8
Optimize Metal IQ2 top-8 MoE prefill
GiorgioOppo Aug 29, 2026
59a174f
Fix ROCm Q4 attention and MMQ build regressions
GiorgioOppo Aug 29, 2026
6a51d69
Optimize ROCm Q4 prefill WMMA kernels
GiorgioOppo Aug 29, 2026
5dd2e3c
Optimize CUDA Q4 prefill with 16-warp MMQ
GiorgioOppo Aug 29, 2026
3504a3f
Extend CUDA Q4 16-warp MMQ with Stream-K
GiorgioOppo Aug 30, 2026
58cc2f4
Enable ROCm Q4 prefill WMMA by default
GiorgioOppo Aug 30, 2026
95f4c3c
Coalesce CUDA Q4 16-warp activation loads
GiorgioOppo Aug 30, 2026
5968837
fix(rocm): stabilize gfx1151 MMQ routing maps
kyuz0 Aug 29, 2026
58c2112
server: support fixed-length greedy decode
kyuz0 Aug 30, 2026
d29f53b
metal: optimize Q4 attention output prefill routing
GiorgioOppo Aug 30, 2026
1e0c220
rocm: restore PR887 WMMA attention scheduling
GiorgioOppo Aug 31, 2026
bc5cfc6
rocm: fix Q4 prefill parity blockers
GiorgioOppo Aug 31, 2026
377fbe5
cuda: extend Q4 16-warp to attention output B
GiorgioOppo Aug 31, 2026
9c5b5e9
Merge upstream/main into aprojq4-dense-attention
GiorgioOppo Sep 1, 2026
5c5b1d5
Fix ROCm build after upstream merge
GiorgioOppo Sep 1, 2026
555f68a
Default ROCm Q4 prefill WMMA to K64 staging
GiorgioOppo Sep 1, 2026
75503b9
Fix ROCm Q4 attention output WMMA quality drift
GiorgioOppo Sep 1, 2026
9f70fd5
Fix ROCm 10 DeepSeek Vision build
GiorgioOppo Sep 2, 2026
9a448bb
Add Metal benchmark and test binaries
GiorgioOppo Sep 2, 2026
8efbe8c
Optimize ROCm Q4 prefill with K128 staging
GiorgioOppo Sep 2, 2026
35b87dd
Enable grouped CUDA Q4 prefill on GB10
GiorgioOppo Sep 2, 2026
6a20b13
Add specialized CUDA grouped Q4 quantizer
GiorgioOppo Sep 2, 2026
6cae5b8
Merge remote-tracking branch 'upstream/main' into aprojq4-dense-atten…
GiorgioOppo Sep 3, 2026
9f005f4
rocm: fix build break from Metal-only TP/kv-norm symbols
iammac2 Sep 4, 2026
79907e0
Merge pull request #11 from iammac2/fix-rocm-tp-kvnorm-build
GiorgioOppo Sep 4, 2026
30db975
cuda: add TP flag-fold and kv-norm task fallbacks
adamlawi Sep 4, 2026
8c22d66
Merge pull request #12 from adamlawi/cuda-tp-kvnorm-stubs
GiorgioOppo Sep 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@
/tests/cuda_long_context_smoke
/tests/test_layer_pack
/tests/test_metal_session_batch
/tests/test_metal_indexer_q4
/tests/test_metal_q4_qb_f16_cache
/tests/test_metal_q4_prefill_pair
/tests/test_metal_q4_streams
/tests/test_mxfp4_cuda
/tests/test_mxfp4_dot
/tests/test_mxfp4_metal
/tests/test_q4k_dot
/tests/test_sampling
/tests/test_glm53_kda
/tests/test_quantizer_indexer_q4
/tests/test_rocm_q4_dense_pair
/tests/test_deepseek4_vision_image
*.o
*.dSYM/
Expand All @@ -41,3 +47,8 @@ __pycache__/
/misc/
.*.swp
.DS_Store

# Local speed benchmark outputs
/speed-bench/*.csv
/speed-bench/*_logprobs.json
/speed-bench/*_logits/
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ The C test runner is `ds4_test`. Running it without arguments is equivalent to
make test
```

If a change adds, renames, removes, or changes the parsing/default/effect of an
environment variable, update `scripts/environment_variables.tsv`, regenerate
the complete reference, and verify that it is current:

```sh
make environment-docs
```

Useful narrower checks:

```sh
Expand Down
1,481 changes: 1,481 additions & 0 deletions ENVIRONMENT_VARIABLES.md

Large diffs are not rendered by default.

503 changes: 476 additions & 27 deletions Makefile

Large diffs are not rendered by default.

377 changes: 374 additions & 3 deletions QA_BEFORE_RELEASES.md

Large diffs are not rendered by default.

666 changes: 656 additions & 10 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion STRIXHALO.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sudo apt-get update
sudo apt-get install -y \
hipcc rocminfo rocm-smi \
libamdhip64-dev \
libhipblas-dev libhipblaslt-dev \
libhipblas-dev \
librocblas-dev \
librocwmma-dev \
libhipcub-dev
Expand Down
19 changes: 15 additions & 4 deletions cuda/mmq/ds4_ggml_stubs.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// CUDA uses stream-ordered allocation. HIP retains stream-local allocations
// because returning live MMQ scratch to its asynchronous pool is unreliable.

#include "ds4_mmq.h"
#include "common.cuh" // pulls in ds4_ggml_stubs.h via redirect headers

#if defined(GGML_USE_HIP)
Expand All @@ -23,6 +24,20 @@
#include <mutex>
#include <vector>

/* Standalone MMQ tests do not link ds4_cuda.cu. Full ds4 links its strong,
* stream-aware registry implementation over this fail-closed weak miss. */
#if defined(__GNUC__)
extern "C" __attribute__((weak)) int ds4_cuda_q8_fold_take_q81(
const void *src, uint64_t in_dim, cudaStream_t stream,
const void **q81) {
(void)src;
(void)in_dim;
(void)stream;
if (q81) *q81 = nullptr;
return 0;
}
#endif

// ----------------------------------------------------------------------------
// Device info singleton.
//
Expand Down Expand Up @@ -133,10 +148,6 @@ extern "C" void ds4_pool_set_stream(cudaStream_t stream) {
t_ds4_pool_stream = stream;
}

extern "C" cudaStream_t ds4_pool_get_stream(void) {
return t_ds4_pool_stream;
}

namespace {

struct ds4_naive_pool : public ggml_cuda_pool {
Expand Down
Loading