[PR #4270] [CLOSED] [Engine] qwen35: FP16 K/V cache by default, int8 with --kv-q8 (262144 fits a 16 GiB card) #4981

Closed
opened 2026-11-07 16:31:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4270
Author: @benthic-io
Created: 10/26/2026
Status: ❌ Closed

Base: main ← Head: qwen35-kv-q8


📝 Commits (1)

  • be617b6 [Engine] qwen35: FP16 K/V cache by default, int8 with --kv-q8 (262144 fits a 16 GiB card)

📊 Changes

2 files changed (+248 additions, -48 deletions)

View changed files

📝 docs/QWEN36.md (+45 -0)
📝 src/qwen35/q36_engine.cu (+203 -48)

📄 Description

Port of the previously submitted q8 KV cache work to the current tree.

The Qwen3.6 / qwen35moe engine stored its K/V cache in FP32 with no option to change it. FP16 becomes the default and --kv-q8 stores int8 codes with one FP16 scale per 64 dims (the main engine's kv_q8.hpp scheme), matching the main engine's kKvF16.

Changes:

  • src/qwen35/q36_engine.cu: k_attn_prep, k_attn_part, k_kv_f16 templated on cache format; RowSel/Sess/batch rows carry scale arrays; session-to-slot copy sized per format; --kv-q8 flag.
  • docs/QWEN36.md: section on the two formats.

Validation: cherry-picked from PR #3084 and resolved conflicts against current main; builds CUDA (sm_75).


🔄 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/4270 **Author:** [@benthic-io](https://github.com/benthic-io) **Created:** 10/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `qwen35-kv-q8` --- ### 📝 Commits (1) - [`be617b6`](https://github.com/Niko1221/Strata/commit/be617b661bad2308bdffa386f52f0515851f5584) [Engine] qwen35: FP16 K/V cache by default, int8 with --kv-q8 (262144 fits a 16 GiB card) ### 📊 Changes **2 files changed** (+248 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `docs/QWEN36.md` (+45 -0) 📝 `src/qwen35/q36_engine.cu` (+203 -48) </details> ### 📄 Description Port of the previously submitted q8 KV cache work to the current tree. The Qwen3.6 / qwen35moe engine stored its K/V cache in FP32 with no option to change it. FP16 becomes the default and --kv-q8 stores int8 codes with one FP16 scale per 64 dims (the main engine's kv_q8.hpp scheme), matching the main engine's kKvF16. Changes: - src/qwen35/q36_engine.cu: k_attn_prep, k_attn_part, k_kv_f16 templated on cache format; RowSel/Sess/batch rows carry scale arrays; session-to-slot copy sized per format; --kv-q8 flag. - docs/QWEN36.md: section on the two formats. Validation: cherry-picked from PR #3084 and resolved conflicts against current main; builds CUDA (sm_75). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:31:46 +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#4981
No description provided.