whisper.rn 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/android/build.gradle +2 -1
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/jni.cpp +12 -3
  4. package/cpp/ggml-alloc.c +292 -130
  5. package/cpp/ggml-backend-impl.h +4 -4
  6. package/cpp/ggml-backend-reg.cpp +13 -5
  7. package/cpp/ggml-backend.cpp +207 -17
  8. package/cpp/ggml-backend.h +19 -1
  9. package/cpp/ggml-cpu/amx/amx.cpp +5 -2
  10. package/cpp/ggml-cpu/arch/x86/repack.cpp +2 -2
  11. package/cpp/ggml-cpu/arch-fallback.h +0 -4
  12. package/cpp/ggml-cpu/common.h +14 -0
  13. package/cpp/ggml-cpu/ggml-cpu-impl.h +14 -7
  14. package/cpp/ggml-cpu/ggml-cpu.c +65 -44
  15. package/cpp/ggml-cpu/ggml-cpu.cpp +14 -4
  16. package/cpp/ggml-cpu/ops.cpp +542 -775
  17. package/cpp/ggml-cpu/ops.h +2 -0
  18. package/cpp/ggml-cpu/simd-mappings.h +88 -59
  19. package/cpp/ggml-cpu/unary-ops.cpp +135 -0
  20. package/cpp/ggml-cpu/unary-ops.h +5 -0
  21. package/cpp/ggml-cpu/vec.cpp +227 -20
  22. package/cpp/ggml-cpu/vec.h +407 -56
  23. package/cpp/ggml-cpu.h +1 -1
  24. package/cpp/ggml-impl.h +94 -12
  25. package/cpp/ggml-metal/ggml-metal-common.cpp +446 -0
  26. package/cpp/ggml-metal/ggml-metal-common.h +52 -0
  27. package/cpp/ggml-metal/ggml-metal-context.h +33 -0
  28. package/cpp/ggml-metal/ggml-metal-context.m +600 -0
  29. package/cpp/ggml-metal/ggml-metal-device.cpp +1565 -0
  30. package/cpp/ggml-metal/ggml-metal-device.h +244 -0
  31. package/cpp/ggml-metal/ggml-metal-device.m +1325 -0
  32. package/cpp/ggml-metal/ggml-metal-impl.h +802 -0
  33. package/cpp/ggml-metal/ggml-metal-ops.cpp +3583 -0
  34. package/cpp/ggml-metal/ggml-metal-ops.h +88 -0
  35. package/cpp/ggml-metal/ggml-metal.cpp +718 -0
  36. package/cpp/ggml-metal/ggml-whisper-sim.metallib +0 -0
  37. package/cpp/ggml-metal/ggml-whisper.metallib +0 -0
  38. package/cpp/ggml-metal-impl.h +40 -40
  39. package/cpp/ggml-metal.h +1 -6
  40. package/cpp/ggml-quants.c +1 -0
  41. package/cpp/ggml.c +341 -15
  42. package/cpp/ggml.h +150 -5
  43. package/cpp/jsi/RNWhisperJSI.cpp +9 -2
  44. package/cpp/jsi/ThreadPool.h +3 -3
  45. package/cpp/rn-whisper.h +1 -0
  46. package/cpp/whisper.cpp +89 -72
  47. package/cpp/whisper.h +1 -0
  48. package/ios/CMakeLists.txt +6 -1
  49. package/ios/RNWhisperContext.mm +3 -1
  50. package/ios/RNWhisperVadContext.mm +14 -13
  51. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-backend-impl.h +4 -4
  52. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-backend.h +19 -1
  53. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-cpu.h +1 -1
  54. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-impl.h +94 -12
  55. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-metal-impl.h +40 -40
  56. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml-metal.h +1 -6
  57. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/ggml.h +150 -5
  58. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/rn-whisper.h +1 -0
  59. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Headers/whisper.h +1 -0
  60. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/Info.plist +0 -0
  61. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/ggml-whisper.metallib +0 -0
  62. package/ios/rnwhisper.xcframework/ios-arm64/rnwhisper.framework/rnwhisper +0 -0
  63. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-backend-impl.h +4 -4
  64. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-backend.h +19 -1
  65. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-cpu.h +1 -1
  66. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-impl.h +94 -12
  67. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-metal-impl.h +40 -40
  68. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-metal.h +1 -6
  69. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml.h +150 -5
  70. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/rn-whisper.h +1 -0
  71. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Headers/whisper.h +1 -0
  72. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/Info.plist +0 -0
  73. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/_CodeSignature/CodeResources +1 -1
  74. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/ggml-whisper-sim.metallib +0 -0
  75. package/ios/rnwhisper.xcframework/ios-arm64_x86_64-simulator/rnwhisper.framework/rnwhisper +0 -0
  76. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-backend-impl.h +4 -4
  77. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-backend.h +19 -1
  78. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-cpu.h +1 -1
  79. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-impl.h +94 -12
  80. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-metal-impl.h +40 -40
  81. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml-metal.h +1 -6
  82. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/ggml.h +150 -5
  83. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/rn-whisper.h +1 -0
  84. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Headers/whisper.h +1 -0
  85. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/Info.plist +0 -0
  86. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/ggml-whisper.metallib +0 -0
  87. package/ios/rnwhisper.xcframework/tvos-arm64/rnwhisper.framework/rnwhisper +0 -0
  88. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-backend-impl.h +4 -4
  89. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-backend.h +19 -1
  90. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-cpu.h +1 -1
  91. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-impl.h +94 -12
  92. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-metal-impl.h +40 -40
  93. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml-metal.h +1 -6
  94. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/ggml.h +150 -5
  95. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/rn-whisper.h +1 -0
  96. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Headers/whisper.h +1 -0
  97. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/Info.plist +0 -0
  98. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/_CodeSignature/CodeResources +1 -1
  99. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/ggml-whisper-sim.metallib +0 -0
  100. package/ios/rnwhisper.xcframework/tvos-arm64_x86_64-simulator/rnwhisper.framework/rnwhisper +0 -0
  101. package/lib/commonjs/NativeRNWhisper.js.map +1 -1
  102. package/lib/commonjs/version.json +1 -1
  103. package/lib/module/NativeRNWhisper.js.map +1 -1
  104. package/lib/module/version.json +1 -1
  105. package/lib/typescript/NativeRNWhisper.d.ts +2 -0
  106. package/lib/typescript/NativeRNWhisper.d.ts.map +1 -1
  107. package/package.json +1 -1
  108. package/src/NativeRNWhisper.ts +2 -0
  109. package/src/version.json +1 -1
  110. package/whisper-rn.podspec +8 -9
  111. package/cpp/ggml-metal.m +0 -6779
  112. package/cpp/ggml-whisper-sim.metallib +0 -0
  113. package/cpp/ggml-whisper.metallib +0 -0
@@ -1,5 +1,5 @@
1
- #ifndef WSP_GGML_METAL_IMPL
2
- #define WSP_GGML_METAL_IMPL
1
+ #ifndef WSP_WSP_WSP_GGML_METAL_IMPL
2
+ #define WSP_WSP_WSP_GGML_METAL_IMPL
3
3
 
4
4
  // kernel parameters for mat-vec threadgroups
5
5
  //
@@ -101,7 +101,7 @@ typedef struct {
101
101
  uint64_t nb2;
102
102
  uint64_t nb3;
103
103
  int32_t dim;
104
- } wsp_ggml_metal_kargs_concat;
104
+ } wsp_wsp_wsp_ggml_metal_kargs_concat;
105
105
 
106
106
  typedef struct {
107
107
  int32_t ne00;
@@ -130,7 +130,7 @@ typedef struct {
130
130
  uint64_t nb3;
131
131
  uint64_t offs;
132
132
  uint64_t o1[8];
133
- } wsp_ggml_metal_kargs_bin;
133
+ } wsp_wsp_wsp_ggml_metal_kargs_bin;
134
134
 
135
135
  typedef struct {
136
136
  int64_t ne0;
@@ -139,7 +139,7 @@ typedef struct {
139
139
  size_t nb02;
140
140
  size_t nb11;
141
141
  size_t nb21;
142
- } wsp_ggml_metal_kargs_add_id;
142
+ } wsp_wsp_wsp_ggml_metal_kargs_add_id;
143
143
 
144
144
  typedef struct {
145
145
  int32_t ne00;
@@ -158,7 +158,7 @@ typedef struct {
158
158
  uint64_t nb1;
159
159
  uint64_t nb2;
160
160
  uint64_t nb3;
161
- } wsp_ggml_metal_kargs_repeat;
161
+ } wsp_wsp_wsp_ggml_metal_kargs_repeat;
162
162
 
163
163
  typedef struct {
164
164
  int64_t ne00;
@@ -177,7 +177,7 @@ typedef struct {
177
177
  uint64_t nb1;
178
178
  uint64_t nb2;
179
179
  uint64_t nb3;
180
- } wsp_ggml_metal_kargs_cpy;
180
+ } wsp_wsp_wsp_ggml_metal_kargs_cpy;
181
181
 
182
182
  typedef struct {
183
183
  int64_t ne10;
@@ -192,7 +192,7 @@ typedef struct {
192
192
  uint64_t nb3;
193
193
  uint64_t offs;
194
194
  bool inplace;
195
- } wsp_ggml_metal_kargs_set;
195
+ } wsp_wsp_wsp_ggml_metal_kargs_set;
196
196
 
197
197
  typedef struct {
198
198
  int32_t ne00;
@@ -224,7 +224,7 @@ typedef struct {
224
224
  int32_t sect_1;
225
225
  int32_t sect_2;
226
226
  int32_t sect_3;
227
- } wsp_ggml_metal_kargs_rope;
227
+ } wsp_wsp_wsp_ggml_metal_kargs_rope;
228
228
 
229
229
  typedef struct {
230
230
  int32_t ne01;
@@ -255,7 +255,7 @@ typedef struct {
255
255
  float m1;
256
256
  int32_t n_head_log2;
257
257
  float logit_softcap;
258
- } wsp_ggml_metal_kargs_flash_attn_ext;
258
+ } wsp_wsp_wsp_ggml_metal_kargs_flash_attn_ext;
259
259
 
260
260
  typedef struct {
261
261
  int32_t ne00;
@@ -272,7 +272,7 @@ typedef struct {
272
272
  int32_t ne1;
273
273
  int16_t r2;
274
274
  int16_t r3;
275
- } wsp_ggml_metal_kargs_mul_mm;
275
+ } wsp_wsp_wsp_ggml_metal_kargs_mul_mm;
276
276
 
277
277
  typedef struct {
278
278
  int32_t ne00;
@@ -293,7 +293,7 @@ typedef struct {
293
293
  int32_t ne1;
294
294
  int16_t r2;
295
295
  int16_t r3;
296
- } wsp_ggml_metal_kargs_mul_mv;
296
+ } wsp_wsp_wsp_ggml_metal_kargs_mul_mv;
297
297
 
298
298
  typedef struct {
299
299
  int32_t ne00;
@@ -317,7 +317,7 @@ typedef struct {
317
317
  int16_t nsg;
318
318
  int16_t nxpsg;
319
319
  int16_t r1ptg;
320
- } wsp_ggml_metal_kargs_mul_mv_ext;
320
+ } wsp_wsp_wsp_ggml_metal_kargs_mul_mv_ext;
321
321
 
322
322
  typedef struct {
323
323
  int32_t ne10;
@@ -328,7 +328,7 @@ typedef struct {
328
328
  uint64_t nbh11;
329
329
  int32_t ne20; // n_expert_used
330
330
  uint64_t nb21;
331
- } wsp_ggml_metal_kargs_mul_mm_id_map0;
331
+ } wsp_wsp_wsp_ggml_metal_kargs_mul_mm_id_map0;
332
332
 
333
333
  typedef struct {
334
334
  int32_t ne20; // n_expert_used
@@ -339,7 +339,7 @@ typedef struct {
339
339
  int32_t ne0;
340
340
  uint64_t nb1;
341
341
  uint64_t nb2;
342
- } wsp_ggml_metal_kargs_mul_mm_id_map1;
342
+ } wsp_wsp_wsp_ggml_metal_kargs_mul_mm_id_map1;
343
343
 
344
344
  typedef struct {
345
345
  int32_t ne00;
@@ -356,7 +356,7 @@ typedef struct {
356
356
  int32_t neh1;
357
357
  int16_t r2;
358
358
  int16_t r3;
359
- } wsp_ggml_metal_kargs_mul_mm_id;
359
+ } wsp_wsp_wsp_ggml_metal_kargs_mul_mm_id;
360
360
 
361
361
  typedef struct {
362
362
  int32_t nei0;
@@ -378,14 +378,14 @@ typedef struct {
378
378
  int32_t ne0;
379
379
  int32_t ne1;
380
380
  uint64_t nb1;
381
- } wsp_ggml_metal_kargs_mul_mv_id;
381
+ } wsp_wsp_wsp_ggml_metal_kargs_mul_mv_id;
382
382
 
383
383
  typedef struct {
384
384
  int32_t ne00;
385
385
  int32_t ne00_4;
386
386
  uint64_t nb01;
387
387
  float eps;
388
- } wsp_ggml_metal_kargs_norm;
388
+ } wsp_wsp_wsp_ggml_metal_kargs_norm;
389
389
 
390
390
  typedef struct {
391
391
  int32_t ne00;
@@ -400,14 +400,14 @@ typedef struct {
400
400
  uint64_t nbf1[3];
401
401
  uint64_t nbf2[3];
402
402
  uint64_t nbf3[3];
403
- } wsp_ggml_metal_kargs_rms_norm;
403
+ } wsp_wsp_wsp_ggml_metal_kargs_rms_norm;
404
404
 
405
405
  typedef struct {
406
406
  int32_t ne00;
407
407
  int32_t ne00_4;
408
408
  uint64_t nb01;
409
409
  float eps;
410
- } wsp_ggml_metal_kargs_l2_norm;
410
+ } wsp_wsp_wsp_ggml_metal_kargs_l2_norm;
411
411
 
412
412
  typedef struct {
413
413
  int64_t ne00;
@@ -418,7 +418,7 @@ typedef struct {
418
418
  uint64_t nb02;
419
419
  int32_t n_groups;
420
420
  float eps;
421
- } wsp_ggml_metal_kargs_group_norm;
421
+ } wsp_wsp_wsp_ggml_metal_kargs_group_norm;
422
422
 
423
423
  typedef struct {
424
424
  int32_t IC;
@@ -427,7 +427,7 @@ typedef struct {
427
427
  int32_t s0;
428
428
  uint64_t nb0;
429
429
  uint64_t nb1;
430
- } wsp_ggml_metal_kargs_conv_transpose_1d;
430
+ } wsp_wsp_wsp_ggml_metal_kargs_conv_transpose_1d;
431
431
 
432
432
  typedef struct {
433
433
  uint64_t ofs0;
@@ -445,7 +445,7 @@ typedef struct {
445
445
  int32_t KH;
446
446
  int32_t KW;
447
447
  int32_t KHW; // KH * KW, pre-computed on CPU to save GPU resources
448
- } wsp_ggml_metal_kargs_im2col;
448
+ } wsp_wsp_wsp_ggml_metal_kargs_im2col;
449
449
 
450
450
  typedef struct{
451
451
  int32_t ne00;
@@ -458,7 +458,7 @@ typedef struct{
458
458
  int32_t i10;
459
459
  float alpha;
460
460
  float limit;
461
- } wsp_ggml_metal_kargs_glu;
461
+ } wsp_wsp_wsp_ggml_metal_kargs_glu;
462
462
 
463
463
  typedef struct {
464
464
  int64_t ne00;
@@ -485,7 +485,7 @@ typedef struct {
485
485
  uint64_t nb1;
486
486
  uint64_t nb2;
487
487
  uint64_t nb3;
488
- } wsp_ggml_metal_kargs_sum_rows;
488
+ } wsp_wsp_wsp_ggml_metal_kargs_sum_rows;
489
489
 
490
490
  typedef struct {
491
491
  int32_t ne00;
@@ -508,13 +508,13 @@ typedef struct {
508
508
  float m0;
509
509
  float m1;
510
510
  int32_t n_head_log2;
511
- } wsp_ggml_metal_kargs_soft_max;
511
+ } wsp_wsp_wsp_ggml_metal_kargs_soft_max;
512
512
 
513
513
  typedef struct {
514
514
  int64_t ne00;
515
515
  int64_t ne01;
516
516
  int n_past;
517
- } wsp_ggml_metal_kargs_diag_mask_inf;
517
+ } wsp_wsp_wsp_ggml_metal_kargs_diag_mask_inf;
518
518
 
519
519
  typedef struct {
520
520
  int64_t ne00;
@@ -533,7 +533,7 @@ typedef struct {
533
533
  uint64_t nb0;
534
534
  uint64_t nb1;
535
535
  uint64_t nb2;
536
- } wsp_ggml_metal_kargs_ssm_conv;
536
+ } wsp_wsp_wsp_ggml_metal_kargs_ssm_conv;
537
537
 
538
538
  typedef struct {
539
539
  int64_t d_state;
@@ -558,7 +558,7 @@ typedef struct {
558
558
  uint64_t nb51;
559
559
  uint64_t nb52;
560
560
  uint64_t nb53;
561
- } wsp_ggml_metal_kargs_ssm_scan;
561
+ } wsp_wsp_wsp_ggml_metal_kargs_ssm_scan;
562
562
 
563
563
  typedef struct {
564
564
  int64_t ne00;
@@ -569,7 +569,7 @@ typedef struct {
569
569
  uint64_t nb11;
570
570
  uint64_t nb1;
571
571
  uint64_t nb2;
572
- } wsp_ggml_metal_kargs_get_rows;
572
+ } wsp_wsp_wsp_ggml_metal_kargs_get_rows;
573
573
 
574
574
  typedef struct {
575
575
  int32_t nk0;
@@ -585,7 +585,7 @@ typedef struct {
585
585
  uint64_t nb1;
586
586
  uint64_t nb2;
587
587
  uint64_t nb3;
588
- } wsp_ggml_metal_kargs_set_rows;
588
+ } wsp_wsp_wsp_ggml_metal_kargs_set_rows;
589
589
 
590
590
  typedef struct {
591
591
  int64_t ne00;
@@ -608,7 +608,7 @@ typedef struct {
608
608
  float sf1;
609
609
  float sf2;
610
610
  float sf3;
611
- } wsp_ggml_metal_kargs_upscale;
611
+ } wsp_wsp_wsp_ggml_metal_kargs_upscale;
612
612
 
613
613
  typedef struct {
614
614
  int64_t ne00;
@@ -627,7 +627,7 @@ typedef struct {
627
627
  uint64_t nb1;
628
628
  uint64_t nb2;
629
629
  uint64_t nb3;
630
- } wsp_ggml_metal_kargs_pad;
630
+ } wsp_wsp_wsp_ggml_metal_kargs_pad;
631
631
 
632
632
  typedef struct {
633
633
  int64_t ne00;
@@ -648,28 +648,28 @@ typedef struct {
648
648
  uint64_t nb3;
649
649
  int32_t p0;
650
650
  int32_t p1;
651
- } wsp_ggml_metal_kargs_pad_reflect_1d;
651
+ } wsp_wsp_wsp_ggml_metal_kargs_pad_reflect_1d;
652
652
 
653
653
  typedef struct {
654
654
  uint64_t nb1;
655
655
  int dim;
656
656
  int max_period;
657
- } wsp_ggml_metal_kargs_timestep_embedding;
657
+ } wsp_wsp_wsp_ggml_metal_kargs_timestep_embedding;
658
658
 
659
659
  typedef struct {
660
660
  float slope;
661
- } wsp_ggml_metal_kargs_leaky_relu;
661
+ } wsp_wsp_wsp_ggml_metal_kargs_leaky_relu;
662
662
 
663
663
  typedef struct {
664
664
  int64_t ncols;
665
665
  int64_t ncols_pad;
666
- } wsp_ggml_metal_kargs_argsort;
666
+ } wsp_wsp_wsp_ggml_metal_kargs_argsort;
667
667
 
668
668
  typedef struct {
669
669
  int64_t ne0;
670
670
  float start;
671
671
  float step;
672
- } wsp_ggml_metal_kargs_arange;
672
+ } wsp_wsp_wsp_ggml_metal_kargs_arange;
673
673
 
674
674
  typedef struct {
675
675
  int32_t k0;
@@ -683,6 +683,6 @@ typedef struct {
683
683
  int64_t OH;
684
684
  int64_t OW;
685
685
  int64_t parallel_elements;
686
- } wsp_ggml_metal_kargs_pool_2d;
686
+ } wsp_wsp_wsp_ggml_metal_kargs_pool_2d;
687
687
 
688
- #endif // WSP_GGML_METAL_IMPL
688
+ #endif // WSP_WSP_WSP_GGML_METAL_IMPL
package/cpp/ggml-metal.h CHANGED
@@ -39,18 +39,13 @@ extern "C" {
39
39
  // user-code should use only these functions
40
40
  //
41
41
 
42
+ // TODO: remove in the future
42
43
  WSP_GGML_BACKEND_API wsp_ggml_backend_t wsp_ggml_backend_metal_init(void);
43
44
 
44
45
  WSP_GGML_BACKEND_API bool wsp_ggml_backend_is_metal(wsp_ggml_backend_t backend);
45
46
 
46
- WSP_GGML_DEPRECATED(
47
- WSP_GGML_BACKEND_API wsp_ggml_backend_buffer_t wsp_ggml_backend_metal_buffer_from_ptr(void * data, size_t size, size_t max_size),
48
- "obsoleted by the new device interface - https://github.com/ggml-org/llama.cpp/pull/9713");
49
-
50
47
  WSP_GGML_BACKEND_API void wsp_ggml_backend_metal_set_abort_callback(wsp_ggml_backend_t backend, wsp_ggml_abort_callback abort_callback, void * user_data);
51
48
 
52
- WSP_GGML_BACKEND_API wsp_ggml_backend_buffer_type_t wsp_ggml_backend_metal_buffer_type(void);
53
-
54
49
  // helper to check if the device supports a specific family
55
50
  // ideally, the user code should be doing these checks
56
51
  // ref: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
package/cpp/ggml-quants.c CHANGED
@@ -3721,6 +3721,7 @@ static void wsp_quantize_row_iq3_xxs_impl(int grid_size, const float * WSP_GGML_
3721
3721
  }
3722
3722
  float best = 0;
3723
3723
  float scale = max/(2*kMaxQ-1);
3724
+ for (int k = 0; k < 8; ++k) is_on_grid[k] = true;
3724
3725
  for (int is = -15; is <= 15; ++is) {
3725
3726
  float id = (2*kMaxQ-1+is*0.2f)/max;
3726
3727
  float this_scale = 1/id;