[PR #2742] [CLOSED] Qwen3.6: opt-in int8 K/V cache and single staging buffer #4239

Closed
opened 2026-11-07 15:34:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2742
Author: @ggeorgovassilis
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: q36-int8-kv


📝 Commits (2)

  • 7156cf9 Qwen3.6: opt-in int8 (q8_0) K/V cache behind --kv int8
  • 3a9e6c8 Qwen3.6: opt-in single staging buffer and staging placement fixes

📊 Changes

7 files changed (+725 additions, -22 deletions)

View changed files

📝 CMakeLists.txt (+8 -0)
📝 docs/DETAILS.md (+48 -0)
➕ docs/Q36_INT8_KV.md (+229 -0)
➕ include/strata/kernels/q36_kv_q8.hpp (+61 -0)
➕ src/kernels/cuda/q36_kv_q8.cu (+66 -0)
➕ src/kernels/q36_kv_q8_parity.cpp (+96 -0)
📝 src/qwen35/q36_engine.cu (+217 -22)

📄 Description

Title

Qwen3.6: opt-in int8 K/V cache and single staging buffer

Summary

Two opt-in improvements to the Qwen3.6-35B-A3B own-engine path, both off by default so the default path stays byte-identical to the last release:

  1. int8 (q8_0) K/V cache behind --kv int8 — roughly 4x smaller K/V cache (~44 KiB/token fp32 -> ~11 KiB/token int8), so an 8 GB card doubles its context (16K -> 32K).
  2. Single staging buffer behind STRATA_Q36_SINGLE_STAGE=1 — halves the prompt-streaming staging VRAM (one buffer instead of two double-buffered).

What changed

  • CMakeLists.txt — build wiring for the new q8_0 K/V kernels.
  • include/strata/kernels/q36_kv_q8.hpp — new int8 K/V kernel interface.
  • src/kernels/cuda/q36_kv_q8.cu — CUDA q8_0 K/V cache kernel.
  • src/kernels/q36_kv_q8_parity.cpp — CPU reference kernel for parity testing.
  • src/qwen35/q36_engine.cu — the --kv int8 engine path; STRATA_Q36_SINGLE_STAGE=1 (single staging buffer), numeric STRATA_Q36_NO_MMQ, STRATA_Q36_PLACE_DEBUG, and an attention-scores-buffer shrink (256 -> 64 MB) so staging placement still succeeds on tight VRAM.
  • docs/Q36_INT8_KV.md — design note with the measured numbers.
  • docs/DETAILS.md — links the new section into the table of contents.

Extra Notes

  • --kv int8 defaults to --kv fp32, which is byte-identical to the previous release.
  • Benchmarks were measured on an RTX 4060 (8 GB); see docs/Q36_INT8_KV.md.

🔄 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/Niko1221/Strata/pull/2742 **Author:** [@ggeorgovassilis](https://github.com/ggeorgovassilis) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `q36-int8-kv` --- ### 📝 Commits (2) - [`7156cf9`](https://github.com/Niko1221/Strata/commit/7156cf910b5f30c38ffcd944a96c08fb0109ec7f) Qwen3.6: opt-in int8 (q8_0) K/V cache behind --kv int8 - [`3a9e6c8`](https://github.com/Niko1221/Strata/commit/3a9e6c888a645331a0bf2179897f43cdaebf43ba) Qwen3.6: opt-in single staging buffer and staging placement fixes ### 📊 Changes **7 files changed** (+725 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+8 -0) 📝 `docs/DETAILS.md` (+48 -0) ➕ `docs/Q36_INT8_KV.md` (+229 -0) ➕ `include/strata/kernels/q36_kv_q8.hpp` (+61 -0) ➕ `src/kernels/cuda/q36_kv_q8.cu` (+66 -0) ➕ `src/kernels/q36_kv_q8_parity.cpp` (+96 -0) 📝 `src/qwen35/q36_engine.cu` (+217 -22) </details> ### 📄 Description ## Title Qwen3.6: opt-in int8 K/V cache and single staging buffer ## Summary Two opt-in improvements to the Qwen3.6-35B-A3B own-engine path, both off by default so the default path stays byte-identical to the last release: 1. **int8 (q8_0) K/V cache** behind `--kv int8` — roughly 4x smaller K/V cache (~44 KiB/token fp32 -> ~11 KiB/token int8), so an 8 GB card doubles its context (16K -> 32K). 2. **Single staging buffer** behind `STRATA_Q36_SINGLE_STAGE=1` — halves the prompt-streaming staging VRAM (one buffer instead of two double-buffered). ## What changed - `CMakeLists.txt` — build wiring for the new q8_0 K/V kernels. - `include/strata/kernels/q36_kv_q8.hpp` — new int8 K/V kernel interface. - `src/kernels/cuda/q36_kv_q8.cu` — CUDA q8_0 K/V cache kernel. - `src/kernels/q36_kv_q8_parity.cpp` — CPU reference kernel for parity testing. - `src/qwen35/q36_engine.cu` — the `--kv int8` engine path; `STRATA_Q36_SINGLE_STAGE=1` (single staging buffer), numeric `STRATA_Q36_NO_MMQ`, `STRATA_Q36_PLACE_DEBUG`, and an attention-scores-buffer shrink (256 -> 64 MB) so staging placement still succeeds on tight VRAM. - `docs/Q36_INT8_KV.md` — design note with the measured numbers. - `docs/DETAILS.md` — links the new section into the table of contents. ## Extra Notes - `--kv int8` defaults to `--kv fp32`, which is byte-identical to the previous release. - Benchmarks were measured on an RTX 4060 (8 GB); see `docs/Q36_INT8_KV.md`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:34:15 +07:00
Sign in to join this conversation.
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
Niko1221/Strata#4239
No description provided.