ggml-webgpu: add q4_0/q8_0 SET_ROWS (#23760)

* Add q8_0 and q4_0 set_rows

* Add fast(er) quantization set_rows path

* formatting/naming

* a little more naming

* Remove unused constant

* Don't override other override

* Avoid bitcast

* Narrow relaxation
This commit is contained in:
Reese Levine
2026-05-29 14:14:11 -07:00
committed by GitHub
parent 689a9a470e
commit b22da25889
5 changed files with 298 additions and 41 deletions
+9
View File
@@ -2415,6 +2415,15 @@ struct test_set_rows : public test_case {
}
return 1e-7;
}
// See dicussion here: https://github.com/ggml-org/llama.cpp/pull/23760#issuecomment-4566312209
double max_nmse_err(ggml_backend_t backend) override {
ggml_backend_reg_t reg = ggml_backend_dev_backend_reg(ggml_backend_get_device(backend));
if (type == GGML_TYPE_Q8_0 && strcmp(ggml_backend_reg_name(reg), "WebGPU") == 0) {
return std::max(test_case::max_nmse_err(backend), 2e-7);
}
return test_case::max_nmse_err(backend);
}
};
// GGML_OP_ROPE + GGML_OP_VIEW + GGML_OP_SET_ROWS