interplane.Get Omega
Read in your language

ggml

[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)

Brought by drakestapleton

branch master Branches Tags History

ggml / src / ggml-vulkan / ggml-vulkan-push-constants.h

1142 lines · 35240 bytes Raw Blame History
1#pragma once
2#include "ggml-vulkan-types.h"
3
4uint32_t get_misalign_bytes(const ggml_backend_vk_context * ctx, const ggml_tensor * t);
5
6uint32_t ggml_vk_concat_unit_size(ggml_type type);
7
8struct vk_mat_mat_push_constants {
9 uint32_t M; uint32_t N; uint32_t K;
10 uint32_t stride_a; uint32_t stride_b; uint32_t stride_d;
11 uint32_t batch_stride_a; uint32_t batch_stride_b; uint32_t batch_stride_d;
12 uint32_t base_work_group_z; uint32_t num_batches;
13 uint32_t k_split;
14 uint32_t ne02; uint32_t ne12; uint32_t broadcast2; uint32_t broadcast3;
15 uint32_t padded_N;
16};
17
18struct vk_mat_vec_push_constants {
19 uint32_t ncols;
20 uint32_t stride_a;
21 uint32_t stride_b;
22 uint32_t stride_d;
23 uint32_t batch_stride_a;
24 uint32_t batch_stride_b;
25 uint32_t batch_stride_d;
26 uint32_t fusion_flags;
27 uint32_t base_work_group_y;
28 uint32_t ne02;
29 uint32_t ne12;
30 uint32_t broadcast2;
31 uint32_t broadcast3;
32};
33
34struct vk_mat_vec_p021_push_constants {
35 uint32_t ncols_x;
36 uint32_t nrows_x;
37 uint32_t nchannels_x;
38 uint32_t nchannels_y;
39 uint32_t b_offset;
40 uint32_t d_offset;
41 uint32_t fusion_flags;
42};
43
44struct vk_mat_vec_nc_push_constants {
45 uint32_t ncols_x;
46 uint32_t nrows_x;
47 uint32_t row_stride_x;
48 uint32_t channel_stride_x;
49 uint32_t channel_stride_y;
50 uint32_t channel_x_divisor;
51 uint32_t ne12;
52 uint32_t b_offset;
53 uint32_t d_offset;
54 uint32_t nb03;
55 uint32_t nb13;
56 uint32_t nb23;
57 uint32_t fusion_flags;
58};
59
60struct vk_mat_mat_id_push_constants {
61 uint32_t M; uint32_t N; uint32_t K;
62 uint32_t stride_a; uint32_t stride_b; uint32_t stride_d;
63 uint32_t batch_stride_a; uint32_t batch_stride_b; uint32_t batch_stride_d;
64 uint32_t nei0; uint32_t nei1; uint32_t nbi1; uint32_t ne11;
65 uint32_t n_experts;
66 uint32_t row_ids_offset;
67};
68
69struct vk_mat_vec_id_push_constants {
70 uint32_t ncols;
71 uint32_t stride_a;
72 uint32_t stride_b;
73 uint32_t stride_d;
74 uint32_t batch_stride_a;
75 uint32_t batch_stride_b;
76 uint32_t batch_stride_d;
77 uint32_t fusion_flags;
78 uint32_t nei0;
79 uint32_t ne11;
80 uint32_t expert_i1;
81 uint32_t nbi1;
82};
83
84struct vk_flash_attn_push_constants {
85 uint32_t N;
86 uint32_t KV;
87
88 uint32_t ne1;
89 uint32_t ne2;
90 uint32_t ne3;
91
92 uint32_t neq2;
93 uint32_t neq3;
94 uint32_t nek2;
95 uint32_t nek3;
96 uint32_t nev2;
97 uint32_t nev3;
98 uint32_t nem1;
99 uint32_t nem2;
100 uint32_t nem3;
101
102 uint32_t nb01;
103 uint32_t nb02;
104 uint32_t nb03;
105 uint32_t nb11;
106 uint32_t nb12;
107 uint32_t nb13;
108 uint32_t nb21;
109 uint32_t nb22;
110 uint32_t nb23;
111
112 float scale;
113 float max_bias;
114 float logit_softcap;
115
116 uint32_t mask_n_head_log2;
117 float m0;
118 float m1;
119
120 uint32_t gqa_ratio;
121 uint32_t split_kv;
122 uint32_t k_num;
123};
124
125static_assert(sizeof(vk_flash_attn_push_constants) <= 128, "sizeof(vk_flash_attn_push_constants) must be <= 128");
126
127struct vk_fa_xe_opt_push_constants {
128 uint32_t kv_seq_len;
129 uint32_t activation_length;
130 uint32_t q_head;
131 uint32_t kv_head;
132 uint32_t qk_ratio;
133 uint32_t qk_sub_groups;
134 uint32_t flag;
135 uint32_t nbkv_tok;
136 uint32_t nbkv_head;
137 uint32_t batch_stride_q;
138 uint32_t batch_stride_k;
139 uint32_t batch_stride_v;
140 uint32_t batch_stride_m;
141 uint32_t batch_stride_o;
142 float softmax_scale;
143};
144
145struct vk_op_push_constants {
146 uint32_t KX;
147 uint32_t KY;
148 float param1;
149 float param2;
150 float param3;
151 float param4;
152};
153
154struct vk_op_fwht_push_constants {
155 uint32_t n_rows;
156 uint32_t src_offset;
157 uint32_t dst_offset;
158 float scale;
159};
160
161struct vk_op_dsv4_hc_comb_push_constants {
162 uint32_t n_tokens;
163
164 uint32_t nbm0; uint32_t nbm1;
165 uint32_t nbs0;
166 uint32_t nbb0;
167 uint32_t nbd0; uint32_t nbd1; uint32_t nbd2;
168
169 uint32_t m_offset;
170 uint32_t s_offset;
171 uint32_t b_offset;
172 uint32_t d_offset;
173
174 float eps;
175 uint32_t n_iter;
176};
177
178struct vk_op_dsv4_hc_pre_push_constants {
179 uint32_t n_embd;
180 uint32_t n_tokens;
181
182 uint32_t nbx0; uint32_t nbx1; uint32_t nbx2;
183 uint32_t nbw0; uint32_t nbw1; uint32_t nbw2;
184 uint32_t nbd0; uint32_t nbd1;
185
186 uint32_t x_offset;
187 uint32_t w_offset;
188 uint32_t d_offset;
189
190 float scale;
191};
192
193struct vk_op_dsv4_hc_post_push_constants {
194 uint32_t n_embd;
195 uint32_t n_tokens;
196
197 uint32_t nbx0; uint32_t nbx1;
198 uint32_t nbr0; uint32_t nbr1; uint32_t nbr2;
199 uint32_t nbp0; uint32_t nbp1;
200 uint32_t nbc0; uint32_t nbc1; uint32_t nbc2;
201 uint32_t nbd0; uint32_t nbd1; uint32_t nbd2;
202
203 uint32_t x_offset;
204 uint32_t r_offset;
205 uint32_t p_offset;
206 uint32_t c_offset;
207 uint32_t d_offset;
208
209 uint32_t gate;
210 float gate_scale_in;
211 float gate_scale_out;
212};
213
214struct vk_op_count_experts_push_constants {
215 uint32_t ne00;
216 uint32_t ne01;
217 uint32_t nb00;
218 uint32_t nb01;
219 uint32_t a_offset;
220 uint32_t n_experts;
221 uint32_t ne00mp;
222 uint32_t ne00L;
223 uint32_t row_tile_size;
224 uint32_t row_ids_offset;
225 uint32_t ne0_dst;
226 uint32_t stride_dst;
227 uint32_t batch_stride_dst;
228};
229
230struct vk_op_glu_push_constants {
231 uint32_t N;
232 uint32_t ne00;
233 uint32_t ne20;
234 uint32_t mode; // 0: default, 1: swapped, 2: split
235 float alpha; // for swiglu_oai
236 float limit;
237 uint32_t nb00;
238 uint32_t nb01;
239 uint32_t nb02;
240 uint32_t nb03;
241 uint32_t nb10;
242 uint32_t nb11;
243 uint32_t nb12;
244 uint32_t nb13;
245 uint32_t nb20;
246 uint32_t nb21;
247 uint32_t nb22;
248 uint32_t nb23;
249 uint32_t ne21;
250 uint32_t ne22;
251 uint32_t misalign_offsets;
252 uint32_t ne2_012mp; uint32_t ne2_012L;
253 uint32_t ne2_01mp; uint32_t ne2_01L;
254 uint32_t ne2_0mp; uint32_t ne2_0L;
255};
256
257static_assert(sizeof(vk_op_glu_push_constants) <= 128, "sizeof(vk_op_glu_push_constants) must be <= 128");
258
259struct vk_op_unary_push_constants {
260 uint32_t ne;
261 uint32_t ne00; uint32_t ne01; uint32_t ne02; uint32_t ne03; uint32_t nb00; uint32_t nb01; uint32_t nb02; uint32_t nb03;
262 uint32_t ne10; uint32_t ne11; uint32_t ne12; uint32_t ne13; uint32_t nb10; uint32_t nb11; uint32_t nb12; uint32_t nb13;
263 uint32_t misalign_offsets;
264 float param1; float param2; float param3; float param4;
265 uint32_t ne0_012mp; uint32_t ne0_01mp; uint32_t ne0_0mp; uint32_t ne0_Ls;
266 uint32_t ne1_012mp; uint32_t ne1_01mp; uint32_t ne1_0mp; uint32_t ne1_Ls;
267};
268
269static_assert(sizeof(vk_op_unary_push_constants) <= 128, "sizeof(vk_op_unary_push_constants) must be <= 128");
270
271static vk_op_unary_push_constants vk_op_unary_push_constants_init(const ggml_tensor * src0, const ggml_tensor * dst, int64_t ne = 0) {
272 GGML_ASSERT(ne != 0 || (ggml_nelements(src0) == ggml_nelements(dst)));
273 ne = ne != 0 ? ne : ggml_nelements(dst);
274 GGML_ASSERT(ne <= (int64_t)std::numeric_limits<uint32_t>::max());
275
276 vk_op_unary_push_constants p{};
277 p.ne = (uint32_t)ne;
278
279 size_t src0_tsize = ggml_type_size(src0->type);
280 p.ne00 = (uint32_t)src0->ne[0];
281 p.ne01 = (uint32_t)src0->ne[1];
282 p.ne02 = (uint32_t)src0->ne[2];
283 p.ne03 = (uint32_t)src0->ne[3];
284 p.nb00 = (uint32_t)(src0->nb[0] / src0_tsize);
285 p.nb01 = (uint32_t)(src0->nb[1] / src0_tsize);
286 p.nb02 = (uint32_t)(src0->nb[2] / src0_tsize);
287 p.nb03 = (uint32_t)(src0->nb[3] / src0_tsize);
288
289 size_t dst_tsize = ggml_type_size(dst->type);
290 p.ne10 = (uint32_t)dst->ne[0];
291 p.ne11 = (uint32_t)dst->ne[1];
292 p.ne12 = (uint32_t)dst->ne[2];
293 p.ne13 = (uint32_t)dst->ne[3];
294 p.nb10 = (uint32_t)(dst->nb[0] / dst_tsize);
295 p.nb11 = (uint32_t)(dst->nb[1] / dst_tsize);
296 p.nb12 = (uint32_t)(dst->nb[2] / dst_tsize);
297 p.nb13 = (uint32_t)(dst->nb[3] / dst_tsize);
298
299 return p; // offsets are initialized later in ggml_vk_op
300}
301
302struct vk_op_pad_push_constants {
303 uint32_t ne;
304 uint32_t ne00; uint32_t ne01; uint32_t ne02; uint32_t ne03; uint32_t nb00; uint32_t nb01; uint32_t nb02; uint32_t nb03;
305 uint32_t ne10; uint32_t ne11; uint32_t ne12; uint32_t ne13; uint32_t nb10; uint32_t nb11; uint32_t nb12; uint32_t nb13;
306 uint32_t misalign_offsets;
307 uint32_t circular;
308
309 uint32_t lp0; uint32_t rp0;
310 uint32_t lp1; uint32_t rp1;
311 uint32_t lp2; uint32_t rp2;
312 uint32_t lp3; uint32_t rp3;
313};
314
315static vk_op_pad_push_constants vk_op_pad_push_constants_init(const ggml_tensor * src0, const ggml_tensor * dst) {
316 int64_t ne = ggml_nelements(dst);
317 GGML_ASSERT(ne <= (int64_t)std::numeric_limits<uint32_t>::max());
318
319 vk_op_pad_push_constants p{};
320 p.ne = (uint32_t)ne;
321
322 size_t src0_tsize = ggml_type_size(src0->type);
323 p.ne00 = (uint32_t)src0->ne[0];
324 p.ne01 = (uint32_t)src0->ne[1];
325 p.ne02 = (uint32_t)src0->ne[2];
326 p.ne03 = (uint32_t)src0->ne[3];
327 p.nb00 = (uint32_t)(src0->nb[0] / src0_tsize);
328 p.nb01 = (uint32_t)(src0->nb[1] / src0_tsize);
329 p.nb02 = (uint32_t)(src0->nb[2] / src0_tsize);
330 p.nb03 = (uint32_t)(src0->nb[3] / src0_tsize);
331
332 size_t dst_tsize = ggml_type_size(dst->type);
333 p.ne10 = (uint32_t)dst->ne[0];
334 p.ne11 = (uint32_t)dst->ne[1];
335 p.ne12 = (uint32_t)dst->ne[2];
336 p.ne13 = (uint32_t)dst->ne[3];
337 p.nb10 = (uint32_t)(dst->nb[0] / dst_tsize);
338 p.nb11 = (uint32_t)(dst->nb[1] / dst_tsize);
339 p.nb12 = (uint32_t)(dst->nb[2] / dst_tsize);
340 p.nb13 = (uint32_t)(dst->nb[3] / dst_tsize);
341
342 p.lp0 = dst->op_params[0];
343 p.rp0 = dst->op_params[1];
344 p.lp1 = dst->op_params[2];
345 p.rp1 = dst->op_params[3];
346 p.lp2 = dst->op_params[4];
347 p.rp2 = dst->op_params[5];
348 p.lp3 = dst->op_params[6];
349 p.rp3 = dst->op_params[7];
350 p.circular = dst->op_params[8];
351
352 return p; // fastdiv values and offsets are initialized later in ggml_vk_op
353}
354
355static void init_fastdiv_values(uint32_t d, uint32_t &mp, uint32_t &L)
356{
357 // compute L = ceil(log2(d));
358 L = 0;
359 while (L < 32 && (uint32_t{1} << L) < d) {
360 L++;
361 }
362
363 mp = (uint32_t)((uint64_t{1} << 32) * ((uint64_t{1} << L) - d) / d + 1);
364}
365
366static uint32_t pack_fastdiv_L(uint32_t L0, uint32_t L1, uint32_t L2) {
367 return L0 | (L1 << 8) | (L2 << 16);
368}
369
370template <typename T> void init_pushconst_fastdiv(T &p) {
371 GGML_UNUSED(p);
372 static_assert(!std::is_const<T>::value, "unexpected type");
373}
374
375template <> inline void init_pushconst_fastdiv(vk_op_unary_push_constants &p) {
376 // Compute magic values to divide by these six numbers.
377 uint32_t ne0_012L;
378 uint32_t ne0_01L;
379 uint32_t ne0_0L;
380 uint32_t ne1_012L;
381 uint32_t ne1_01L;
382 uint32_t ne1_0L;
383
384 init_fastdiv_values(p.ne02*p.ne01*p.ne00, p.ne0_012mp, ne0_012L);
385 init_fastdiv_values(p.ne01*p.ne00, p.ne0_01mp, ne0_01L);
386 init_fastdiv_values(p.ne00, p.ne0_0mp, ne0_0L);
387 init_fastdiv_values(p.ne12*p.ne11*p.ne10, p.ne1_012mp, ne1_012L);
388 init_fastdiv_values(p.ne11*p.ne10, p.ne1_01mp, ne1_01L);
389 init_fastdiv_values(p.ne10, p.ne1_0mp, ne1_0L);
390
391 p.ne0_Ls = pack_fastdiv_L(ne0_012L, ne0_01L, ne0_0L);
392 p.ne1_Ls = pack_fastdiv_L(ne1_012L, ne1_01L, ne1_0L);
393}
394
395template <> inline void init_pushconst_fastdiv(vk_op_glu_push_constants &p) {
396 // GLU linearizes over dst, then uses dst coordinates for src0/src1.
397 init_fastdiv_values(p.ne22*p.ne21*p.ne20, p.ne2_012mp, p.ne2_012L);
398 init_fastdiv_values(p.ne21*p.ne20, p.ne2_01mp, p.ne2_01L);
399 init_fastdiv_values(p.ne20, p.ne2_0mp, p.ne2_0L);
400}
401
402template <> inline void init_pushconst_fastdiv(vk_op_count_experts_push_constants &p) {
403 init_fastdiv_values(p.ne00, p.ne00mp, p.ne00L);
404}
405
406struct vk_op_binary_push_constants {
407 uint32_t ne;
408 uint32_t ne00; uint32_t ne01; uint32_t ne02; uint32_t ne03; uint32_t nb00; uint32_t nb01; uint32_t nb02; uint32_t nb03;
409 uint32_t ne10; uint32_t ne11; uint32_t ne12; uint32_t ne13; uint32_t nb10; uint32_t nb11; uint32_t nb12; uint32_t nb13;
410 uint32_t ne20; uint32_t ne21; uint32_t ne22; uint32_t ne23; uint32_t nb20; uint32_t nb21; uint32_t nb22; uint32_t nb23;
411 uint32_t misalign_offsets;
412 float param1; float param2; int32_t param3;
413};
414
415struct vk_op_concat_push_constants : vk_op_binary_push_constants {};
416
417static_assert(sizeof(vk_op_concat_push_constants) == sizeof(vk_op_binary_push_constants));
418
419static_assert(std::is_standard_layout_v<vk_op_concat_push_constants>);
420
421struct vk_op_multi_add_push_constants {
422 // shape for dst
423 uint32_t ne20; uint32_t ne21; uint32_t ne22; uint32_t ne23;
424
425 // strides for srcs+dst
426 uint32_t nb[MAX_PARAMETER_COUNT][4];
427
428 uint32_t rms_partials;
429};
430
431static_assert(MAX_PARAMETER_COUNT == 12);
432
433static_assert(sizeof(vk_op_multi_add_push_constants) <= 256);
434
435struct vk_op_topk_moe_push_constants {
436 uint32_t n_rows;
437 uint32_t n_experts_push;
438 uint32_t n_expert_used;
439 float clamp_min;
440 float clamp_max;
441 uint32_t gating_func;
442 uint32_t has_bias;
443 uint32_t with_norm;
444 float output_scale;
445 float output_bias;
446};
447
448struct vk_op_add_id_push_constants {
449 uint32_t ne0;
450 uint32_t ne1;
451 uint32_t s01;
452 uint32_t s02;
453 uint32_t s11;
454 uint32_t s21;
455};
456
457struct vk_op_diag_mask_push_constants {
458 uint32_t ncols;
459 uint32_t rows_per_channel;
460 int32_t n_past;
461};
462
463struct vk_op_rope_push_constants {
464 uint32_t rope_mode;
465 uint32_t nrows;
466 uint32_t n_dims;
467 uint32_t n_offs;
468 float freq_scale;
469 float freq_base;
470 float ext_factor;
471 float attn_factor;
472 float corr_dims[2];
473 float theta_scale;
474 uint32_t has_ff;
475 int32_t sections[4];
476 uint32_t is_imrope;
477 uint32_t is_back;
478 uint32_t set_rows_stride;
479 uint32_t ne00;
480 uint32_t ne01;
481 uint32_t ne02;
482 uint32_t nb01;
483 uint32_t nb02;
484 uint32_t nb03;
485 uint32_t nb11;
486 uint32_t nb12;
487 uint32_t nb13;
488 uint32_t a_offset;
489 uint32_t d_offset;
490};
491
492static_assert(sizeof(vk_op_rope_push_constants) <= 128, "sizeof(vk_op_rope_push_constants) must be <= 128");
493
494struct vk_op_rms_norm_mul_rope_push_constants {
495 vk_op_binary_push_constants bin;
496 vk_op_rope_push_constants rope;
497};
498
499struct vk_op_soft_max_push_constants {
500 uint32_t KX;
501 uint32_t KY;
502 uint32_t ne00;
503 uint32_t ne01;
504 uint32_t ne02;
505 uint32_t ne12;
506 uint32_t ne13;
507 uint32_t nb11;
508 uint32_t nb12;
509 uint32_t nb13;
510 float scale;
511 float max_bias;
512 float m0;
513 float m1;
514 uint32_t n_head_log2;
515 uint32_t nrows_x;
516 uint32_t has_sinks;
517};
518
519struct vk_op_argsort_push_constants {
520 uint32_t ncols;
521 uint32_t ncols_padded;
522 uint32_t ncols_padded_log2;
523 uint32_t nrows;
524 uint32_t order;
525 uint32_t outer_start;
526 uint32_t outer_end;
527 uint32_t inner_start;
528 uint32_t inner_end;
529};
530
531struct vk_op_topk_push_constants {
532 uint32_t orig_ncols;
533 uint32_t ncols_input;
534 uint32_t ncols_output;
535 uint32_t k;
536 uint32_t nrows;
537 uint32_t first_pass;
538 uint32_t last_pass;
539};
540
541struct vk_op_topk_radix_push_constants {
542 uint32_t ncols;
543 uint32_t k;
544 uint32_t nrows;
545 uint32_t n_tps; // QSA only
546 uint32_t n_blocks; // QSA only
547 uint32_t n_stream; // QSA only
548};
549
550struct vk_op_im2col_push_constants {
551 uint64_t dst_addr;
552 uint32_t batch_offset; uint32_t offset_delta;
553 uint32_t IC;
554 uint32_t IW; uint32_t IH;
555 uint32_t OW; uint32_t OH;
556 uint32_t KW; uint32_t KH;
557 uint32_t OH_batch;
558 uint32_t CHW;
559 int32_t s0; int32_t s1;
560 int32_t p0; int32_t p1;
561 int32_t d0; int32_t d1;
562 uint32_t batch_IC;
563};
564
565struct vk_op_im2col_3d_push_constants {
566 uint64_t dst_addr;
567 uint32_t nb10;
568 uint32_t nb11;
569 uint32_t nb12;
570 uint32_t nb13;
571 uint32_t s0;
572 uint32_t s1;
573 uint32_t s2;
574 uint32_t p0;
575 uint32_t p1;
576 uint32_t p2;
577 uint32_t d0;
578 uint32_t d1;
579 uint32_t d2;
580 uint32_t IW;
581 uint32_t IH;
582 uint32_t ID;
583 uint32_t IC;
584 uint32_t KW;
585 uint32_t OH;
586 uint32_t KD_KH_KW;
587 uint32_t KH_KW;
588 uint32_t IC_KD_KH_KW;
589 uint32_t N_OD_OH;
590 uint32_t OD_OH;
591 uint32_t OD_OH_OW_IC_KD_KH_KW;
592 uint32_t OH_OW_IC_KD_KH_KW;
593 uint32_t OW_IC_KD_KH_KW;
594 uint32_t misalign_offsets;
595};
596
597struct vk_op_timestep_embedding_push_constants {
598 uint32_t nb1;
599 uint32_t dim;
600 uint32_t max_period;
601};
602
603struct vk_op_col2im_1d_push_constants {
604 uint32_t T_out;
605 uint32_t OC;
606 uint32_t K_OC;
607 uint32_t T_in;
608 uint32_t K;
609 int32_t stride;
610 int32_t p0;
611};
612
613struct vk_op_conv_transpose_1d_push_constants {
614 uint32_t Cout;
615 uint32_t Cin;
616 uint32_t K;
617 uint32_t L;
618 uint32_t KL;
619
620 uint32_t nb01;
621 uint32_t nb02;
622 uint32_t nb11;
623 uint32_t nb1;
624
625 int32_t s0;
626};
627
628struct vk_op_snake_push_constants {
629 uint32_t ne0;
630 uint32_t ne1;
631};
632
633struct vk_op_pool1d_push_constants {
634 uint32_t IL;
635 uint32_t OL;
636 uint32_t OC;
637 uint32_t pelements;
638 uint32_t op;
639 int32_t k0;
640 int32_t s0;
641 int32_t p0;
642};
643
644struct vk_op_pool2d_push_constants {
645 uint32_t IW; uint32_t IH;
646 uint32_t OW; uint32_t OH;
647 uint32_t OC;
648 uint32_t pelements;
649 uint32_t op;
650 int32_t k0; int32_t k1;
651 int32_t s0; int32_t s1;
652 int32_t p0; int32_t p1;
653};
654
655struct vk_op_rwkv_wkv6_push_constants {
656 uint32_t B;
657 uint32_t T;
658 uint32_t C;
659 uint32_t H;
660};
661
662struct vk_op_rwkv_wkv7_push_constants {
663 uint32_t B;
664 uint32_t T;
665 uint32_t C;
666 uint32_t H;
667};
668
669struct vk_op_gated_linear_attn_push_constants {
670 uint32_t B;
671 uint32_t T;
672 uint32_t C;
673 uint32_t H;
674 float scale;
675};
676
677struct vk_op_lightning_indexer_push_constants {
678 uint32_t n_kv;
679 uint32_t n_heads;
680 uint32_t n_tokens;
681 uint32_t n_masks;
682 uint32_t q_nb1;
683 uint32_t q_nb2;
684 uint32_t q_nb3;
685 uint32_t k_nb2;
686 uint32_t k_nb3;
687 uint32_t w_nb1;
688 uint32_t w_nb3;
689 uint32_t m_nb1;
690 uint32_t m_nb3;
691 uint32_t d_nb1;
692 uint32_t d_nb3;
693};
694
695static_assert(sizeof(vk_op_lightning_indexer_push_constants) <= 128);
696
697struct vk_op_gated_delta_net_push_constants {
698 uint32_t H;
699 uint32_t n_tokens;
700 uint32_t n_seqs;
701 uint32_t s_off;
702 uint32_t sq1, sq2, sq3;
703 uint32_t sv1, sv2, sv3;
704 uint32_t sb1, sb2, sb3;
705 uint32_t neq1, rq3;
706 float scale;
707 uint32_t K;
708};
709
710struct vk_op_ssm_scan_push_constants {
711 uint32_t nb02, nb03, nb12, nb13;
712 uint32_t nb21, nb22, nb31;
713 uint32_t nb42, nb43, nb52, nb53;
714 uint32_t s_off;
715 uint32_t n_head, d_head, n_group, n_tok;
716 uint32_t n_seq, K;
717};
718
719struct vk_op_ssm_conv_push_constants {
720 uint32_t nb01, nb02;
721 uint32_t nb11;
722 uint32_t dst_nb0, dst_nb1, dst_nb2;
723 uint32_t nc, ncs, nr, n_t, n_s;
724};
725
726struct vk_op_conv2d_push_constants {
727 uint32_t Cout;
728 uint32_t Cin;
729 uint32_t N;
730
731 uint32_t W;
732 uint32_t H;
733 uint32_t OW;
734 uint32_t OH;
735
736 uint32_t nb01;
737 uint32_t nb02;
738 uint32_t nb03;
739
740 uint32_t nb11;
741 uint32_t nb12;
742 uint32_t nb13;
743
744 uint32_t nb1;
745 uint32_t nb2;
746 uint32_t nb3;
747
748 // init_fastdiv_values constants for dividing by OW, OW*OH
749 uint32_t OWmp; uint32_t OWL;
750 uint32_t OWOHmp; uint32_t OWOHL;
751
752 uint32_t knl_offset;
753 uint32_t src_offset;
754 uint32_t dst_offset;
755};
756
757template <> inline void init_pushconst_fastdiv(vk_op_conv2d_push_constants &p) {
758 // Compute magic values to divide by OW, OW*OH
759 init_fastdiv_values(p.OW, p.OWmp, p.OWL);
760 init_fastdiv_values(p.OW*p.OH, p.OWOHmp, p.OWOHL);
761}
762
763struct vk_op_conv3d_push_constants {
764 uint32_t OC;
765 uint32_t IC;
766 uint32_t N;
767
768 uint32_t IW;
769 uint32_t IH;
770 uint32_t ID;
771 uint32_t OW;
772 uint32_t OH;
773 uint32_t OD;
774
775 uint32_t nb01;
776 uint32_t nb02;
777 uint32_t nb03;
778
779 uint32_t nb11;
780 uint32_t nb12;
781 uint32_t nb13;
782
783 uint32_t nb1;
784 uint32_t nb2;
785 uint32_t nb3;
786
787 uint32_t OWmp; uint32_t OWL;
788 uint32_t OWOHmp; uint32_t OWOHL;
789 uint32_t OWOHODmp; uint32_t OWOHODL;
790
791 uint32_t knl_offset;
792 uint32_t src_offset;
793 uint32_t dst_offset;
794};
795
796template <> inline void init_pushconst_fastdiv(vk_op_conv3d_push_constants &p) {
797 init_fastdiv_values(p.OW, p.OWmp, p.OWL);
798 init_fastdiv_values(p.OW*p.OH, p.OWOHmp, p.OWOHL);
799 init_fastdiv_values(p.OW*p.OH*p.OD, p.OWOHODmp, p.OWOHODL);
800}
801
802struct vk_op_conv2d_dw_push_constants {
803 uint32_t ne;
804 uint32_t batches;
805 uint32_t channels;
806 uint32_t dst_w;
807 uint32_t dst_h;
808 uint32_t src_w;
809 uint32_t src_h;
810 uint32_t knl_w;
811 uint32_t knl_h;
812 int32_t stride_x;
813 int32_t stride_y;
814 int32_t pad_x;
815 int32_t pad_y;
816 int32_t dilation_x;
817 int32_t dilation_y;
818};
819
820struct vk_op_upscale_push_constants {
821 uint32_t ne; uint32_t a_offset; uint32_t d_offset;
822 uint32_t ne00; uint32_t ne01;
823 uint32_t nb00; uint32_t nb01; uint32_t nb02; uint32_t nb03;
824 uint32_t ne10; uint32_t ne11; uint32_t ne12; uint32_t ne13;
825 float sf0; float sf1; float sf2; float sf3;
826 float pixel_offset;
827};
828
829struct vk_op_sum_rows_push_constants
830{
831 uint32_t n_cols;
832 uint32_t ne01, ne02;
833 uint32_t nb01, nb02, nb03;
834 uint32_t nb11, nb12, nb13;
835 float weight;
836 uint32_t misalign_offsets;
837 uint32_t ne0_12mp, ne0_12L;
838 uint32_t ne0_1mp, ne0_1L;
839};
840
841static vk_op_sum_rows_push_constants vk_op_sum_rows_push_constants_init(const ggml_tensor * src, const ggml_tensor * dst, int64_t n_cols) {
842 uint32_t type_size = (uint32_t)ggml_type_size(src->type);
843 vk_op_sum_rows_push_constants p = {};
844 p.n_cols = (uint32_t)n_cols;
845 p.ne01 = (uint32_t)src->ne[1];
846 p.ne02 = (uint32_t)src->ne[2];
847 p.nb01 = (uint32_t)src->nb[1] / type_size;
848 p.nb02 = (uint32_t)src->nb[2] / type_size;
849 p.nb03 = (uint32_t)src->nb[3] / type_size;
850 p.nb11 = (uint32_t)dst->nb[1] / type_size;
851 p.nb12 = (uint32_t)dst->nb[2] / type_size;
852 p.nb13 = (uint32_t)dst->nb[3] / type_size;
853 p.weight = 1.0f;
854 return p;
855}
856
857template <> inline void init_pushconst_fastdiv(vk_op_sum_rows_push_constants &p) {
858 init_fastdiv_values(p.ne01*p.ne02, p.ne0_12mp, p.ne0_12L);
859 init_fastdiv_values(p.ne01, p.ne0_1mp, p.ne0_1L);
860}
861
862struct vk_quantize_q8_1_push_constants {
863 uint32_t ne;
864 uint32_t num_blocks;
865};
866
867struct vk_op_flash_attn_split_k_reduce_push_constants {
868 uint32_t D;
869 uint32_t ne1;
870 uint32_t ne2;
871 uint32_t ne3;
872 uint32_t k_num;
873 uint32_t sinks;
874};
875
876struct vk_op_flash_attn_mask_opt_push_constants {
877 uint32_t nem0;
878 uint32_t nem1;
879 uint32_t nem2;
880 uint32_t nbm1;
881 uint32_t nbm2;
882 uint32_t nbm3;
883 uint32_t nbd1;
884 uint32_t nbd2;
885 uint32_t nbd3;
886};
887
888struct vk_op_flash_attn_sparse_compact_push_constants {
889 uint32_t KV;
890 uint32_t nem1;
891 uint32_t nem2;
892 uint32_t nbm1;
893 uint32_t nbm2;
894 uint32_t nbm3;
895 uint32_t n_kv_max;
896};
897
898template <typename T> void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, T &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
899 GGML_UNUSED(p);
900 GGML_UNUSED(src0);
901 GGML_UNUSED(src1);
902 GGML_UNUSED(src2);
903 GGML_UNUSED(src3);
904 GGML_UNUSED(dst);
905 static_assert(!std::is_const<T>::value, "unexpected type");
906 GGML_ASSERT(!src0 || get_misalign_bytes(ctx, src0) == 0);
907 GGML_ASSERT(!src1 || get_misalign_bytes(ctx, src1) == 0);
908 GGML_ASSERT(!src2 || get_misalign_bytes(ctx, src2) == 0);
909 GGML_ASSERT(!src3 || get_misalign_bytes(ctx, src3) == 0);
910 GGML_ASSERT(!dst || get_misalign_bytes(ctx, dst) == 0);
911}
912
913template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_mat_vec_p021_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
914 const uint32_t b_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
915 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
916
917 p.b_offset = b_offset;
918 p.d_offset = d_offset;
919
920 GGML_UNUSED(src0);
921 GGML_UNUSED(src2);
922 GGML_UNUSED(src3);
923}
924
925template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_mat_vec_nc_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
926 const uint32_t b_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
927 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
928
929 p.b_offset = b_offset;
930 p.d_offset = d_offset;
931
932 GGML_UNUSED(src0);
933 GGML_UNUSED(src2);
934 GGML_UNUSED(src3);
935}
936
937template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_fwht_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
938 p.src_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
939 p.dst_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
940
941 GGML_UNUSED(src1);
942 GGML_UNUSED(src2);
943 GGML_UNUSED(src3);
944}
945
946template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_dsv4_hc_comb_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
947 p.m_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
948 p.s_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
949 p.b_offset = get_misalign_bytes(ctx, src2) / ggml_type_size(src2->type);
950 p.d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
951
952 GGML_UNUSED(src3);
953}
954
955template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_dsv4_hc_pre_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
956 p.x_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
957 p.w_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
958 p.d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
959
960 GGML_UNUSED(src2);
961 GGML_UNUSED(src3);
962}
963
964template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_dsv4_hc_post_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
965 p.x_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
966 p.r_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
967 p.p_offset = get_misalign_bytes(ctx, src2) / ggml_type_size(src2->type);
968 p.c_offset = src3 ? get_misalign_bytes(ctx, src3) / ggml_type_size(src3->type) : 0;
969 p.d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
970}
971
972template <typename T> size_t push_constant_size(const T &t) {
973 static_assert(std::is_class<T>::value, "T must be a struct/class");
974 GGML_UNUSED(t);
975 return sizeof(T);
976}
977
978template <typename T> size_t push_constant_size(const std::vector<T> &t) {
979 GGML_UNUSED(t);
980 return sizeof(T) * t.size();
981}
982
983template <typename T, uint32_t N> size_t push_constant_size(const std::array<T, N> &t) {
984 GGML_UNUSED(t);
985 return sizeof(T) * N;
986}
987
988template <typename T> const T *push_constant_data(const T &t) {
989 static_assert(std::is_class<T>::value, "T must be a struct/class");
990 return &t;
991}
992
993template <typename T> const T *push_constant_data(const std::vector<T> &t) {
994 return t.data();
995}
996
997template <typename T, uint32_t N> const T *push_constant_data(const std::array<T, N> &t) {
998 return t.data();
999}
1000
1001template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_unary_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1002 const uint32_t a_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1003 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1004
1005 p.misalign_offsets = (a_offset << 16) | d_offset;
1006
1007 GGML_UNUSED(src1);
1008 GGML_UNUSED(src2);
1009 GGML_UNUSED(src3);
1010}
1011
1012template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_glu_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1013 const uint32_t a_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1014 const uint32_t b_offset = src1 ? get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type) : a_offset;
1015 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1016
1017 GGML_ASSERT(a_offset < (1u << 8));
1018 GGML_ASSERT(b_offset < (1u << 8));
1019 GGML_ASSERT(d_offset < (1u << 8));
1020
1021 p.misalign_offsets = (a_offset << 16) | (b_offset << 8) | d_offset;
1022
1023 GGML_UNUSED(src2);
1024 GGML_UNUSED(src3);
1025}
1026
1027template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_sum_rows_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1028 const uint32_t a_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1029 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1030
1031 p.misalign_offsets = (a_offset << 16) | d_offset;
1032
1033 GGML_UNUSED(src1);
1034 GGML_UNUSED(src2);
1035 GGML_UNUSED(src3);
1036}
1037
1038template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_pad_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1039 const uint32_t a_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1040 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1041
1042 p.misalign_offsets = (a_offset << 16) | d_offset;
1043
1044 GGML_UNUSED(src1);
1045 GGML_UNUSED(src2);
1046 GGML_UNUSED(src3);
1047}
1048
1049template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_conv2d_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1050 p.knl_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1051 p.src_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
1052 p.dst_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1053
1054 GGML_UNUSED(src2);
1055 GGML_UNUSED(src3);
1056}
1057
1058template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_conv3d_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1059 p.knl_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1060 p.src_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
1061 p.dst_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1062
1063 GGML_UNUSED(src2);
1064 GGML_UNUSED(src3);
1065}
1066
1067template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_im2col_3d_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1068 const uint32_t a_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
1069 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1070
1071 p.misalign_offsets = (a_offset << 16) | d_offset;
1072
1073 GGML_UNUSED(src0);
1074 GGML_UNUSED(src2);
1075 GGML_UNUSED(src3);
1076}
1077
1078template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_binary_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1079 const uint32_t a_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1080 const uint32_t b_offset = get_misalign_bytes(ctx, src1) / ggml_type_size(src1->type);
1081 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1082
1083 GGML_ASSERT(a_offset <= 0xFFFF);
1084 GGML_ASSERT(b_offset <= 0xFF);
1085 GGML_ASSERT(d_offset <= 0xFF);
1086
1087 p.misalign_offsets = (a_offset << 16) | (b_offset << 8) | d_offset;
1088
1089 GGML_UNUSED(src2);
1090 GGML_UNUSED(src3);
1091}
1092
1093template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_concat_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1094 const uint32_t unit_size = ggml_vk_concat_unit_size(dst->type);
1095 const uint32_t a_offset = get_misalign_bytes(ctx, src0) / unit_size;
1096 const uint32_t b_offset = get_misalign_bytes(ctx, src1) / unit_size;
1097 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / unit_size;
1098
1099 p.misalign_offsets = (a_offset << 16) | (b_offset << 8) | d_offset;
1100
1101 GGML_UNUSED(src2);
1102 GGML_UNUSED(src3);
1103}
1104
1105template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_upscale_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1106 const uint32_t a_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1107 const uint32_t d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1108
1109 p.a_offset = a_offset;
1110 p.d_offset = d_offset;
1111
1112 GGML_UNUSED(src1);
1113 GGML_UNUSED(src2);
1114 GGML_UNUSED(src3);
1115}
1116
1117template <> inline void init_pushconst_tensor_offsets(ggml_backend_vk_context * ctx, vk_op_rope_push_constants &p, const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * src2, const ggml_tensor * src3, ggml_tensor * dst) {
1118 p.a_offset = get_misalign_bytes(ctx, src0) / ggml_type_size(src0->type);
1119 p.d_offset = get_misalign_bytes(ctx, dst) / ggml_type_size(dst->type);
1120
1121 GGML_UNUSED(src1);
1122 GGML_UNUSED(src2);
1123 GGML_UNUSED(src3);
1124}
1125
1126static vk_op_binary_push_constants ggml_vk_rms_norm_push_constants(
1127 const ggml_tensor * src0, const ggml_tensor * src1, const ggml_tensor * dst,
1128 float eps, uint32_t num_partials) {
1129 const uint32_t src0_type_size = ggml_type_size(src0->type);
1130 const uint32_t src1_type_size = ggml_type_size(src1->type);
1131 const uint32_t dst_type_size = ggml_type_size(dst->type);
1132
1133 return {
1134 (uint32_t)ggml_nelements(src0),
1135 (uint32_t)src0->ne[0], (uint32_t)src0->ne[1], (uint32_t)src0->ne[2],(uint32_t)src0->ne[3], (uint32_t)src0->nb[0] / src0_type_size, (uint32_t)src0->nb[1] / src0_type_size, (uint32_t)src0->nb[2] / src0_type_size, (uint32_t)src0->nb[3] / src0_type_size,
1136 (uint32_t)src1->ne[0], (uint32_t)src1->ne[1], (uint32_t)src1->ne[2],(uint32_t)src1->ne[3], (uint32_t)src1->nb[0] / src1_type_size, (uint32_t)src1->nb[1] / src1_type_size, (uint32_t)src1->nb[2] / src1_type_size, (uint32_t)src1->nb[3] / src1_type_size,
1137 (uint32_t) dst->ne[0], (uint32_t) dst->ne[1], (uint32_t) dst->ne[2],(uint32_t) dst->ne[3], (uint32_t) dst->nb[0] / dst_type_size, (uint32_t) dst->nb[1] / dst_type_size, (uint32_t) dst->nb[2] / dst_type_size, (uint32_t) dst->nb[3] / dst_type_size,
1138 0,
1139 eps, 0.0f, (int32_t)num_partials,
1140 };
1141}
1142