[shared] prefill MMQ: Q6_K under STRATA_MMQ_KQUANTS (Qwen3.6 UD-Q4_K_XL's down on layers 34, 38, 39)
llama.cpp's MMQ has a Q6_K tile (mmq-instance-q6_k.cu); it joins the K-quant list beside Q4_K, Q5_K and Q5_1 so a prompt through the Q4_K_XL file's three Q6_K layers takes the int8 tiles rather than the fp16 GEMM over dequantized weights. The screen test adds Q5_K and Q6_K down products at the model's 2048 x 512; its "not covered" negative moves from Q6_K to Q3_K. Type tables only; the prefill geometry is the prefill agent's. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017tPVMg2wGSNR1KANEiUtwr
This commit is contained in:
1 parent
40f3cb96e2
commit
a4e6269bba
3 files changed
+9
-4
No files matched your search
+2
-2
@@ -1112,10 +1112,10 @@ if(STRATA_NATIVE_EXPERTS)
|
||||
src/prefill/ggml_cuda_host.cu ${_strata_mmq}/quantize.cu)
|
||||
# q8_0: the drafter's matrices (E-9); STRATA_ORCA_Q4KS_MMQ adds q5_0 (#296, in _strata_mmq_types), and
|
||||
# STRATA_MMQ_KQUANTS q4_k q5_k q5_1, the experts of Unsloth's UD-Q4_K_XL (docs/UNSLOTH_Q4.md; the dispatch
|
||||
# follows eddoursul/Strata 7706c1b)
|
||||
# follows eddoursul/Strata 7706c1b), plus q6_k (Qwen3.6-35B-A3B UD-Q4_K_XL's layers 34, 38, 39)
|
||||
set(_strata_mmq_cuda_types ${_strata_mmq_types})
|
||||
if(STRATA_MMQ_KQUANTS)
|
||||
list(APPEND _strata_mmq_cuda_types q4_k q5_k q5_1)
|
||||
list(APPEND _strata_mmq_cuda_types q4_k q5_k q5_1 q6_k)
|
||||
endif()
|
||||
foreach(_t IN LISTS _strata_mmq_cuda_types)
|
||||
target_sources(strata_mmq PRIVATE ${_strata_mmq}/template-instances/mmq-instance-${_t}.cu)
|
||||
|
||||
@@ -116,6 +116,7 @@ bool supported(int t) {
|
||||
case GGML_TYPE_Q8_0: // the draft layer's dense matrices (E-9)
|
||||
#ifdef STRATA_MMQ_KQUANTS
|
||||
case GGML_TYPE_Q4_K: case GGML_TYPE_Q5_K: case GGML_TYPE_Q5_1: // Unsloth's UD-Q4_K_XL experts (CUDA)
|
||||
case GGML_TYPE_Q6_K: // Qwen3.6-35B-A3B UD-Q4_K_XL's down projections on layers 34, 38, 39
|
||||
#endif
|
||||
return true;
|
||||
default:
|
||||
@@ -201,6 +202,7 @@ void Context::run(const Product& p, void* stream) {
|
||||
case GGML_TYPE_Q4_K: mul_mat_q_case<GGML_TYPE_Q4_K>(ctx, a, s); break;
|
||||
case GGML_TYPE_Q5_K: mul_mat_q_case<GGML_TYPE_Q5_K>(ctx, a, s); break;
|
||||
case GGML_TYPE_Q5_1: mul_mat_q_case<GGML_TYPE_Q5_1>(ctx, a, s); break;
|
||||
case GGML_TYPE_Q6_K: mul_mat_q_case<GGML_TYPE_Q6_K>(ctx, a, s); break;
|
||||
#endif
|
||||
default:
|
||||
std::fprintf(stderr, "prefill mmq: type %d is not covered\n", (int) t);
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
// reference quantizers, against a double-precision product of ggml's dequantized weights. MMQ rounds the activations
|
||||
// to q8_1 by design, so this is a screen for layout, stride, expert-bound and row-id errors (the bounds of
|
||||
// tests/hip/prefill_mmq_parity.cpp), not a bit-exactness test. Several experts per product, permuted rows, an
|
||||
// all-zero row; the formats the build does not cover (Q6_K) must say so.
|
||||
// all-zero row. Qwen3.6-35B-A3B's UD-Q4_K_XL adds Q5_K and Q6_K down projections at its 2048 x 512; a format the
|
||||
// build does not cover (Q3_K) must say so.
|
||||
#include "strata/prefill/moe_mmq.hpp"
|
||||
|
||||
#include "ggml.h"
|
||||
@@ -142,7 +143,7 @@ void product(mmq::Context& ctx, cudaStream_t s, const char* name, ggml_type t, i
|
||||
int main() {
|
||||
try {
|
||||
if (!mmq::built()) { std::printf("no MMQ in this build\n"); return 1; }
|
||||
if (mmq::supported(GGML_TYPE_Q6_K)) throw std::runtime_error("Q6_K should not be covered");
|
||||
if (mmq::supported(GGML_TYPE_Q3_K)) throw std::runtime_error("Q3_K should not be covered");
|
||||
cudaStream_t s = nullptr;
|
||||
ck(cudaStreamCreateWithFlags(&s, cudaStreamNonBlocking), "stream");
|
||||
{
|
||||
@@ -155,6 +156,8 @@ int main() {
|
||||
product(ctx, s, ("Q5_K gate/up" + tag).c_str(), GGML_TYPE_Q5_K, 1280, 2560, counts, trial + 5);
|
||||
product(ctx, s, ("Q5_1 down" + tag).c_str(), GGML_TYPE_Q5_1, 2560, 640, counts, trial + 9);
|
||||
product(ctx, s, ("Q8_0 down" + tag).c_str(), GGML_TYPE_Q8_0, 2560, 640, counts, trial + 13);
|
||||
product(ctx, s, ("Q5_K down 2048x512" + tag).c_str(), GGML_TYPE_Q5_K, 2048, 512, counts, trial + 17);
|
||||
product(ctx, s, ("Q6_K down 2048x512" + tag).c_str(), GGML_TYPE_Q6_K, 2048, 512, counts, trial + 21);
|
||||
++trial;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user