[PR #12] [MERGED] GLM-5.3-Flash: GSQ-RCO 3.5-bit download, up to 16 GPUs, faster decode/prefill on one RTX 3090 #280

Closed
opened 2026-10-29 21:23:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/12
Author: @needmorevram
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @mw00

Base: main ← Head: glm-gsq-rco-3090-speed


📝 Commits (1)

  • abe3b45 GLM-5.3-Flash: GSQ-RCO 3.5-bit download, up to 16 GPUs, decode/prompt speed on one GPU

📊 Changes

25 files changed (+3263 additions, -392 deletions)

View changed files

📝 CMakeLists.txt (+5 -1)
📝 README.md (+73 -18)
📝 include/strata/core/glm_model.hpp (+24 -6)
📝 include/strata/hip_compat/cuda_runtime.h (+1 -0)
➕ include/strata/kernels/cpu/kq_avx512.hpp (+32 -0)
📝 include/strata/kernels/glm_batch.hpp (+18 -1)
📝 include/strata/kernels/glm_fast.hpp (+2 -0)
📝 include/strata/prefill/moe_mmq.hpp (+3 -0)
📝 maya.py (+372 -62)
📝 serve/server.py (+3 -0)
📝 src/core/glm_cpu_bench.cpp (+1 -1)
📝 src/core/glm_fast_path.cu (+467 -49)
📝 src/core/glm_fast_state.hpp (+28 -8)
📝 src/core/glm_model.cu (+150 -41)
📝 src/core/glm_prefill.cu (+921 -160)
➕ src/kernels/cpu/kq_avx512.cpp (+197 -0)
📝 src/kernels/cuda/glm_batch.cu (+515 -28)
📝 src/kernels/cuda/glm_fast.cu (+20 -7)
📝 src/prefill/moe_mmq.cu (+2 -0)
📝 src/program/generate.cpp (+14 -6)

...and 5 more files

📄 Description

Summary

  • GSQ-RCO 3.5-bit as a download in the setup, next to Maya-S and Maya-M.
    • Pick it in the setup's new model question, which lists the three downloads only (Maya-S, Maya-M, GSQ-RCO 3.5-bit), or pass --model GSQ-RCO-3.5bit. GGUF files already on the PC still go through --gguf-dir, as on main.
    • Source: pfeifferj/GLM-5.3-Flash-GSQ-RCO-GGUF, MIT. Only the 3.5-bit file is offered: one 137.1 GB GGUF at a pinned revision, SHA-256 verified.
    • It's a community quant made with IST-DASLab's GSQ and RCO methods: Q3_K/Q2_K experts, Q8_0 dense weights, BF16 attn_kv_a_mqa, no MTP block. This PR adds the engine support it needs.
    • Images use Maya's vision files.
  • Multi-GPU cap raised from 2 to 16 GPUs. Main splits the layers across at most two GPUs (--gpus takes a pair). This branch takes up to 16 (--gpus 0,1,..., kMaxParts = 16) and places the layer boundaries by each GPU's free VRAM.
  • Faster decode and prefill on a single 24 GB card: an RTX 3090 on PCIe 3.0 x8, with most experts in RAM.
  • ./maya.sh --calibrate (tools/calibrate_glm.py) tunes the CPU lane for the PC: the PCIe share and the thread count. CUDA only.

Rebased on main 5393fe7 (v1.0.11). Main's FP16 latent cache, its attention kernels and the AMD/HIP port are kept; details below.

Performance on one RTX 3090

GSQ-RCO 3.5-bit, max context 32,768 tokens. Each request is a fresh conversation: temperature 0, thinking off, 128-token answers.

Context (prompt tokens) Prefill (tok/s) Prefill time Decode at that context (tok/s)
47 41 1.1 s 19.1
7,797 469 16.6 s 18.7
8,449 550 15.4 s 18.9
14,807 767 19.3 s 18.7
26,641 974 27.4 s 19.0

Two earlier runs of this branch, before the last rebase, agree within 3% on prefill, with decode at 18.6–21.0 tok/s.

Prefill speeds up with length because a prompt streams every expert that isn't in VRAM over PCIe once per chunk. One chunk holds up to 31,040 tokens on a 24 GB card, so the 26.6K prompt takes one pass.

Memory (measured from /proc during the run above; 1 GiB = 2^30 bytes):

Used Notes
VRAM ~23 of 24 GiB Dense weights 8.6 GiB, state + KV for 32K context 0.9 GiB, expert pool 12.8 GiB (1,314 experts), other 0.6 GiB. During a prompt, 7.1 GiB of the pool is lent to the prompt's buffers.
RAM ~121 GiB of 177 GiB Available memory fell from 169.3 to 48.4 GiB. The engine's RSS was 121–127 GiB, including ~8 GiB of the GGUF in page cache. Main parts: the RAM tier, 114.9 GiB pinned (11,770 experts), and the disk landing ring, 1.1 GiB pinned.

The RAM tier takes the free RAM less 6 GiB (STRATA_GLM_RAM_HEADROOM_GB), up to what the experts need. Here every expert fits in VRAM + RAM (126.8 GiB), so decode doesn't touch the disk (disk 0.00 reads/tok). With less RAM the rest is read from disk and decode is slower.

Before → after (same harness and requests). "Before" is this work's starting point: the GGUF support on main 142540b, before main's FP16 cache. Main itself can't run this GGUF, because it has no BF16 attn_kv_a_mqa path.

Before After
Decode 15.3 tok/s 18.7 – 19.9 tok/s
Prompt 7.8K 448 tok/s 469 tok/s
Prompt 14.8K 632 tok/s 767 tok/s
Prompt 26.6K 725 tok/s 974 tok/s
Server start 680 s 280 s*

* Measured before the rebase. The expert warm-up, most of the start, still takes 238 s.

Test machine: RTX 3090 (sm_86) on PCIe 3.0 x8, 2× Xeon Gold 6152 (88 vCPUs, 2 NUMA nodes), 177 GiB RAM, CUDA 13.0, driver 615.71.

Calibration on the RTX 3090

./maya.sh --calibrate on the same PC (GSQ-RCO 3.5-bit, 32K context) measures decode speed with the RAM-tier experts split between the CPU and the PCIe link, and with fewer CPU threads:

Setting Decode
The engine's own split (PCIe share 0.00: the CPU computes every RAM-tier expert) 21.3 tok/s
PCIe share 0.00 21.8 tok/s
PCIe share 0.10 8.4 tok/s
40 CPU threads (the engine's own: one socket's 44 CPUs less 4) 21.5 tok/s
30 CPU threads 20.1 tok/s
27 CPU threads 20.0 tok/s
20 CPU threads 18.5 tok/s
10 CPU threads 12.2 tok/s

Nothing beat the engine's own choice by the 3% the tuning requires, so it kept it: 21.6 tok/s, the median of the interleaved confirmation runs. Saved to calibration.json as settings: {}. On a PCIe 3.0 x8 link beside a many-core CPU, the engine's start-up guess is already right. The README's Tuning section shows the same table.

Multi-GPU: up to 16 GPUs

  • --gpus / "gpu" take up to 16 GPUs (MAX_GPUS, kMaxParts); main takes two.
  • The layers are split by each GPU's free VRAM against its layers' expert bytes ("layer_split": "auto"). STRATA_GLM_SPLIT=a,b,... or the config's "layer_split" pin the boundaries; STRATA_GLM_DEVS picks the devices.
  • With more than two parts, prompts run in 512-token chunks so every part stays busy.
  • Experts displaced by a prompt's pool lending are parked in a RAM tier sized for them.
  • On 9 GPUs (8× RTX 5060 Ti 16 GB + the 3090) almost every expert is VRAM-resident:
    • Decode: ~28 tok/s, against 13.3 tok/s on 2 GPUs.
    • 8K-token prompts: 1150–1210 tok/s.

What changed

Decode (one GPU, experts mostly in RAM)

  • CPU lane:
    • One contiguous row range per pool thread. Short 32/64-row jobs held DRAM reads to ~55 of ~92 GB/s.
    • At most one NUMA node's CPUs, and finer calibration.
  • RAM tier: allocated with mmap + mbind(MPOL_INTERLEAVE) + cudaHostRegister (cudaHostAlloc ignores the mempolicy). The model's clean page cache is dropped first: a cached GGUF on one node had left the tier 78% on the other.
  • VRAM refill:
    • Experts move between VRAM and RAM in the background.
    • The slots a prompt lent are refilled faster (STRATA_GLM_PROMOTE_FILL, up to 24 a token).

Prompts

  • RAM-tier experts with few routed tokens are computed on the CPU while the GPU copies the rest over PCIe, balanced per layer.
  • An AVX-512 multi-token Q3_K/Q2_K kernel for those CPU experts (src/kernels/cpu/kq_avx512.cpp).
  • The next layer's experts are prestaged during attention.
  • Sub-batches on NVIDIA: the attention layers' and the dense FFN's are sized per chunk, 256 doubled up to 4096 while they fit in what the MoE buffers already take.
  • KDA conv rewritten: 6.5× faster, bitwise equal.
  • The indexer score is now a register-tiled FP32 GEMM: 78.8 → 5.6 ms per 4096 tokens at position 10K.
  • Windowed MoE output: each expert set's rows are added into the layer output as a window fills. That takes ~40 KB a token instead of ~185, so a 24 GB card's chunk grows from 15.9K to 31K tokens.
  • Sparse attention on Ampere and newer:
    • New mla_attn_mma_kernel: mma.sync m16n8k16, 32 heads a block, O in registers, reading main's FP16 latent cache.
    • Accuracy: rel L2 1.1e-4 against the F32 kernel over a 7.8K-token prompt (max 1.7e-4, worst head 1.2e-3; STRATA_GLM_PREFILL_ATTN_CHECK=1).
    • Speed on a 3090 at 14.8K / 26.6K tokens: 674 / 832 → 759 / 966 tok/s against main's 91 KB kernel.
    • Volta keeps main's 91 KB kernel, as does Ampere+ with STRATA_GLM_PREFILL_ATTN=wmma. Turing keeps the register kernel.

Setup (maya.py)

  • Model question (new in step 2):
    • Lists the downloads only: Maya-S (recommended), Maya-M, GSQ-RCO 3.5-bit. The earlier choice is the default.
    • Files already on the PC: --gguf-dir. A later --setup asks the question again instead of reusing the earlier --gguf-dir the way main does; pass --gguf-dir again to keep those files.
    • A model at a repo's top level downloads correctly (hf_url).
    • A model's vision files can come from another repo.
  • --data-dir renamed --models-dir. It is now the folder the downloads go in, each model in a folder named after it: --models-dir ~/models puts GSQ-RCO's file in ~/models/GSQ-RCO-3.5bit/. The default is Maya-data/models next to the repo, as on main. A model's files already in <DIR>/<quant>/, in <DIR>/glm-5.3-flash-<quant>/ (where main downloads them) or directly in <DIR> are used where they are, and nothing is downloaded: the question shows them as "downloaded".
  • --calibrate, and a tuning offer at the end of the setup. On AMD setups it is skipped and never queries nvidia-smi.
  • Started as python3 maya.py (not on Windows), it re-runs itself through maya.sh so it uses the private .venv.

Every new path has an environment switch back to main's behaviour; they're listed in README → Tuning.

Merge notes

  • Decode attention: main's, unchanged. The decode kernels only gain Q4_K/Q5_K/Q6_K expert support.
  • Prompt chunk budget (both rules merged):
    • One GPU: 40% of the free VRAM less 1 GB (1–8 GB), up to 32K tokens.
    • Two GPUs: main's 6% of the card, 1–2 GB, up to 8K tokens.
    • More than two: 512-token chunks.
  • STRATA_GLM_PREFILL_SUB keeps main's meaning: when set, it fixes every sub-batch, including the shared expert's. AMD setup writes 1024 and keeps 256 without it. NVIDIA without it sizes the sub-batches as above. Main's v1.0.11 changelog says "NVIDIA keeps 256"; that changes with this PR.
  • AMD/HIP:
    • The new mma.sync kernel sits inside main's #if !defined(STRATA_USE_HIP) guard.
    • The NUMA RAM tier needed one name the HIP shim lacked, cudaDevAttrCanUseHostPointerForRegisteredMem. It's now mapped to hipDeviceAttributeCanUseHostPointerForRegisteredMem.
  • --setup after --gguf-dir: main reuses the earlier GGUF folder without asking. This branch asks the model question again, and --gguf-dir keeps the files.
  • serve/server.py passes cpu_threads with the other strata_tune keys.

Test plan

  • ctest on the RTX 3090, excluding ple_parity and glm_model_big: 32/32 pass.
  • Python unit tests (serve/, tools/, including main's new test_maya_hip / test_hip_archs): 148 pass, 3 skipped.
  • New prompt attention kernel against the F32 kernel on a real 7.8K-token prompt: rel L2 1.1e-4.
  • End-to-end benchmark on one RTX 3090 (tables above).
  • ./maya.sh --calibrate on the RTX 3090: it kept the engine's own settings (table above).
  • GSQ-RCO download:
    • The file and Maya's vision files resolve at the pinned revision.
    • The setup lists it and shows the download screen (source, size, free space).
    • SHA-256 matches the GGUF benchmarked here.
  • Not built or run here: HIP/AMD (no ROCm on this machine), Volta, Turing and Windows. The kernel selection leaves Volta and Turing on main's kernels.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mw00/project-maya/pull/12 **Author:** [@needmorevram](https://github.com/needmorevram) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@mw00](https://github.com/mw00) **Base:** `main` ← **Head:** `glm-gsq-rco-3090-speed` --- ### 📝 Commits (1) - [`abe3b45`](https://github.com/mw00/project-maya/commit/abe3b45d6d4117473228b154961532135090afb1) GLM-5.3-Flash: GSQ-RCO 3.5-bit download, up to 16 GPUs, decode/prompt speed on one GPU ### 📊 Changes **25 files changed** (+3263 additions, -392 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+5 -1) 📝 `README.md` (+73 -18) 📝 `include/strata/core/glm_model.hpp` (+24 -6) 📝 `include/strata/hip_compat/cuda_runtime.h` (+1 -0) ➕ `include/strata/kernels/cpu/kq_avx512.hpp` (+32 -0) 📝 `include/strata/kernels/glm_batch.hpp` (+18 -1) 📝 `include/strata/kernels/glm_fast.hpp` (+2 -0) 📝 `include/strata/prefill/moe_mmq.hpp` (+3 -0) 📝 `maya.py` (+372 -62) 📝 `serve/server.py` (+3 -0) 📝 `src/core/glm_cpu_bench.cpp` (+1 -1) 📝 `src/core/glm_fast_path.cu` (+467 -49) 📝 `src/core/glm_fast_state.hpp` (+28 -8) 📝 `src/core/glm_model.cu` (+150 -41) 📝 `src/core/glm_prefill.cu` (+921 -160) ➕ `src/kernels/cpu/kq_avx512.cpp` (+197 -0) 📝 `src/kernels/cuda/glm_batch.cu` (+515 -28) 📝 `src/kernels/cuda/glm_fast.cu` (+20 -7) 📝 `src/prefill/moe_mmq.cu` (+2 -0) 📝 `src/program/generate.cpp` (+14 -6) _...and 5 more files_ </details> ### 📄 Description ## Summary - **GSQ-RCO 3.5-bit as a download in the setup**, next to Maya-S and Maya-M. - Pick it in the setup's new model question, which lists the three downloads only (Maya-S, Maya-M, GSQ-RCO 3.5-bit), or pass `--model GSQ-RCO-3.5bit`. GGUF files already on the PC still go through `--gguf-dir`, as on main. - Source: [pfeifferj/GLM-5.3-Flash-GSQ-RCO-GGUF](https://huggingface.co/pfeifferj/GLM-5.3-Flash-GSQ-RCO-GGUF), MIT. Only the 3.5-bit file is offered: one 137.1 GB GGUF at a pinned revision, SHA-256 verified. - It's a community quant made with IST-DASLab's GSQ and RCO methods: Q3_K/Q2_K experts, Q8_0 dense weights, BF16 `attn_kv_a_mqa`, no MTP block. This PR adds the engine support it needs. - Images use Maya's vision files. - **Multi-GPU cap raised from 2 to 16 GPUs.** Main splits the layers across at most two GPUs (`--gpus` takes a pair). This branch takes up to 16 (`--gpus 0,1,...`, `kMaxParts = 16`) and places the layer boundaries by each GPU's free VRAM. - **Faster decode and prefill on a single 24 GB card**: an RTX 3090 on PCIe 3.0 x8, with most experts in RAM. - **`./maya.sh --calibrate`** (`tools/calibrate_glm.py`) tunes the CPU lane for the PC: the PCIe share and the thread count. CUDA only. Rebased on `main` 5393fe7 (v1.0.11). Main's FP16 latent cache, its attention kernels and the AMD/HIP port are kept; details below. ## Performance on one RTX 3090 GSQ-RCO 3.5-bit, max context **32,768** tokens. Each request is a fresh conversation: temperature 0, thinking off, 128-token answers. | Context (prompt tokens) | Prefill (tok/s) | Prefill time | Decode at that context (tok/s) | |---:|---:|---:|---:| | 47 | 41 | 1.1 s | 19.1 | | 7,797 | 469 | 16.6 s | 18.7 | | 8,449 | 550 | 15.4 s | 18.9 | | 14,807 | 767 | 19.3 s | 18.7 | | 26,641 | 974 | 27.4 s | 19.0 | Two earlier runs of this branch, before the last rebase, agree within 3% on prefill, with decode at 18.6–21.0 tok/s. Prefill speeds up with length because a prompt streams every expert that isn't in VRAM over PCIe once per chunk. One chunk holds up to 31,040 tokens on a 24 GB card, so the 26.6K prompt takes one pass. **Memory** (measured from `/proc` during the run above; 1 GiB = 2^30 bytes): | | Used | Notes | |---|---:|---| | VRAM | ~23 of 24 GiB | Dense weights 8.6 GiB, state + KV for 32K context 0.9 GiB, expert pool 12.8 GiB (1,314 experts), other 0.6 GiB. During a prompt, 7.1 GiB of the pool is lent to the prompt's buffers. | | RAM | **~121 GiB** of 177 GiB | Available memory fell from 169.3 to 48.4 GiB. The engine's RSS was 121–127 GiB, including ~8 GiB of the GGUF in page cache. Main parts: the RAM tier, 114.9 GiB pinned (11,770 experts), and the disk landing ring, 1.1 GiB pinned. | The RAM tier takes the free RAM less 6 GiB (`STRATA_GLM_RAM_HEADROOM_GB`), up to what the experts need. Here every expert fits in VRAM + RAM (126.8 GiB), so decode doesn't touch the disk (`disk 0.00 reads/tok`). With less RAM the rest is read from disk and decode is slower. **Before → after** (same harness and requests). "Before" is this work's starting point: the GGUF support on main 142540b, before main's FP16 cache. Main itself can't run this GGUF, because it has no BF16 `attn_kv_a_mqa` path. | | Before | After | |---|---:|---:| | Decode | 15.3 tok/s | 18.7 – 19.9 tok/s | | Prompt 7.8K | 448 tok/s | 469 tok/s | | Prompt 14.8K | 632 tok/s | 767 tok/s | | Prompt 26.6K | 725 tok/s | 974 tok/s | | Server start | 680 s | 280 s* | \* Measured before the rebase. The expert warm-up, most of the start, still takes 238 s. Test machine: RTX 3090 (sm_86) on PCIe 3.0 x8, 2× Xeon Gold 6152 (88 vCPUs, 2 NUMA nodes), 177 GiB RAM, CUDA 13.0, driver 615.71. ## Calibration on the RTX 3090 `./maya.sh --calibrate` on the same PC (GSQ-RCO 3.5-bit, 32K context) measures decode speed with the RAM-tier experts split between the CPU and the PCIe link, and with fewer CPU threads: | Setting | Decode | |---|---:| | The engine's own split (PCIe share 0.00: the CPU computes every RAM-tier expert) | 21.3 tok/s | | PCIe share 0.00 | 21.8 tok/s | | PCIe share 0.10 | 8.4 tok/s | | 40 CPU threads (the engine's own: one socket's 44 CPUs less 4) | 21.5 tok/s | | 30 CPU threads | 20.1 tok/s | | 27 CPU threads | 20.0 tok/s | | 20 CPU threads | 18.5 tok/s | | 10 CPU threads | 12.2 tok/s | Nothing beat the engine's own choice by the 3% the tuning requires, so it kept it: 21.6 tok/s, the median of the interleaved confirmation runs. Saved to `calibration.json` as `settings: {}`. On a PCIe 3.0 x8 link beside a many-core CPU, the engine's start-up guess is already right. The README's Tuning section shows the same table. ## Multi-GPU: up to 16 GPUs - `--gpus` / `"gpu"` take up to 16 GPUs (`MAX_GPUS`, `kMaxParts`); main takes two. - The layers are split by each GPU's free VRAM against its layers' expert bytes (`"layer_split": "auto"`). `STRATA_GLM_SPLIT=a,b,...` or the config's `"layer_split"` pin the boundaries; `STRATA_GLM_DEVS` picks the devices. - With more than two parts, prompts run in 512-token chunks so every part stays busy. - Experts displaced by a prompt's pool lending are parked in a RAM tier sized for them. - On 9 GPUs (8× RTX 5060 Ti 16 GB + the 3090) almost every expert is VRAM-resident: - Decode: ~28 tok/s, against 13.3 tok/s on 2 GPUs. - 8K-token prompts: 1150–1210 tok/s. ## What changed **Decode (one GPU, experts mostly in RAM)** - CPU lane: - One contiguous row range per pool thread. Short 32/64-row jobs held DRAM reads to ~55 of ~92 GB/s. - At most one NUMA node's CPUs, and finer calibration. - RAM tier: allocated with mmap + `mbind(MPOL_INTERLEAVE)` + `cudaHostRegister` (`cudaHostAlloc` ignores the mempolicy). The model's clean page cache is dropped first: a cached GGUF on one node had left the tier 78% on the other. - VRAM refill: - Experts move between VRAM and RAM in the background. - The slots a prompt lent are refilled faster (`STRATA_GLM_PROMOTE_FILL`, up to 24 a token). **Prompts** - RAM-tier experts with few routed tokens are computed on the CPU while the GPU copies the rest over PCIe, balanced per layer. - An AVX-512 multi-token Q3_K/Q2_K kernel for those CPU experts (`src/kernels/cpu/kq_avx512.cpp`). - The next layer's experts are prestaged during attention. - Sub-batches on NVIDIA: the attention layers' and the dense FFN's are sized per chunk, 256 doubled up to 4096 while they fit in what the MoE buffers already take. - KDA conv rewritten: 6.5× faster, bitwise equal. - The indexer score is now a register-tiled FP32 GEMM: 78.8 → 5.6 ms per 4096 tokens at position 10K. - Windowed MoE output: each expert set's rows are added into the layer output as a window fills. That takes ~40 KB a token instead of ~185, so a 24 GB card's chunk grows from 15.9K to 31K tokens. - **Sparse attention on Ampere and newer:** - New `mla_attn_mma_kernel`: `mma.sync` m16n8k16, 32 heads a block, O in registers, reading main's FP16 latent cache. - Accuracy: rel L2 1.1e-4 against the F32 kernel over a 7.8K-token prompt (max 1.7e-4, worst head 1.2e-3; `STRATA_GLM_PREFILL_ATTN_CHECK=1`). - Speed on a 3090 at 14.8K / 26.6K tokens: 674 / 832 → 759 / 966 tok/s against main's 91 KB kernel. - Volta keeps main's 91 KB kernel, as does Ampere+ with `STRATA_GLM_PREFILL_ATTN=wmma`. Turing keeps the register kernel. **Setup (`maya.py`)** - Model question (new in step 2): - Lists the downloads only: Maya-S (recommended), Maya-M, GSQ-RCO 3.5-bit. The earlier choice is the default. - Files already on the PC: `--gguf-dir`. A later `--setup` asks the question again instead of reusing the earlier `--gguf-dir` the way main does; pass `--gguf-dir` again to keep those files. - A model at a repo's top level downloads correctly (`hf_url`). - A model's vision files can come from another repo. - `--data-dir` renamed `--models-dir`. It is now the folder the downloads go in, each model in a folder named after it: `--models-dir ~/models` puts GSQ-RCO's file in `~/models/GSQ-RCO-3.5bit/`. The default is `Maya-data/models` next to the repo, as on main. A model's files already in `<DIR>/<quant>/`, in `<DIR>/glm-5.3-flash-<quant>/` (where main downloads them) or directly in `<DIR>` are used where they are, and nothing is downloaded: the question shows them as "downloaded". - `--calibrate`, and a tuning offer at the end of the setup. On AMD setups it is skipped and never queries `nvidia-smi`. - Started as `python3 maya.py` (not on Windows), it re-runs itself through `maya.sh` so it uses the private `.venv`. Every new path has an environment switch back to main's behaviour; they're listed in README → Tuning. ## Merge notes - **Decode attention:** main's, unchanged. The decode kernels only gain Q4_K/Q5_K/Q6_K expert support. - **Prompt chunk budget** (both rules merged): - One GPU: 40% of the free VRAM less 1 GB (1–8 GB), up to 32K tokens. - Two GPUs: main's 6% of the card, 1–2 GB, up to 8K tokens. - More than two: 512-token chunks. - **`STRATA_GLM_PREFILL_SUB`** keeps main's meaning: when set, it fixes every sub-batch, including the shared expert's. AMD setup writes `1024` and keeps 256 without it. NVIDIA without it sizes the sub-batches as above. Main's v1.0.11 changelog says "NVIDIA keeps 256"; that changes with this PR. - **AMD/HIP:** - The new `mma.sync` kernel sits inside main's `#if !defined(STRATA_USE_HIP)` guard. - The NUMA RAM tier needed one name the HIP shim lacked, `cudaDevAttrCanUseHostPointerForRegisteredMem`. It's now mapped to `hipDeviceAttributeCanUseHostPointerForRegisteredMem`. - **`--setup` after `--gguf-dir`:** main reuses the earlier GGUF folder without asking. This branch asks the model question again, and `--gguf-dir` keeps the files. - `serve/server.py` passes `cpu_threads` with the other `strata_tune` keys. ## Test plan - [x] `ctest` on the RTX 3090, excluding `ple_parity` and `glm_model_big`: 32/32 pass. - [x] Python unit tests (`serve/`, `tools/`, including main's new `test_maya_hip` / `test_hip_archs`): 148 pass, 3 skipped. - [x] New prompt attention kernel against the F32 kernel on a real 7.8K-token prompt: rel L2 1.1e-4. - [x] End-to-end benchmark on one RTX 3090 (tables above). - [x] `./maya.sh --calibrate` on the RTX 3090: it kept the engine's own settings (table above). - [x] GSQ-RCO download: - The file and Maya's vision files resolve at the pinned revision. - The setup lists it and shows the download screen (source, size, free space). - SHA-256 matches the GGUF benchmarked here. - [ ] Not built or run here: HIP/AMD (no ROCm on this machine), Volta, Turing and Windows. The kernel selection leaves Volta and Turing on main's kernels. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:23:44 +07:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mw00/project-maya#280
No description provided.