Compare commits

...
Author SHA1 Message Date
Leon 31b1752ed2 webgpu : add CONV_TRANSPOSE_1D support (#32719)
* webgpu : add CONV_TRANSPOSE_1D support

* webgpu : remove redundant CONV_TRANSPOSE_1D checks
2026-11-28 13:05:19 +01:00
gianni-cor 2477ee0b61 ggml : add CONCAT backward pass (#32151)
Each input's gradient is a view of the output gradient at its offset
along dim, made contiguous.

Mark a and b as params so grad mode checks the op, with grad_nmax raised
to 40000 to keep the default shapes. The output is weighted by random
values in [1, 2], since with a plain sum every gradient is 1 and a wrong
offset would still pass. Transposed-b cases are not grad checked, they
only cover the forward.

Signed-off-by: gianni-cor <gianfranco.cordella@tether.io>
2026-11-28 13:04:01 +01:00
Aaron Teo 1697369215 ggml-cpu: optimize s390x vector intrinsic (#32253)
Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
2026-11-28 12:47:38 +01:00
jaredmeaux f16e79da89 chat : Allow K2 Horizon tool call during thought (#32993)
Allow tool calls that would otherwise appear inside reasoning/thinking blocks for K2 Horizon.

K2 Horizon models can emit tool calls without closing the thinking block. Without this
fix the parser would only stop on explicit end tag, and the tool call was lost without
executing. With this PR we now end reasoning before the tool call starts.
In short, when reasoning mentions `<ifm|tool_calls>`, we end reasoning there.

My tests cover this case at medium and high effort.

This fixes #32972, and is the same pattern as #32232 (Gemma4) and #32271 (Ministral-3).

- I have read and agree with the [contributing guidelines](https://github.com/ggml-org/llama.cpp/blob/master/CONTRIBUTING.md)

I have used Opus to run and score benchmarks, help find the K2 parser, draft
the fix and test, and see how others have resolved this for other models. I have carefully
examined all changes and tested with my local benchmarks.

I have used Sol to code review twice.

Assisted-by: Claude Opus 5.5
Assisted-by: GPT 6.2 Sol
2026-11-28 12:22:49 +01:00
Pascal 0c2209c88b tests : use the fused mul_mat tolerance for LOOP_CTRL (#33238) 2026-11-28 11:49:47 +01:00
anujj 2881150433 model : expand Inkling 2 tau after embeddings (#33186)
* model : inkling2 expand tau after the embeddings

* model : build inkling2 embeddings before tau
2026-11-28 11:09:28 +01:00
Johannes Gäßler 786da85942 CUDA: consistent ncols2 selection for mma FA (#32626) 2026-11-28 08:57:29 +01:00
15 changed files with 536 additions and 339 deletions
+7 -2
View File
@@ -71,6 +71,10 @@ common_chat_params common_chat_params_init_k2_horizon(const common_chat_template
auto extract_reasoning = inputs.reasoning_format != COMMON_REASONING_FORMAT_NONE;
auto include_grammar = has_response_format || (has_tools && inputs.tool_choice != COMMON_CHAT_TOOL_CHOICE_NONE);
// A tool call may start before the thought is closed, the real closers stay first, the budget sampler forces them
const auto think_closers = data.thinking_end_tags;
data.thinking_end_tags.push_back(SECTION_START);
if (inputs.has_continuation()) {
const auto & msg = inputs.continue_msg;
@@ -86,12 +90,13 @@ common_chat_params common_chat_params_init_k2_horizon(const common_chat_template
auto generation_prompt = p.literal(GEN_PREFIX);
auto think_end = p.choice();
for (const auto & tag : data.thinking_end_tags) {
for (const auto & tag : think_closers) {
think_end |= p.literal(tag);
}
auto think_body = p.until_one_of(data.thinking_end_tags);
auto think_block = [&](const common_peg_parser & body) {
return p.optional(THINK_START + p.space() + p.through(body, think_end));
// Peek only, because the tool call rule will consume <ifm|tool_calls>
return p.optional(THINK_START + p.space() + body + (think_end | p.peek(p.literal(SECTION_START))));
};
auto reasoning = extract_reasoning ? think_block(p.reasoning(think_body)) : p.eps();
+1 -1
View File
@@ -31,7 +31,7 @@ Legend:
| CONV_2D | ❌ | ❌ | 🟡 | ✅ | ❌ | ✅ | ✅ | 🟡 | ✅ | ✅ | 🟡 | ✅ | ❌ | ❌ |
| CONV_2D_DW | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | 🟡 | 🟡 | ✅ | ✅ | ✅ | ❌ | ❌ |
| CONV_3D | ❌ | ❌ | ✅ | ✅ | ❌ | 🟡 | ✅ | 🟡 | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
| CONV_TRANSPOSE_1D | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
| CONV_TRANSPOSE_1D | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ |
| CONV_TRANSPOSE_2D | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
| COS | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ |
| COUNT_EQUAL | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ |
+118 -116
View File
@@ -5502,122 +5502,124 @@
"WebGPU: WebGPU","CONV_3D","N=2,IC=3,ID=18,IH=22,IW=20,OC=4,KD=3,KH=3,KW=3,s0=2,s1=2,s2=2,p0=1,p1=1,p2=1,d0=2,d1=2,d2=2,type_kernel=f16","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_3D","N=2,IC=3,ID=18,IH=22,IW=20,OC=4,KD=3,KH=1,KW=5,s0=2,s1=1,s2=1,p0=2,p1=0,p2=1,d0=1,d1=1,d2=2,type_kernel=f16","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_3D","N=1,IC=4,ID=8,IH=8,IW=8,OC=8,KD=1,KH=1,KW=1,s0=1,s1=1,s2=1,p0=0,p1=0,p2=0,d0=1,d1=1,d2=1,type_kernel=f16","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,1,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,1,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,1,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,1,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,1,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,9,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,9,1,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,9,1,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,9,7,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,9,7,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,9,7,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[197,32,1,1],ne_kernel=[16,32,32,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[2,3,2,1],s0=3,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[2,3,2,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[2,3,2,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[3,2,2,1],s0=2,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[3,2,2,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[3,1,2,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,1,1,1],s0=1,p0=0,d0=1","support","0","no","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,1,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,1,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,1,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,1,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,1,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[3,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[3,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,1,1,1],ne_kernel=[1337,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[1337,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,9,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,9,1,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,1,1,1],ne_kernel=[1337,9,1,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[3,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[3,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[3,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[1,7,1,1],ne_kernel=[1337,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,7,1,1],ne_kernel=[1337,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,9,7,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,9,7,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[13,7,1,1],ne_kernel=[1337,9,7,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[197,32,1,1],ne_kernel=[16,32,32,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[2,3,2,1],s0=3,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[2,3,2,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[2,3,2,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[3,2,2,1],s0=2,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[3,2,2,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[3,2,1,1],ne_kernel=[3,1,2,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[2,1,1,1],ne_kernel=[3,1,1,1],s0=1,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[33,32,1,1],ne_kernel=[20,24,32,1],s0=10,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","CONV_TRANSPOSE_1D","ne_input=[35,33,1,1],ne_kernel=[11,17,33,1],s0=5,p0=0,d0=1","support","1","yes","WebGPU"
"WebGPU: WebGPU","COL2IM_1D","type=f32,K=16,OC=32,T_in=197,s0=8,p0=0,view=0","support","1","yes","WebGPU"
"WebGPU: WebGPU","COL2IM_1D","type=f32,K=4,OC=3,T_in=7,s0=2,p0=0,view=0","support","1","yes","WebGPU"
"WebGPU: WebGPU","COL2IM_1D","type=f32,K=1,OC=5,T_in=13,s0=1,p0=0,view=0","support","1","yes","WebGPU"
Can't render this file because it is too large.
+81 -120
View File
@@ -73,15 +73,14 @@ void quantize_row_q8_0(const float * GGML_RESTRICT x, void * GGML_RESTRICT vy, i
y[i].d = GGML_CPU_FP32_TO_FP16(d);
for (int j = 0; j < 8; j++) {
const float32x4_t v = vec_mul(srcv[j], vec_splats(id));
for (int j = 0; j < 8; j += 4) {
/* Uses non-default rounding for vec_signed or vec_round */
const int32x4_t vi = vec_signed(__builtin_s390_vfisb(v, 4, 1));
const int32x4_t vi0 = vec_signed(__builtin_s390_vfisb(vec_mul(srcv[j + 0], vec_splats(id)), 4, 1));
const int32x4_t vi1 = vec_signed(__builtin_s390_vfisb(vec_mul(srcv[j + 1], vec_splats(id)), 4, 1));
const int32x4_t vi2 = vec_signed(__builtin_s390_vfisb(vec_mul(srcv[j + 2], vec_splats(id)), 4, 1));
const int32x4_t vi3 = vec_signed(__builtin_s390_vfisb(vec_mul(srcv[j + 3], vec_splats(id)), 4, 1));
y[i].qs[4*j + 0] = vec_extract(vi, 0);
y[i].qs[4*j + 1] = vec_extract(vi, 1);
y[i].qs[4*j + 2] = vec_extract(vi, 2);
y[i].qs[4*j + 3] = vec_extract(vi, 3);
vec_xst(vec_packs(vec_packs(vi0, vi1), vec_packs(vi2, vi3)), 0, y[i].qs + 4*j);
}
}
#else
@@ -121,17 +120,16 @@ void quantize_row_q8_1(const float * GGML_RESTRICT x, void * GGML_RESTRICT vy, i
int32x4_t acc = vec_splats(0);
for (int j = 0; j < 8; j++) {
const float32x4_t v = vec_mul(srcv[j], vec_splats(id));
for (int j = 0; j < 8; j += 4) {
/* Uses non-default rounding for vec_signed or vec_round */
const int32x4_t vi = vec_signed(__builtin_s390_vfisb(v, 4, 1));
const int32x4_t vi0 = vec_signed(__builtin_s390_vfisb(vec_mul(srcv[j + 0], vec_splats(id)), 4, 1));
const int32x4_t vi1 = vec_signed(__builtin_s390_vfisb(vec_mul(srcv[j + 1], vec_splats(id)), 4, 1));
const int32x4_t vi2 = vec_signed(__builtin_s390_vfisb(vec_mul(srcv[j + 2], vec_splats(id)), 4, 1));
const int32x4_t vi3 = vec_signed(__builtin_s390_vfisb(vec_mul(srcv[j + 3], vec_splats(id)), 4, 1));
y[i].qs[4*j + 0] = vec_extract(vi, 0);
y[i].qs[4*j + 1] = vec_extract(vi, 1);
y[i].qs[4*j + 2] = vec_extract(vi, 2);
y[i].qs[4*j + 3] = vec_extract(vi, 3);
vec_xst(vec_packs(vec_packs(vi0, vi1), vec_packs(vi2, vi3)), 0, y[i].qs + 4*j);
acc = vec_add(acc, vi);
acc = vec_add(acc, vec_add(vec_add(vi0, vi1), vec_add(vi2, vi3)));
}
y[i].s = GGML_CPU_FP32_TO_FP16(d * (acc[0] + acc[1] + acc[2] + acc[3]));
@@ -248,14 +246,9 @@ void ggml_vec_dot_q4_0_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const voi
const int8x16_t v_yl = vec_xl(0 , y[ib].qs);
const int8x16_t v_yh = vec_xl(QK8_0/2, y[ib].qs);
const int16x8_t v_xylso = vec_mulo(v_xls, v_yl);
const int16x8_t v_xyl = vec_meadd(v_xls, v_yl, v_xylso);
const int16x8_t v_xyhso = vec_mulo(v_xhs, v_yh);
const int16x8_t v_xyh = vec_meadd(v_xhs, v_yh, v_xyhso);
const int16x8_t v_xy_ = ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_xls, v_yl), v_xhs, v_yh);
int16x8_t v_xy_ = v_xyl + v_xyh; v_xy_ += vec_reve(v_xy_);
const float32x4_t v_xy = vec_float(vec_unpackh(v_xy_));
const float32x4_t v_xy = vec_float(vec_paddl_s16(v_xy_));
const float32x4_t v_d = vec_splats(GGML_CPU_FP16_TO_FP32(x[ib].d) * GGML_CPU_FP16_TO_FP32(y[ib].d));
acc = vec_madd(v_xy, v_d, acc);
@@ -298,9 +291,6 @@ void ggml_vec_dot_q4_1_q8_1(int n, float * GGML_RESTRICT s, size_t bs, const voi
#pragma GCC unroll 4
for (; ib < nb; ++ib) {
__builtin_prefetch(x[ib].qs, 0, 1);
__builtin_prefetch(y[ib].qs, 0, 1);
summs += GGML_CPU_FP16_TO_FP32(x[ib].m) * GGML_CPU_FP16_TO_FP32(y[ib].s);
const uint8x16_t v_x = vec_xl(0, x[ib].qs);
@@ -310,8 +300,8 @@ void ggml_vec_dot_q4_1_q8_1(int n, float * GGML_RESTRICT s, size_t bs, const voi
const int8x16_t v_yl = vec_xl(0 , y[ib].qs);
const int8x16_t v_yh = vec_xl(QK8_1/2, y[ib].qs);
const int32x4_t v_xy_ = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_xl, v_yl), v_xh, v_yh);
const float32x4_t v_xy = vec_float(v_xy_);
const int16x8_t v_xy_ = ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_xl, v_yl), v_xh, v_yh);
const float32x4_t v_xy = vec_float(vec_paddl_s16(v_xy_));
const float32x4_t v_d = vec_splats(GGML_CPU_FP16_TO_FP32(x[ib].d) * GGML_CPU_FP16_TO_FP32(y[ib].d));
@@ -379,8 +369,8 @@ void ggml_vec_dot_mxfp4_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const vo
const int8x16_t v_y1l = vec_xl(0, y1->qs);
const int8x16_t v_y1h = vec_xl(QK8_0/2, y1->qs);
const int32x4_t v_xy0 = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_x0l, v_y0l), v_x0h, v_y0h);
const int32x4_t v_xy1 = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_x1l, v_y1l), v_x1h, v_y1h);
const int32x4_t v_xy0 = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_x0l, v_y0l), v_x0h, v_y0h));
const int32x4_t v_xy1 = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_x1l, v_y1l), v_x1h, v_y1h));
const float32x4_t v_xy0f = vec_float(v_xy0);
const float32x4_t v_xy1f = vec_float(v_xy1);
@@ -407,7 +397,7 @@ void ggml_vec_dot_mxfp4_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const vo
const int8x16_t v_yl = vec_xl(0, y0->qs);
const int8x16_t v_yh = vec_xl(QK8_0/2, y0->qs);
const int32x4_t v_xy = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_xl, v_yl), v_xh, v_yh);
const int32x4_t v_xy = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_xl, v_yl), v_xh, v_yh));
const float32x4_t v_xyf = vec_float(v_xy);
const float32x4_t v_d = vec_splats(GGML_E8M0_TO_FP32_HALF(x0->e) * GGML_CPU_FP16_TO_FP32(y0->d));
@@ -502,8 +492,8 @@ void ggml_vec_dot_q5_0_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const voi
const int8x16_t v_y1l = vec_xl(0, (const int8_t *)y1->qs);
const int8x16_t v_y1h = vec_xl(QK8_0/2, (const int8_t *)y1->qs);
const int32x4_t v_xy0 = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_x0lf, v_y0l), v_x0hf, v_y0h);
const int32x4_t v_xy1 = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_x1lf, v_y1l), v_x1hf, v_y1h);
const int32x4_t v_xy0 = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_x0lf, v_y0l), v_x0hf, v_y0h));
const int32x4_t v_xy1 = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_x1lf, v_y1l), v_x1hf, v_y1h));
const float32x4_t v_xy0f = vec_float(v_xy0);
const float32x4_t v_xy1f = vec_float(v_xy1);
@@ -548,7 +538,7 @@ void ggml_vec_dot_q5_0_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const voi
const int8x16_t v_yl = vec_xl(0, (const int8_t *)y0->qs);
const int8x16_t v_yh = vec_xl(QK8_0/2, (const int8_t *)y0->qs);
const int32x4_t v_xy = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_xlf, v_yl), v_xhf, v_yh);
const int32x4_t v_xy = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_xlf, v_yl), v_xhf, v_yh));
const float32x4_t v_xyf = vec_float(v_xy);
const float32x4_t v_d = vec_splats(GGML_CPU_FP16_TO_FP32(x0->d) * GGML_CPU_FP16_TO_FP32(y0->d));
@@ -653,8 +643,8 @@ void ggml_vec_dot_q5_1_q8_1(int n, float * GGML_RESTRICT s, size_t bs, const voi
const int8x16_t v_y1l = vec_xl(0 , y1->qs);
const int8x16_t v_y1h = vec_xl(QK8_1/2, y1->qs);
const int32x4_t v_xy0 = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_x0lf, v_y0l), v_x0hf, v_y0h);
const int32x4_t v_xy1 = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_x1lf, v_y1l), v_x1hf, v_y1h);
const int32x4_t v_xy0 = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_x0lf, v_y0l), v_x0hf, v_y0h));
const int32x4_t v_xy1 = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_x1lf, v_y1l), v_x1hf, v_y1h));
const float32x4_t v_xy0f = vec_float(v_xy0);
const float32x4_t v_xy1f = vec_float(v_xy1);
@@ -701,7 +691,7 @@ void ggml_vec_dot_q5_1_q8_1(int n, float * GGML_RESTRICT s, size_t bs, const voi
const int8x16_t v_yl = vec_xl(0 , y0->qs);
const int8x16_t v_yh = vec_xl(QK8_1/2, y0->qs);
const int32x4_t v_xy = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_xlf, v_yl), v_xhf, v_yh);
const int32x4_t v_xy = vec_paddl_s16(ggml_vec_dot_s16(ggml_vec_dot_s16(vec_splats((int16_t)0), v_xlf, v_yl), v_xhf, v_yh));
const float32x4_t v_xyf = vec_float(v_xy);
const float32x4_t v_d = vec_splats(GGML_CPU_FP16_TO_FP32(x0->d) * GGML_CPU_FP16_TO_FP32(y0->d));
@@ -743,9 +733,6 @@ void ggml_vec_dot_q8_0_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const voi
#pragma GCC unroll 8
for (; ib < nb; ++ib) {
__builtin_prefetch(x[ib].qs, 0, 1);
__builtin_prefetch(y[ib].qs, 0, 1);
const int8x16_t v_xl = vec_xl(0 , x[ib].qs);
const int8x16_t v_xh = vec_xl(QK8_0/2, x[ib].qs);
const int8x16_t v_yl = vec_xl(0 , y[ib].qs);
@@ -791,7 +778,7 @@ void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
uint32_t aux[3];
uint32_t utmp[4];
const int32x4_t v_z = vec_splat_s32(0);
const int16x8_t v_z = vec_splat_s16(0);
const uint8x16_t v_3m = vec_splat_u8(0x03);
const uint8x16_t v_0c = vec_splat_u8(1);
@@ -817,7 +804,7 @@ void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
qhbits[0] = vec_xl(0 , x0h);
qhbits[1] = vec_xl(16, x0h);
int32_t isum = 0;
int32x4_t v_isum = vec_splat_s32(0);
memcpy(aux, x[i].scales, 12);
utmp[3] = ((aux[1] >> 4) & kmask2) | (((aux[2] >> 6) & kmask1) << 4);
@@ -825,11 +812,12 @@ void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
utmp[1] = (aux[1] & kmask2) | (((aux[2] >> 2) & kmask1) << 4);
utmp[0] = (aux[0] & kmask2) | (((aux[2] >> 0) & kmask1) << 4);
int8_t * scale = (int8_t *)utmp;
for (int j = 0; j < 16; ++j) scale[j] -= 32;
const int8x16_t v_scale = vec_sub(vec_xl(0, (const int8_t *)utmp), vec_splats((int8_t)32));
const int16x8_t v_scalel = vec_unpackh(v_scale);
const int16x8_t v_scaleh = vec_unpackl(v_scale);
for (int j = 0; j < QK_K/128; ++j) {
int32x4_t isum0, isum1, isum2, isum3;
const int16x8_t v_scales = j == 0 ? v_scalel : v_scaleh;
q3b[0] = vec_xl(0 , x0l);
q3b[1] = vec_xl(16, x0l);
@@ -855,17 +843,10 @@ void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
q3bytes[2] = vec_sub((int8x16_t)vec_and(vec_sr(q3b[0], 2), v_3m), (int8x16_t)q3h[2]);
q3bytes[3] = vec_sub((int8x16_t)vec_and(vec_sr(q3b[1], 2), v_3m), (int8x16_t)q3h[3]);
isum0 = ggml_vec_dot_s32(v_z, q3bytes[0], q8bytes[0]);
isum1 = ggml_vec_dot_s32(v_z, q3bytes[1], q8bytes[1]);
isum2 = ggml_vec_dot_s32(v_z, q3bytes[2], q8bytes[2]);
isum3 = ggml_vec_dot_s32(v_z, q3bytes[3], q8bytes[3]);
isum += (isum0[0] + isum0[1] + isum0[2] + isum0[3]) * scale[0];
isum += (isum1[0] + isum1[1] + isum1[2] + isum1[3]) * scale[1];
isum += (isum2[0] + isum2[1] + isum2[2] + isum2[3]) * scale[2];
isum += (isum3[0] + isum3[1] + isum3[2] + isum3[3]) * scale[3];
scale += 4;
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q3bytes[0], q8bytes[0]), vec_splat(v_scales, 0)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q3bytes[1], q8bytes[1]), vec_splat(v_scales, 1)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q3bytes[2], q8bytes[2]), vec_splat(v_scales, 2)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q3bytes[3], q8bytes[3]), vec_splat(v_scales, 3)));
q3h[0] = vec_andc(v_2c, qhbits[0]);
q3h[1] = vec_andc(v_2c, qhbits[1]);
@@ -877,17 +858,10 @@ void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
q3bytes[2] = vec_sub((int8x16_t)vec_and(vec_sr(q3b[0], 6), v_3m), (int8x16_t)q3h[2]);
q3bytes[3] = vec_sub((int8x16_t)vec_and(vec_sr(q3b[1], 6), v_3m), (int8x16_t)q3h[3]);
isum0 = ggml_vec_dot_s32(v_z, q3bytes[0], q8bytes[4]);
isum1 = ggml_vec_dot_s32(v_z, q3bytes[1], q8bytes[5]);
isum2 = ggml_vec_dot_s32(v_z, q3bytes[2], q8bytes[6]);
isum3 = ggml_vec_dot_s32(v_z, q3bytes[3], q8bytes[7]);
isum += vec_hsum_i32x4(isum0) * scale[0];
isum += vec_hsum_i32x4(isum1) * scale[1];
isum += vec_hsum_i32x4(isum2) * scale[2];
isum += vec_hsum_i32x4(isum3) * scale[3];
scale += 4;
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q3bytes[0], q8bytes[4]), vec_splat(v_scales, 4)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q3bytes[1], q8bytes[5]), vec_splat(v_scales, 5)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q3bytes[2], q8bytes[6]), vec_splat(v_scales, 6)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q3bytes[3], q8bytes[7]), vec_splat(v_scales, 7)));
if (j == 0) {
qhbits[0] = vec_sr(qhbits[0], 4);
@@ -895,7 +869,7 @@ void ggml_vec_dot_q3_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
}
}
sum += d * isum;
sum += d * vec_hsum_i32x4(v_isum);
}
*s = sum;
@@ -931,7 +905,7 @@ void ggml_vec_dot_q4_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
#if defined(__VXE__) || defined(__VXE2__)
const uint8x16_t v_lm = vec_splat_u8(0x0F);
const int32x4_t v_z = vec_splat_s32(0);
const int16x8_t v_z = vec_splat_s16(0);
uint8x16_t v_x[2];
int8x16_t v_xl[2];
@@ -966,8 +940,7 @@ void ggml_vec_dot_q4_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
const uint8_t * GGML_RESTRICT x0 = x[i].qs;
const int8_t * GGML_RESTRICT y0 = y[i].qs;
int32_t sumi1 = 0;
int32_t sumi2 = 0;
int32x4_t v_sumi = vec_splat_s32(0);
for (int j = 0; j < QK_K/64; ++j) {
v_x[0] = vec_xl(0 , x0);
@@ -981,8 +954,8 @@ void ggml_vec_dot_q4_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
v_xl[0] = (int8x16_t)vec_and(v_x[0], v_lm);
v_xl[1] = (int8x16_t)vec_and(v_x[1], v_lm);
const int32x4_t p1 = ggml_vec_dot_s32(ggml_vec_dot_s32(v_z, v_xl[0], v_y[0]), v_xl[1], v_y[1]);
sumi1 += vec_hsum_i32x4(p1) * scales[2*j+0];
const int16x8_t v_p1 = ggml_vec_dot_s16(ggml_vec_dot_s16(v_z, v_xl[0], v_y[0]), v_xl[1], v_y[1]);
v_sumi = vec_add(v_sumi, ggml_vec_madd_s16(v_p1, vec_splats((int16_t)scales[2*j+0])));
v_y[0] = vec_xl(0 , y0);
v_y[1] = vec_xl(16, y0);
@@ -991,11 +964,11 @@ void ggml_vec_dot_q4_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
v_xl[0] = (int8x16_t)vec_sr(v_x[0], 4);
v_xl[1] = (int8x16_t)vec_sr(v_x[1], 4);
const int32x4_t p2 = ggml_vec_dot_s32(ggml_vec_dot_s32(v_z, v_xl[0], v_y[0]), v_xl[1], v_y[1]);
sumi2 += vec_hsum_i32x4(p2) * scales[2*j+1];
const int16x8_t v_p2 = ggml_vec_dot_s16(ggml_vec_dot_s16(v_z, v_xl[0], v_y[0]), v_xl[1], v_y[1]);
v_sumi = vec_add(v_sumi, ggml_vec_madd_s16(v_p2, vec_splats((int16_t)scales[2*j+1])));
}
sumf += d * (sumi1 + sumi2);
sumf += d * vec_hsum_i32x4(v_sumi);
}
*s = sumf;
@@ -1036,7 +1009,7 @@ void ggml_vec_dot_q5_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
const uint8x16_t v_1m = vec_splat_u8(0x01);
const uint8x16_t v_2m = vec_splat_u8(0x02);
const int32x4_t v_z = vec_splat_s32(0);
const int16x8_t v_z = vec_splat_s16(0);
const uchar8x16_t v_minsm = {
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
@@ -1083,7 +1056,7 @@ void ggml_vec_dot_q5_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
v_xh[0] = vec_xl(0 , x0h);
v_xh[1] = vec_xl(16, x0h);
int32_t sumi = 0;
int32x4_t v_sumi = vec_splat_s32(0);
for (int j = 0; j < QK_K/64; ++j) {
v_xl[0] = vec_xl(0 , x0l);
v_xl[1] = vec_xl(16, x0l);
@@ -1107,14 +1080,14 @@ void ggml_vec_dot_q5_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
q5b[2] = (int8x16_t)vec_or(vec_sr(v_xl[0], 4), q5h[2]);
q5b[3] = (int8x16_t)vec_or(vec_sr(v_xl[1], 4), q5h[3]);
int32x4_t sumi0 = ggml_vec_dot_s32(ggml_vec_dot_s32(v_z, q5b[0], v_y[0]), q5b[1], v_y[1]);
int32x4_t sumi1 = ggml_vec_dot_s32(ggml_vec_dot_s32(v_z, q5b[2], v_y[2]), q5b[3], v_y[3]);
const int16x8_t v_p0 = ggml_vec_dot_s16(ggml_vec_dot_s16(v_z, q5b[0], v_y[0]), q5b[1], v_y[1]);
const int16x8_t v_p1 = ggml_vec_dot_s16(ggml_vec_dot_s16(v_z, q5b[2], v_y[2]), q5b[3], v_y[3]);
sumi += vec_hsum_i32x4(sumi0) * *scales++;
sumi += vec_hsum_i32x4(sumi1) * *scales++;
v_sumi = vec_add(v_sumi, ggml_vec_madd_s16(v_p0, vec_splats((int16_t)*scales++)));
v_sumi = vec_add(v_sumi, ggml_vec_madd_s16(v_p1, vec_splats((int16_t)*scales++)));
}
sumf += d * sumi - dmin * mins;
sumf += d * vec_hsum_i32x4(v_sumi) - dmin * mins;
}
*s = sumf;
@@ -1151,7 +1124,7 @@ void ggml_vec_dot_q6_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
const uint8x16_t v_lm = vec_splat_u8(0x0F);
const uint8x16_t v_um = vec_splat_u8(0x03);
const int32x4_t v_z = vec_splat_s32(0);
const int16x8_t v_z = vec_splat_s16(0);
int8x16_t q6b[4];
uint8x16_t q6h[4];
@@ -1167,12 +1140,10 @@ void ggml_vec_dot_q6_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
const uint8_t * GGML_RESTRICT x0h = x[i].qh;
const int8_t * GGML_RESTRICT y0 = y[i].qs;
const int8_t * GGML_RESTRICT scale = x[i].scales;
const int16x8_t v_ysumsl = vec_xl(0 , y[i].bsums);
const int16x8_t v_ysumsh = vec_xl(16, y[i].bsums);
const int8x16_t v_scale = vec_xl(0, scale);
const int8x16_t v_scale = vec_xl(0, x[i].scales);
const int16x8_t v_scalel = vec_unpackh(v_scale);
const int16x8_t v_scaleh = vec_unpackl(v_scale);
@@ -1182,10 +1153,10 @@ void ggml_vec_dot_q6_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
const int32x4_t v_minsh = vec_meadd(v_ysumsh, v_scaleh, v_minsho);
const int32x4_t v_mins = vec_add(v_minsl, v_minsh);
const int32_t mins = vec_hsum_i32x4(v_mins);
int32_t isum = 0;
int32x4_t v_isum = vec_splat_s32(0);
for (int j = 0; j < QK_K/128; ++j) {
const int16x8_t v_scales = j == 0 ? v_scalel : v_scaleh;
// Load model upper 2 bits
v_xh[0] = vec_xl(0 , x0h);
v_xh[1] = vec_xl(16, x0h);
@@ -1217,18 +1188,10 @@ void ggml_vec_dot_q6_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
q6b[2] = (int8x16_t)(vec_or(vec_and(v_xl[2], v_lm), q6h[2]));
q6b[3] = (int8x16_t)(vec_or(vec_and(v_xl[3], v_lm), q6h[3]));
int32x4_t summs0 = ggml_vec_dot_s32(v_z, q6b[0], v_y[0]);
int32x4_t summs1 = ggml_vec_dot_s32(v_z, q6b[1], v_y[1]);
int32x4_t summs2 = ggml_vec_dot_s32(v_z, q6b[2], v_y[2]);
int32x4_t summs3 = ggml_vec_dot_s32(v_z, q6b[3], v_y[3]);
isum += vec_hsum_i32x4(summs0) * scale[0] +
vec_hsum_i32x4(summs1) * scale[1] +
vec_hsum_i32x4(summs2) * scale[2] +
vec_hsum_i32x4(summs3) * scale[3];
scale += 4;
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q6b[0], v_y[0]), vec_splat(v_scales, 0)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q6b[1], v_y[1]), vec_splat(v_scales, 1)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q6b[2], v_y[2]), vec_splat(v_scales, 2)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q6b[3], v_y[3]), vec_splat(v_scales, 3)));
// Load activation quants
v_y[0] = vec_xl(0 , y0);
@@ -1251,20 +1214,15 @@ void ggml_vec_dot_q6_K_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const voi
q6b[2] = (int8x16_t)(vec_or(vec_sr(v_xl[2], 4), q6h[2]));
q6b[3] = (int8x16_t)(vec_or(vec_sr(v_xl[3], 4), q6h[3]));
summs0 = ggml_vec_dot_s32(v_z, q6b[0], v_y[0]);
summs1 = ggml_vec_dot_s32(v_z, q6b[1], v_y[1]);
summs2 = ggml_vec_dot_s32(v_z, q6b[2], v_y[2]);
summs3 = ggml_vec_dot_s32(v_z, q6b[3], v_y[3]);
isum += vec_hsum_i32x4(summs0) * scale[0] +
vec_hsum_i32x4(summs1) * scale[1] +
vec_hsum_i32x4(summs2) * scale[2] +
vec_hsum_i32x4(summs3) * scale[3];
scale += 4;
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q6b[0], v_y[0]), vec_splat(v_scales, 4)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q6b[1], v_y[1]), vec_splat(v_scales, 5)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q6b[2], v_y[2]), vec_splat(v_scales, 6)));
v_isum = vec_add(v_isum, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, q6b[3], v_y[3]), vec_splat(v_scales, 7)));
}
sum += d_all * y[i].d * (isum - 32 * mins);
v_isum = vec_sub(v_isum, vec_sl(v_mins, 5));
sum += d_all * y[i].d * vec_hsum_i32x4(v_isum);
}
*s = sum;
@@ -1477,6 +1435,7 @@ void ggml_vec_dot_iq4_xs_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const v
#if defined(__VXE__) || defined(__VXE2__)
const int8x16_t v_k = vec_xl(0, kvalues_iq4nl);
const uint8x16_t v_m = vec_splat_u8(0x0F);
const int16x8_t v_z = vec_splat_s16(0);
float sumf = 0;
@@ -1486,7 +1445,7 @@ void ggml_vec_dot_iq4_xs_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const v
uint16_t h = x[ibl].scales_h;
int sumi1 = 0, sumi2 = 0;
int32x4_t v_sumi = vec_splat_s32(0);
for (int ib = 0; ib < QK_K/64; ++ib) {
const uint8x16_t v_x0 = vec_xl(0 , q4);
const uint8x16_t v_x1 = vec_xl(QK4_NL/2, q4);
@@ -1508,19 +1467,21 @@ void ggml_vec_dot_iq4_xs_q8_K(int n, float * GGML_RESTRICT s, size_t bs, const v
const int8x16_t v_y3 = vec_xl(48, q8);
q8 += 64;
int32x4_t vsumi0 = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_x0l, v_y0), v_x0h, v_y1);
int32x4_t vsumi1 = ggml_vec_dot_s32(ggml_vec_dot_s32(vec_splats(0), v_x1l, v_y2), v_x1h, v_y3);
int ls1 = ((x[ibl].scales_l[ib] & 0xF) | ((h << 4) & 0x30)) - 32;
int ls2 = ((x[ibl].scales_l[ib] >> 4) | ((h << 2) & 0x30)) - 32;
h >>= 4;
sumi1 += vec_hsum_i32x4(vsumi0) * ls1;
sumi2 += vec_hsum_i32x4(vsumi1) * ls2;
const int16x8_t v_ls1 = vec_splats((int16_t)ls1);
const int16x8_t v_ls2 = vec_splats((int16_t)ls2);
v_sumi = vec_add(v_sumi, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, v_x0l, v_y0), v_ls1));
v_sumi = vec_add(v_sumi, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, v_x0h, v_y1), v_ls1));
v_sumi = vec_add(v_sumi, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, v_x1l, v_y2), v_ls2));
v_sumi = vec_add(v_sumi, ggml_vec_madd_s16(ggml_vec_dot_s16(v_z, v_x1h, v_y3), v_ls2));
}
sumf += GGML_CPU_FP16_TO_FP32(x[ibl].d) * y[ibl].d * (sumi1 + sumi2);
sumf += GGML_CPU_FP16_TO_FP32(x[ibl].d) * y[ibl].d * vec_hsum_i32x4(v_sumi);
}
*s = sumf;
+23 -17
View File
@@ -112,17 +112,20 @@ void ggml_gemv_q4_0_4x4_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const vo
const int8_t * y_lo = a_ptr[l].qs;
const int8_t * y_hi = y_lo + qk / 2;
int16x8_t v_sumi = vec_splats((int16_t)0);
const int16x8_t v_zero = vec_splats((int16_t)0);
v_sumi = ggml_vec_dot_s16(v_sumi, v_x0l, ggml_vec_xl_s8x4_splat(y_lo + 0));
v_sumi = ggml_vec_dot_s16(v_sumi, v_x1l, ggml_vec_xl_s8x4_splat(y_lo + 4));
v_sumi = ggml_vec_dot_s16(v_sumi, v_x2l, ggml_vec_xl_s8x4_splat(y_lo + 8));
v_sumi = ggml_vec_dot_s16(v_sumi, v_x3l, ggml_vec_xl_s8x4_splat(y_lo + 12));
// separate sums, a long multiply-add chain is slow
int16x8_t v_sumi0 = ggml_vec_dot_s16(v_zero, v_x0l, ggml_vec_xl_s8x4_splat(y_lo + 0));
int16x8_t v_sumi1 = ggml_vec_dot_s16(v_zero, v_x1l, ggml_vec_xl_s8x4_splat(y_lo + 4));
int16x8_t v_sumi2 = ggml_vec_dot_s16(v_zero, v_x2l, ggml_vec_xl_s8x4_splat(y_lo + 8));
int16x8_t v_sumi3 = ggml_vec_dot_s16(v_zero, v_x3l, ggml_vec_xl_s8x4_splat(y_lo + 12));
v_sumi = ggml_vec_dot_s16(v_sumi, v_x0h, ggml_vec_xl_s8x4_splat(y_hi + 0));
v_sumi = ggml_vec_dot_s16(v_sumi, v_x1h, ggml_vec_xl_s8x4_splat(y_hi + 4));
v_sumi = ggml_vec_dot_s16(v_sumi, v_x2h, ggml_vec_xl_s8x4_splat(y_hi + 8));
v_sumi = ggml_vec_dot_s16(v_sumi, v_x3h, ggml_vec_xl_s8x4_splat(y_hi + 12));
v_sumi0 = ggml_vec_dot_s16(v_sumi0, v_x0h, ggml_vec_xl_s8x4_splat(y_hi + 0));
v_sumi1 = ggml_vec_dot_s16(v_sumi1, v_x1h, ggml_vec_xl_s8x4_splat(y_hi + 4));
v_sumi2 = ggml_vec_dot_s16(v_sumi2, v_x2h, ggml_vec_xl_s8x4_splat(y_hi + 8));
v_sumi3 = ggml_vec_dot_s16(v_sumi3, v_x3h, ggml_vec_xl_s8x4_splat(y_hi + 12));
const int16x8_t v_sumi = vec_add(vec_add(v_sumi0, v_sumi1), vec_add(v_sumi2, v_sumi3));
const float32x4_t v_yd = vec_splats(GGML_CPU_FP16_TO_FP32(a_ptr[l].d));
const float32x4_t v_xd = ggml_vec_xl_f16x4_finite(b_ptr[l].d);
@@ -162,6 +165,8 @@ void ggml_gemm_q4_0_4x4_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const vo
}
for (int l = 0; l < nb; l++) {
const int16x8_t v_zero = vec_splats((int16_t)0);
int16x8_t v_sumi0 = vec_splats((int16_t)0);
int16x8_t v_sumi1 = vec_splats((int16_t)0);
int16x8_t v_sumi2 = vec_splats((int16_t)0);
@@ -175,15 +180,16 @@ void ggml_gemm_q4_0_4x4_q8_0(int n, float * GGML_RESTRICT s, size_t bs, const vo
const int8_t * y_lo = a_ptr[l].qs + 16 * k;
const int8_t * y_hi = y_lo + qk / 2 * 4;
v_sumi0 = ggml_vec_dot_s16(v_sumi0, v_xl, ggml_vec_xl_s8x4_splat(y_lo + 0));
v_sumi1 = ggml_vec_dot_s16(v_sumi1, v_xl, ggml_vec_xl_s8x4_splat(y_lo + 4));
v_sumi2 = ggml_vec_dot_s16(v_sumi2, v_xl, ggml_vec_xl_s8x4_splat(y_lo + 8));
v_sumi3 = ggml_vec_dot_s16(v_sumi3, v_xl, ggml_vec_xl_s8x4_splat(y_lo + 12));
// add each product pair with vec_add, a long multiply-add chain is slow
const int16x8_t v_xyl0 = ggml_vec_dot_s16(v_zero, v_xl, ggml_vec_xl_s8x4_splat(y_lo + 0));
const int16x8_t v_xyl1 = ggml_vec_dot_s16(v_zero, v_xl, ggml_vec_xl_s8x4_splat(y_lo + 4));
const int16x8_t v_xyl2 = ggml_vec_dot_s16(v_zero, v_xl, ggml_vec_xl_s8x4_splat(y_lo + 8));
const int16x8_t v_xyl3 = ggml_vec_dot_s16(v_zero, v_xl, ggml_vec_xl_s8x4_splat(y_lo + 12));
v_sumi0 = ggml_vec_dot_s16(v_sumi0, v_xh, ggml_vec_xl_s8x4_splat(y_hi + 0));
v_sumi1 = ggml_vec_dot_s16(v_sumi1, v_xh, ggml_vec_xl_s8x4_splat(y_hi + 4));
v_sumi2 = ggml_vec_dot_s16(v_sumi2, v_xh, ggml_vec_xl_s8x4_splat(y_hi + 8));
v_sumi3 = ggml_vec_dot_s16(v_sumi3, v_xh, ggml_vec_xl_s8x4_splat(y_hi + 12));
v_sumi0 = vec_add(v_sumi0, ggml_vec_dot_s16(v_xyl0, v_xh, ggml_vec_xl_s8x4_splat(y_hi + 0)));
v_sumi1 = vec_add(v_sumi1, ggml_vec_dot_s16(v_xyl1, v_xh, ggml_vec_xl_s8x4_splat(y_hi + 4)));
v_sumi2 = vec_add(v_sumi2, ggml_vec_dot_s16(v_xyl2, v_xh, ggml_vec_xl_s8x4_splat(y_hi + 8)));
v_sumi3 = vec_add(v_sumi3, ggml_vec_dot_s16(v_xyl3, v_xh, ggml_vec_xl_s8x4_splat(y_hi + 12)));
}
const float32x4_t v_yd = __lzs_f16cx4_load(a_ptr[l].d);
+8 -3
View File
@@ -487,7 +487,7 @@ inline static int16x8_t vec_padd_s16(int16x8_t a, int16x8_t b) {
inline static int32x4_t vec_paddl_s16(int16x8_t a) {
const int16x8_t v_ones = vec_splats((int16_t)1);
return vec_mule(a, v_ones) + vec_mulo(a, v_ones);
return vec_meadd(a, v_ones, vec_mulo(a, v_ones));
}
/**
@@ -507,9 +507,14 @@ inline static int16x8_t ggml_vec_dot_s16(int16x8_t acc, int8x16_t a, int8x16_t b
return vec_meadd(a, b, vec_moadd(a, b, acc));
}
// a * b, each pair of 16-bit products summed into one 32-bit lane
inline static int32x4_t ggml_vec_madd_s16(int16x8_t a, int16x8_t b) {
return vec_meadd(a, b, vec_mulo(a, b));
}
inline static int32x4_t ggml_vec_dot_s32(int32x4_t acc, int8x16_t a, int8x16_t b) {
const int16x8_t p = vec_mule(a, b) + vec_mulo(a, b);
return acc + (vec_unpackh(p) + vec_unpackl(p));
const int16x8_t p = vec_meadd(a, b, vec_mulo(a, b));
return acc + ggml_vec_madd_s16(p, vec_splats((int16_t)1));
}
#endif
+2 -4
View File
@@ -1380,10 +1380,8 @@ class tinyBLAS_Q0_VXE {
static constexpr bool has_min = std::is_same<TB, block_q8_1>::value;
static int32x4_t dot_s8_wide(int8x16_t v_x, int8x16_t v_y) {
const int16x8_t v_even = vec_mule(v_x, v_y);
const int16x8_t v_odd = vec_mulo(v_x, v_y);
// Two (-128) * (-128) products can overflow a signed 16-bit sum.
return vec_unpackh(v_even) + vec_unpackl(v_even) + vec_unpackh(v_odd) + vec_unpackl(v_odd);
// v_y is never -128, so the sum of two products fits in 16 bits
return vec_paddl_s16(vec_meadd(v_x, v_y, vec_mulo(v_x, v_y)));
}
static int32x4_t dot(int8x16_t v_xl, int8x16_t v_xh, int8x16_t v_yl, int8x16_t v_yh) {
+49 -70
View File
@@ -198,9 +198,7 @@ static void ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1(ggml_backend_cuda_con
ggml_cuda_flash_attn_ext_mma_f16_case<DKQ, DV, 64/ncols2, ncols2, type_K, type_V>(ctx, dst);
}
template <int DKQ, int DV, ggml_type type_K, ggml_type type_V>
static void ggml_cuda_flash_attn_ext_mma_f16_switch_ncols2(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
const int cc = ggml_cuda_info().devices[ggml_cuda_get_device()].cc;
static int ggml_cuda_flash_attn_ext_mma_f16_get_ncols2(const int cc, const ggml_tensor * dst) {
const ggml_tensor * KQV = dst;
const ggml_tensor * Q = dst->src[0];
const ggml_tensor * K = dst->src[1];
@@ -230,71 +228,56 @@ static void ggml_cuda_flash_attn_ext_mma_f16_switch_ncols2(ggml_backend_cuda_con
}
}
if (!use_gqa_opt) {
return 1;
}
GGML_ASSERT(Q->ne[2] % K->ne[2] == 0);
const int gqa_ratio = Q->ne[2] / K->ne[2];
// On Volta the GQA optimizations aren't as impactful vs. minimizing wasted compute:
if (cc == GGML_CUDA_CC_VOLTA) {
if (use_gqa_opt && gqa_ratio % 8 == 0) {
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 8, type_K, type_V>(ctx, dst);
return;
}
const int ncols2_max = Q->ne[0] == 320 ? 32 : ((Q->ne[0] == 576 || Q->ne[0] == 192) ? 16 : 8);
if (use_gqa_opt && gqa_ratio % 4 == 0) {
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 4, type_K, type_V>(ctx, dst);
return;
}
if constexpr (DKQ <= 256) {
if (use_gqa_opt && gqa_ratio % 2 == 0) {
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 2, type_K, type_V>(ctx, dst);
return;
}
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 1, type_K, type_V>(ctx, dst);
return;
} else {
GGML_ABORT("fatal error");
// On Volta and RDNA it is preferable to minimize wasted compute vs. duplicate I/O for the mask:
if (cc == GGML_CUDA_CC_VOLTA || (amd_wmma_available(cc) && gqa_ratio % 2 == 0)) {
int ncols2 = 1;
while (gqa_ratio % (2*ncols2) == 0 && ncols2 < ncols2_max) {
ncols2 *= 2;
}
return ncols2;
}
// On RDNA it is preferable to minimize wasted compute vs. duplicate I/O for the mask.
if (amd_wmma_available(cc)) {
if (use_gqa_opt && gqa_ratio % 8 == 0) {
int ncols2 = 1;
while (gqa_ratio > ncols2 && ncols2 < ncols2_max) {
ncols2 *= 2;
}
return ncols2;
}
template <int DKQ, int DV, ggml_type type_K, ggml_type type_V>
static void ggml_cuda_flash_attn_ext_mma_f16_switch_ncols2(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
const int cc = ggml_cuda_info().devices[ggml_cuda_get_device()].cc;
const int ncols2 = ggml_cuda_flash_attn_ext_mma_f16_get_ncols2(cc, dst);
switch (ncols2) {
case 8:
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 8, type_K, type_V>(ctx, dst);
return;
}
if (use_gqa_opt && gqa_ratio % 4 == 0) {
break;
case 4:
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 4, type_K, type_V>(ctx, dst);
return;
}
if (use_gqa_opt && gqa_ratio % 2 == 0) {
break;
case 2:
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 2, type_K, type_V>(ctx, dst);
return;
}
}
if (use_gqa_opt && gqa_ratio > 4) {
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 8, type_K, type_V>(ctx, dst);
return;
}
if (use_gqa_opt && gqa_ratio > 2) {
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 4, type_K, type_V>(ctx, dst);
return;
}
if (use_gqa_opt && gqa_ratio > 1) {
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 2, type_K, type_V>(ctx, dst);
return;
}
if constexpr (DKQ <= 256) {
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 1, type_K, type_V>(ctx, dst);
} else {
GGML_ABORT("fatal error");
break;
case 1:
if constexpr (DKQ <= 256) {
ggml_cuda_flash_attn_ext_mma_f16_switch_ncols1<DKQ, DV, 1, type_K, type_V>(ctx, dst);
break;
} else {
GGML_ABORT("fatal error");
}
default:
GGML_ABORT("fatal error");
}
}
@@ -757,20 +740,16 @@ static best_fattn_kernel ggml_cuda_get_best_fattn_kernel(const int device, const
return BEST_FATTN_KERNEL_MMA_F16;
}
const int ncols2_max = Q->ne[0] == 320 ? 32 : ((Q->ne[0] == 576 || Q->ne[0] == 192) ? 16 : 8);
int gqa_ratio_eff = 1;
while (max_bias == 0.0f && (!mask || mask->ne[2] == 1) && gqa_ratio % (2*gqa_ratio_eff) == 0 && gqa_ratio_eff < ncols2_max) {
gqa_ratio_eff *= 2;
}
const int ncols2 = ggml_cuda_flash_attn_ext_mma_f16_get_ncols2(cc, dst);
// the tile kernel for DKQ=576 only has the ncols2 = 4 and 16 variants
const best_fattn_kernel tile_kernel = Q->ne[0] == 576 && gqa_ratio % 4 != 0 ? BEST_FATTN_KERNEL_NONE : BEST_FATTN_KERNEL_TILE;
if (volta_mma_available(cc) && Q->ne[0] != 40 && Q->ne[0] != 72) {
if (can_use_vector_kernel && Q->ne[1] * gqa_ratio_eff <= 2) {
if (can_use_vector_kernel && Q->ne[1] * ncols2 <= 2) {
return BEST_FATTN_KERNEL_VEC;
}
if (Q->ne[1] * gqa_ratio_eff <= 16) {
if (Q->ne[1] * ncols2 <= 16) {
return tile_kernel; // On Volta tensor cores are only faster for sufficiently large matrices.
}
return BEST_FATTN_KERNEL_MMA_F16;
@@ -783,23 +762,23 @@ static best_fattn_kernel ggml_cuda_get_best_fattn_kernel(const int device, const
// AMD MFMA needs a certain minimum batch size to outscale the tile kernel for large head sizes.
if (amd_mfma_available(cc) && Q->ne[0] != 40 && Q->ne[0] != 72) {
if ((Q->ne[0] <= 64 && Q->ne[1] * gqa_ratio_eff > 8)) {
if ((Q->ne[0] <= 64 && Q->ne[1] * ncols2 > 8)) {
return BEST_FATTN_KERNEL_MMA_F16;
}
if ((Q->ne[0] <= 128 && Q->ne[1] * gqa_ratio_eff > 16)) {
if ((Q->ne[0] <= 128 && Q->ne[1] * ncols2 > 16)) {
return BEST_FATTN_KERNEL_MMA_F16;
}
if ((Q->ne[0] <= 256 && Q->ne[1] * gqa_ratio_eff > 64)) {
if ((Q->ne[0] <= 256 && Q->ne[1] * ncols2 > 64)) {
return BEST_FATTN_KERNEL_MMA_F16;
}
if (Q->ne[0] > 256 && gqa_opt_applies && Q->ne[1] * gqa_ratio_eff > 128) {
if (Q->ne[0] > 256 && gqa_opt_applies && Q->ne[1] * ncols2 > 128) {
return BEST_FATTN_KERNEL_MMA_F16;
}
}
// AMD WMMA is faster than the tile kernel if the wide tiles with high arithmetic intensity can be utilized.
if ((amd_wmma_available(cc) && gqa_opt_applies && Q->ne[0] <= 256) && Q->ne[0] != 40 && Q->ne[0] != 72 &&
Q->ne[1] * gqa_ratio_eff > (Q->ne[0] <= 128 ? 8 : 16)) {
Q->ne[1] * ncols2 > (Q->ne[0] <= 128 ? 8 : 16)) {
return BEST_FATTN_KERNEL_MMA_F16;
}
@@ -1273,6 +1273,7 @@ class ggml_webgpu_shader_lib {
std::unordered_map<int, webgpu_pipeline> argsort_merge_pipelines; // key is order
std::unordered_map<int, webgpu_pipeline> cumsum_pipelines; // key is fixed, no variants yet
std::unordered_map<int, webgpu_pipeline> col2im_1d_pipelines; // key is fixed, no variants yet
std::unordered_map<int, webgpu_pipeline> conv_transpose_1d_pipelines; // key is kernel type
std::unordered_map<int, webgpu_pipeline> arange_pipelines; // key is fixed, no variants yet
std::unordered_map<int, webgpu_pipeline> count_equal_pipelines; // key is src_overlap
std::unordered_map<int, webgpu_pipeline> timestep_embedding_pipelines; // key is fixed, no variants yet
@@ -2144,6 +2145,26 @@ class ggml_webgpu_shader_lib {
return pipeline;
}
webgpu_pipeline get_conv_transpose_1d_pipeline(const ggml_webgpu_shader_lib_context & context) {
const ggml_type type = context.src0->type;
auto it = conv_transpose_1d_pipelines.find(type);
if (it != conv_transpose_1d_pipelines.end()) {
return it->second;
}
const uint32_t tile = 16;
std::vector<std::string> defines = {
"TILE=" + std::to_string(tile),
type == GGML_TYPE_F16 ? "KERNEL_TYPE=f16" : "KERNEL_TYPE=f32",
};
auto processed = preprocessor.preprocess(wgsl_conv_transpose_1d, defines);
auto decisions = std::make_shared<ggml_webgpu_generic_shader_decisions>();
decisions->wg_size = tile;
webgpu_pipeline pipeline = ggml_webgpu_create_pipeline(device, processed, "conv_transpose_1d");
pipeline.context = decisions;
return conv_transpose_1d_pipelines.emplace(type, std::move(pipeline)).first->second;
}
webgpu_pipeline get_pad_pipeline(const ggml_webgpu_shader_lib_context & context) {
ggml_webgpu_pad_pipeline_key key = {};
key.reflect = context.dst->op == GGML_OP_PAD_REFLECT_1D;
+47
View File
@@ -934,6 +934,46 @@ static webgpu_encoded_op ggml_webgpu_col2im_1d(webgpu_context & ctx, ggml_tensor
return ggml_backend_webgpu_build(ctx, pipeline, params, entries, wg_x, wg_y);
}
static webgpu_encoded_op ggml_webgpu_conv_transpose_1d(webgpu_context & ctx,
ggml_tensor * kernel,
ggml_tensor * input,
ggml_tensor * dst) {
ggml_webgpu_shader_lib_context shader_lib_ctx = {};
shader_lib_ctx.src0 = kernel;
webgpu_pipeline pipeline = ctx->shader_lib->get_conv_transpose_1d_pipeline(shader_lib_ctx);
const auto * decisions = static_cast<const ggml_webgpu_generic_shader_decisions *>(pipeline.context.get());
const uint32_t tile = decisions->wg_size;
const uint32_t stride = ggml_get_op_params_i32(dst, 0);
const uint32_t phases = std::min(stride, (uint32_t) dst->ne[0]);
const uint32_t time_tiles = CEIL_DIV(CEIL_DIV(dst->ne[0], stride), tile);
const uint32_t total_tiles = time_tiles * phases * CEIL_DIV(dst->ne[1], tile);
std::vector<uint32_t> params = {
(uint32_t) (ggml_webgpu_tensor_misalignment(ctx, kernel) / ggml_type_size(kernel->type)),
(uint32_t) (ggml_webgpu_tensor_misalignment(ctx, input) / sizeof(float)),
(uint32_t) (ggml_webgpu_tensor_misalignment(ctx, dst) / sizeof(float)),
(uint32_t) kernel->ne[0],
(uint32_t) kernel->ne[1],
(uint32_t) kernel->ne[2],
(uint32_t) input->ne[0],
(uint32_t) dst->ne[0],
stride,
phases,
time_tiles,
total_tiles,
};
std::vector<wgpu::BindGroupEntry> entries = {
ggml_webgpu_make_tensor_bind_group_entry(ctx, 0, kernel),
ggml_webgpu_make_tensor_bind_group_entry(ctx, 1, input),
ggml_webgpu_make_tensor_bind_group_entry(ctx, 2, dst),
};
uint32_t wg_x;
uint32_t wg_y;
compute_2d_workgroups(total_tiles, ctx->global_ctx->capabilities.limits.maxComputeWorkgroupsPerDimension, wg_x,
wg_y);
return ggml_backend_webgpu_build(ctx, pipeline, params, entries, wg_x, wg_y);
}
static webgpu_encoded_op ggml_webgpu_pad(webgpu_context & ctx, ggml_tensor * src, ggml_tensor * dst) {
ggml_webgpu_shader_lib_context shader_lib_ctx = {};
shader_lib_ctx.src0 = src;
@@ -3822,6 +3862,8 @@ static std::optional<webgpu_encoded_op> ggml_webgpu_encode(webgpu_context ctx,
return ggml_webgpu_pool2d(ctx, src0, node);
case GGML_OP_COL2IM_1D:
return ggml_webgpu_col2im_1d(ctx, src0, node);
case GGML_OP_CONV_TRANSPOSE_1D:
return ggml_webgpu_conv_transpose_1d(ctx, src0, src1, node);
case GGML_OP_ROLL:
case GGML_OP_PAD_REFLECT_1D:
case GGML_OP_PAD:
@@ -5417,6 +5459,11 @@ static bool ggml_backend_webgpu_device_supports_op(ggml_backend_dev_t dev, const
supports_op = src0->type == GGML_TYPE_I32 && src1->type == GGML_TYPE_I32 && ggml_is_contiguous(src0) &&
ggml_is_contiguous(src1);
break;
case GGML_OP_CONV_TRANSPOSE_1D:
supports_op = (src0->type == GGML_TYPE_F32 || src0->type == GGML_TYPE_F16) && src1->type == GGML_TYPE_F32 &&
op->type == GGML_TYPE_F32 && ggml_is_contiguous(src0) && ggml_is_contiguous(src1) &&
ggml_get_op_params_i32(op, 0) > 0;
break;
case GGML_OP_COL2IM_1D:
supports_op = op->type == GGML_TYPE_F32 && src0->type == GGML_TYPE_F32 && ggml_is_contiguous(src0) &&
ggml_is_contiguous(op);
@@ -0,0 +1,89 @@
enable f16;
@group(0) @binding(0)
var<storage, read_write> kernel: array<KERNEL_TYPE>;
@group(0) @binding(1)
var<storage, read_write> input: array<f32>;
@group(0) @binding(2)
var<storage, read_write> output: array<f32>;
struct Params {
kernel_offset: u32,
input_offset: u32,
output_offset: u32,
kernel_size: u32,
output_channels: u32,
input_channels: u32,
input_length: u32,
output_length: u32,
stride: u32,
phases: u32,
time_tiles: u32,
total_tiles: u32,
};
@group(0) @binding(3)
var<uniform> params: Params;
var<workgroup> input_tile: array<array<f32, TILE>, TILE>;
var<workgroup> kernel_tile: array<array<f32, TILE>, TILE>;
@compute @workgroup_size(TILE, TILE)
fn main(@builtin(workgroup_id) group: vec3<u32>,
@builtin(num_workgroups) groups: vec3<u32>,
@builtin(local_invocation_id) lane: vec3<u32>) {
let tile = group.x + groups.x * group.y;
if (tile >= params.total_tiles) {
return;
}
// Each tile covers one residue modulo stride, so its columns share the same kernel taps.
let time_base = tile % params.time_tiles * TILE;
let phase = tile / params.time_tiles % params.phases;
let channel_base = tile / params.time_tiles / params.phases * TILE;
let row = channel_base + lane.y;
let weight_row = channel_base + lane.x;
let time = time_base + lane.x;
var sum = 0.0;
if (phase < params.kernel_size) {
let first = time_base + 1u - min(time_base + 1u, params.input_length);
let last = min(time_base + TILE - 1u, (params.kernel_size - 1u - phase) / params.stride);
// Visit overlapping input positions in ascending order.
for (var step = last + 1u; step > first; ) {
step -= 1u;
let tap = phase + step * params.stride;
let valid_time = time >= step && time - step < params.input_length;
var dot = 0.0;
for (var base = 0u; base < params.input_channels; base += TILE) {
let col = base + lane.y;
var value = 0.0;
var weight = 0.0;
if (col < params.input_channels) {
if (valid_time) {
value = input[params.input_offset + col * params.input_length + time - step];
}
if (weight_row < params.output_channels) {
let index = (col * params.output_channels + weight_row) * params.kernel_size + tap;
weight = f32(kernel[params.kernel_offset + index]);
}
}
input_tile[lane.y][lane.x] = value;
kernel_tile[lane.y][lane.x] = weight;
workgroupBarrier();
for (var k = 0u; k < TILE; k++) {
dot = fma(input_tile[k][lane.x], kernel_tile[k][lane.y], dot);
}
workgroupBarrier();
}
if (valid_time) {
sum += dot;
}
}
}
if (row < params.output_channels && time <= (params.output_length - 1u - phase) / params.stride) {
let out_time = time * params.stride + phase;
output[params.output_offset + row * params.output_length + out_time] = sum;
}
}
+17
View File
@@ -7404,6 +7404,23 @@ static void ggml_compute_backward(
} //break;
}
} break;
case GGML_OP_CONCAT: {
const int32_t dim = ggml_get_op_params_i32(tensor, 0);
if (src0_needs_grads) {
size_t offset = 0;
struct ggml_tensor * grad_a = ggml_view_4d(ctx, grad,
src0->ne[0], src0->ne[1], src0->ne[2], src0->ne[3],
grad->nb[1], grad->nb[2], grad->nb[3], offset);
ggml_add_or_set(ctx, cgraph, isrc0, ggml_cont(ctx, grad_a));
}
if (src1_needs_grads) {
size_t offset = src0->ne[dim] * grad->nb[dim];
struct ggml_tensor * grad_b = ggml_view_4d(ctx, grad,
src1->ne[0], src1->ne[1], src1->ne[2], src1->ne[3],
grad->nb[1], grad->nb[2], grad->nb[3], offset);
ggml_add_or_set(ctx, cgraph, isrc1, ggml_cont(ctx, grad_b));
}
} break;
case GGML_OP_NONE: {
// noop
} break;
+6 -6
View File
@@ -279,12 +279,6 @@ ggml_tensor * llama_model_inkling2::graph::build_inputs() {
ggml_tensor * inp_pos = build_inp_pos();
inp_out_ids = build_inp_out_ids();
// log-scaled positions: 1 + alpha*log(max(1, (pos + 1)/floor)), multiplies q and r of the full-attention layers
tau = ggml_scale_bias(ctx0, ggml_cast(ctx0, inp_pos, GGML_TYPE_F32), 1.0f, 1.0f);
tau = ggml_log(ctx0, ggml_clamp(ctx0, ggml_scale(ctx0, tau, 1.0f/hparams.n_log_scale_floor), 1.0f, INFINITY));
tau = ggml_reshape_3d(ctx0, ggml_scale_bias(ctx0, tau, hparams.f_log_scale_alpha, 1.0f), 1, 1, n_tokens);
ggml_build_forward_expand(gf, tau);
ggml_tensor * cur = build_inp_embd(model.tok_embd);
// important: do not normalize raw embeddings input (i.e. encoded image embeddings)
@@ -292,6 +286,12 @@ ggml_tensor * llama_model_inkling2::graph::build_inputs() {
cur = build_norm(cur, model.tok_norm, nullptr, LLM_NORM_RMS, -1);
}
// log-scaled positions: 1 + alpha*log(max(1, (pos + 1)/floor)), multiplies q and r of the full-attention layers
tau = ggml_scale_bias(ctx0, ggml_cast(ctx0, inp_pos, GGML_TYPE_F32), 1.0f, 1.0f);
tau = ggml_log(ctx0, ggml_clamp(ctx0, ggml_scale(ctx0, tau, 1.0f/hparams.n_log_scale_floor), 1.0f, INFINITY));
tau = ggml_reshape_3d(ctx0, ggml_scale_bias(ctx0, tau, hparams.f_log_scale_alpha, 1.0f), 1, 1, n_tokens);
ggml_build_forward_expand(gf, tau);
return cur;
}
+51
View File
@@ -5101,6 +5101,10 @@ struct test_loop_ctrl : public test_case {
test_loop_ctrl(int64_t n = 2304, int64_t r = 64, int64_t T = 1) : n(n), r(r), T(T) {}
double max_nmse_err() override {
return 5e-3;
}
ggml_tensor * build_graph(ggml_context * ctx) override {
ggml_tensor * cur = ggml_scale(ctx, ggml_new_tensor_2d(ctx, GGML_TYPE_F32, n, T), 1.0f);
ggml_tensor * msg = ggml_scale(ctx, ggml_new_tensor_2d(ctx, GGML_TYPE_F32, n, T), 1.0f);
@@ -8438,6 +8442,31 @@ struct test_concat : public test_case {
return VARS_TO_STR5(type, ne_a, ne_b_d, dim, v);
}
int64_t grad_nmax() override {
return 40000;
}
std::string op_desc(ggml_tensor * t) override {
GGML_UNUSED(t);
return "CONCAT";
}
// the weighted loss is linear in a and b, so a large eps is exact and keeps f32 rounding small
float grad_eps() override {
return 1.0f;
}
void initialize_tensors(ggml_context * ctx) override {
for (ggml_tensor * t = ggml_get_first_tensor(ctx); t != nullptr; t = ggml_get_next_tensor(ctx, t)) {
// keep weights away from 0 because a near-zero gradient makes the relative error of the grad check blow up
if (strcmp(t->name, "w") == 0) {
init_tensor_uniform(t, 1.0f, 2.0f);
} else {
init_tensor_uniform(t);
}
}
}
test_concat(ggml_type type = GGML_TYPE_F32,
std::array<int64_t, 4> ne_a = {10, 5, 5, 5},
int64_t ne_b_d = 5,
@@ -8452,6 +8481,7 @@ struct test_concat : public test_case {
auto ne = ne_a; ne[0] *= 2; ne[1] *= 4; ne[2] *= 3;
a = ggml_new_tensor(ctx, type, 4, ne.data());
ggml_set_name(a, "a");
ggml_set_param(a);
a = ggml_view_4d(ctx, a, ne_a[0], ne_a[1], ne_a[2], ne_a[3], a->nb[1], a->nb[2], a->nb[3], 0);
ggml_set_name(a, "view_of_a");
@@ -8459,18 +8489,24 @@ struct test_concat : public test_case {
auto ne = ne_a; ne[2] *= 2; ne[3] *= 4;
a = ggml_new_tensor(ctx, type, 4, ne.data());
ggml_set_name(a, "a");
ggml_set_param(a);
a = ggml_view_4d(ctx, a, ne_a[0], ne_a[1], ne_a[2], ne_a[3], a->nb[1], a->nb[2], a->nb[3], 0);
ggml_set_name(a, "view_of_a");
} else {
a = ggml_new_tensor(ctx, type, 4, ne_a.data());
ggml_set_name(a, "a");
// the transposed b cases target the forward kernel, a grad check of a there takes minutes
if (!(v & 16)) {
ggml_set_param(a);
}
}
ggml_tensor * b;
if (v & 2) {
auto ne = ne_b; ne[0] *= 3; ne[1] *= 2; ne[2] *= 4;
b = ggml_new_tensor(ctx, type, 4, ne.data());
ggml_set_name(b, "b");
ggml_set_param(b);
b = ggml_view_4d(ctx, b, ne_b[0], ne_b[1], ne_b[2], ne_b[3], b->nb[1], b->nb[2], b->nb[3], 0);
ggml_set_name(b, "view_of_b");
@@ -8478,6 +8514,7 @@ struct test_concat : public test_case {
auto ne = ne_b; ne[2] *= 3; ne[3] *= 2;
b = ggml_new_tensor(ctx, type, 4, ne.data());
ggml_set_name(b, "b");
ggml_set_param(b);
b = ggml_view_4d(ctx, b, ne_b[0], ne_b[1], ne_b[2], ne_b[3], b->nb[1], b->nb[2], b->nb[3], 0);
ggml_set_name(b, "view_of_b");
@@ -8491,11 +8528,21 @@ struct test_concat : public test_case {
} else {
b = ggml_new_tensor(ctx, type, 4, ne_b.data());
ggml_set_name(b, "b");
ggml_set_param(b);
}
ggml_tensor * out = ggml_concat(ctx, a, b, dim);
ggml_set_name(out, "out");
if (mode == MODE_GRAD) {
// with sum(out) as the loss every element has the same gradient, so a wrong view offset in the
// backward pass would go unnoticed; random weights make the gradient differ per element
ggml_tensor * w = ggml_new_tensor(ctx, type, 4, out->ne);
ggml_set_name(w, "w");
out = ggml_mul(ctx, out, w);
ggml_set_name(out, "out_weighted");
}
return out;
}
};
@@ -12752,6 +12799,9 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
test_cases.emplace_back(new test_conv_transpose_1d({3,2,1,1}, {3,1,2,1}, 1, 0, 1));
test_cases.emplace_back(new test_conv_transpose_1d({2,1,1,1}, {3,1,1,1}, 1, 0, 1));
test_cases.emplace_back(new test_conv_transpose_1d({33,32,1,1}, {20,24,32,1}, 10, 0, 1));
test_cases.emplace_back(new test_conv_transpose_1d({35,33,1,1}, {11,17,33,1}, 5, 0, 1));
for (ggml_type type : {GGML_TYPE_F32, GGML_TYPE_F16, GGML_TYPE_BF16}) {
// ConvTranspose1d expressed as mul_mat + col2im (DAC decoder upsampling)
test_cases.emplace_back(new test_col2im_1d(type, 16, 32, 197, 8, 0)); // kernel = 2*stride
@@ -15040,6 +15090,7 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
test_cases.emplace_back(new test_flash_attn_ext(256, 256, 4, {2, 1}, 4096, 512, true, false, 0, 0, GGML_PREC_F32, GGML_TYPE_F16, GGML_TYPE_F16));
test_cases.emplace_back(new test_flash_attn_ext(256, 256, 4, {4, 1}, 4096, 512, true, false, 0, 0, GGML_PREC_F32, GGML_TYPE_F16, GGML_TYPE_F16));
test_cases.emplace_back(new test_flash_attn_ext(256, 256, 2, {12, 1}, 4096, 512, true, false, 0, 0, GGML_PREC_F32, GGML_TYPE_F16, GGML_TYPE_F16));
test_cases.emplace_back(new test_flash_attn_ext(128, 128, 4, { 3, 1}, 512, 32, true, false, 0, 0, GGML_PREC_F32, GGML_TYPE_F16, GGML_TYPE_F16));
// dense-allocated (non-view) quant K/V at batch >= 64, in cache and native layouts
test_cases.emplace_back(new test_flash_attn_ext(64, 64, 4, {1, 1}, 512, 75, true, false, 0, 0, GGML_PREC_F32, GGML_TYPE_Q8_0, GGML_TYPE_Q8_0, {0, 2, 1, 3}, false));
+16
View File
@@ -5601,6 +5601,22 @@ static void test_template_output_peg_parsers(bool detailed_debug) {
.expect(message_assist_call_thoughts)
.run();
// The models sometimes open the tool call section without closing the reasoning at all
for (const char * effort : { R"("medium")", R"("high")" }) {
tst.test(
"I'm\nthinking<ifm|tool_calls>\n"
"<ifm|tool_call>special_function\n"
"<ifm|arg_key>arg1</ifm|arg_key>\n"
"<ifm|arg_value>1</ifm|arg_value>\n"
"</ifm|tool_call>\n"
"</ifm|tool_calls>")
.reasoning_format(COMMON_REASONING_FORMAT_AUTO)
.tools({ special_function_tool })
.chat_template_kwargs({ { "reasoning_effort", effort } })
.expect(message_assist_call_thoughts)
.run();
}
tst.test(
"I'm\nthinking</ifm|think><ifm|tool_calls>\n"
"<ifm|tool_call>{\"name\": \"special_function\", \"arguments\": {\"arg1\": 1}}</ifm|tool_call>\n"