mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2707] Metal: --kv fp16 is accepted and reported, but the QSA cache always stores int8 #1075
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1075
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Boundlessmolson on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2707
Summary
On the Metal engine,
--kv fp16is accepted and the serve banner reportskv=fp16, but the Metal QSAkernel always stores K and V as int8 with an fp16 scale per 64 values. The flag is silently ignored
for the QSA cache.
int8 looks like a deliberate choice for this kernel, so this is mainly about the mismatch: the banner
says fp16 while the cache is int8.
Steps to reproduce
Any Metal run with
--kv fp16, for example:The banner reports:
Where it comes from (at
296b59d)generate.cpp:9596printskv=from the flag string (o.kv).metal/kernels/qsa.metal:135-147(inqsa_prep) quantizes every K and V append to int8 with anfp16 scale per 64 values (
kq/vqaredevice char*,ksc/vscaredevice half*). Nothing inthe kernel reads
--kv.line 48 (the
kq/vq ... int8, ks/vs ... halfcache layout).Why it matters
It changes numerics compared with CUDA's fp16 KV, which matters when comparing the two engines or
chasing drift over long contexts. Someone passing
--kv fp16to rule out KV quantization wouldreasonably believe they had.
Suggestion
Either honor
--kv fp16in the Metal QSA path, or print what the Metal cache actually uses (forexample
kv=int8 (Metal QSA)) and warn when another type was requested.Environment
296b59d2f73c8f04a805df29c2fa97655adace78(engine0.1.44.1-metal)@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@simlu commented on GitHub (Oct 23, 2026):
Related: https://github.com/Niko1221/Strata/issues/3785