cui-llama.rn 1.4.0 → 1.4.1

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 (73) hide show
  1. package/android/src/main/jni.cpp +9 -9
  2. package/cpp/common.cpp +163 -60
  3. package/cpp/common.h +43 -12
  4. package/cpp/ggml-alloc.c +1042 -1037
  5. package/cpp/ggml-backend-impl.h +255 -256
  6. package/cpp/ggml-backend-reg.cpp +582 -582
  7. package/cpp/ggml-backend.cpp +2002 -2002
  8. package/cpp/ggml-backend.h +354 -352
  9. package/cpp/ggml-common.h +1853 -1853
  10. package/cpp/ggml-cpp.h +39 -39
  11. package/cpp/ggml-cpu-aarch64.cpp +4247 -4247
  12. package/cpp/ggml-cpu-aarch64.h +8 -8
  13. package/cpp/ggml-cpu-impl.h +386 -386
  14. package/cpp/ggml-cpu-quants.c +10920 -10839
  15. package/cpp/ggml-cpu-traits.cpp +36 -36
  16. package/cpp/ggml-cpu-traits.h +38 -38
  17. package/cpp/ggml-cpu.c +329 -60
  18. package/cpp/ggml-cpu.cpp +10 -2
  19. package/cpp/ggml-cpu.h +135 -135
  20. package/cpp/ggml-impl.h +567 -567
  21. package/cpp/ggml-metal-impl.h +17 -17
  22. package/cpp/ggml-metal.m +4884 -4884
  23. package/cpp/ggml-quants.c +5238 -5238
  24. package/cpp/ggml-threading.h +14 -14
  25. package/cpp/ggml.c +6514 -6448
  26. package/cpp/ggml.h +2194 -2163
  27. package/cpp/gguf.cpp +1329 -1325
  28. package/cpp/gguf.h +202 -202
  29. package/cpp/json-schema-to-grammar.cpp +1045 -1045
  30. package/cpp/json-schema-to-grammar.h +8 -8
  31. package/cpp/json.hpp +24766 -24766
  32. package/cpp/llama-adapter.cpp +347 -346
  33. package/cpp/llama-adapter.h +74 -73
  34. package/cpp/llama-arch.cpp +1487 -1434
  35. package/cpp/llama-arch.h +400 -395
  36. package/cpp/llama-batch.cpp +368 -368
  37. package/cpp/llama-batch.h +88 -88
  38. package/cpp/llama-chat.cpp +578 -567
  39. package/cpp/llama-chat.h +52 -51
  40. package/cpp/llama-context.cpp +1775 -1771
  41. package/cpp/llama-context.h +128 -128
  42. package/cpp/llama-cparams.cpp +1 -1
  43. package/cpp/llama-cparams.h +37 -37
  44. package/cpp/llama-cpp.h +30 -30
  45. package/cpp/llama-grammar.cpp +1139 -1139
  46. package/cpp/llama-grammar.h +143 -143
  47. package/cpp/llama-hparams.cpp +71 -71
  48. package/cpp/llama-hparams.h +139 -140
  49. package/cpp/llama-impl.cpp +167 -167
  50. package/cpp/llama-impl.h +61 -61
  51. package/cpp/llama-kv-cache.cpp +718 -718
  52. package/cpp/llama-kv-cache.h +218 -218
  53. package/cpp/llama-mmap.cpp +2 -1
  54. package/cpp/llama-mmap.h +67 -67
  55. package/cpp/llama-model-loader.cpp +1124 -1011
  56. package/cpp/llama-model-loader.h +167 -158
  57. package/cpp/llama-model.cpp +3997 -2202
  58. package/cpp/llama-model.h +370 -391
  59. package/cpp/llama-sampling.cpp +2408 -2406
  60. package/cpp/llama-sampling.h +32 -48
  61. package/cpp/llama-vocab.cpp +3247 -1982
  62. package/cpp/llama-vocab.h +125 -182
  63. package/cpp/llama.cpp +416 -2886
  64. package/cpp/llama.h +1323 -1285
  65. package/cpp/log.cpp +401 -401
  66. package/cpp/log.h +121 -121
  67. package/cpp/rn-llama.hpp +18 -12
  68. package/cpp/sampling.cpp +505 -500
  69. package/cpp/sgemm.cpp +2597 -2597
  70. package/cpp/speculative.cpp +277 -274
  71. package/cpp/speculative.h +28 -28
  72. package/cpp/unicode.cpp +2 -3
  73. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- #ifndef LM_GGML_METAL_IMPL
2
- #define LM_GGML_METAL_IMPL
1
+ #ifndef GGML_METAL_IMPL
2
+ #define GGML_METAL_IMPL
3
3
 
4
4
  // kernel argument structs
5
5
  //
@@ -34,7 +34,7 @@ typedef struct {
34
34
  uint64_t nb2;
35
35
  uint64_t nb3;
36
36
  int32_t dim;
37
- } lm_ggml_metal_kargs_concat;
37
+ } ggml_metal_kargs_concat;
38
38
 
39
39
  typedef struct {
40
40
  int32_t ne00;
@@ -62,7 +62,7 @@ typedef struct {
62
62
  uint64_t nb2;
63
63
  uint64_t nb3;
64
64
  uint64_t offs;
65
- } lm_ggml_metal_kargs_bin;
65
+ } ggml_metal_kargs_bin;
66
66
 
67
67
  typedef struct {
68
68
  int32_t ne00;
@@ -81,7 +81,7 @@ typedef struct {
81
81
  uint64_t nb1;
82
82
  uint64_t nb2;
83
83
  uint64_t nb3;
84
- } lm_ggml_metal_kargs_repeat;
84
+ } ggml_metal_kargs_repeat;
85
85
 
86
86
  typedef struct {
87
87
  int64_t ne00;
@@ -100,7 +100,7 @@ typedef struct {
100
100
  uint64_t nb1;
101
101
  uint64_t nb2;
102
102
  uint64_t nb3;
103
- } lm_ggml_metal_kargs_cpy;
103
+ } ggml_metal_kargs_cpy;
104
104
 
105
105
  typedef struct {
106
106
  int64_t ne10;
@@ -115,7 +115,7 @@ typedef struct {
115
115
  uint64_t nb3;
116
116
  uint64_t offs;
117
117
  bool inplace;
118
- } lm_ggml_metal_kargs_set;
118
+ } ggml_metal_kargs_set;
119
119
 
120
120
  typedef struct {
121
121
  int32_t ne00;
@@ -143,7 +143,7 @@ typedef struct {
143
143
  float attn_factor;
144
144
  float beta_fast;
145
145
  float beta_slow;
146
- } lm_ggml_metal_kargs_rope;
146
+ } ggml_metal_kargs_rope;
147
147
 
148
148
  typedef struct {
149
149
  int32_t ne01;
@@ -167,7 +167,7 @@ typedef struct {
167
167
  float m1;
168
168
  uint16_t n_head_log2;
169
169
  float logit_softcap;
170
- } lm_ggml_metal_kargs_flash_attn_ext;
170
+ } ggml_metal_kargs_flash_attn_ext;
171
171
 
172
172
  typedef struct {
173
173
  int32_t ne00;
@@ -184,7 +184,7 @@ typedef struct {
184
184
  int32_t ne1;
185
185
  int16_t r2;
186
186
  int16_t r3;
187
- } lm_ggml_metal_kargs_mul_mm;
187
+ } ggml_metal_kargs_mul_mm;
188
188
 
189
189
  typedef struct {
190
190
  int32_t ne00;
@@ -205,7 +205,7 @@ typedef struct {
205
205
  int32_t ne1;
206
206
  int16_t r2;
207
207
  int16_t r3;
208
- } lm_ggml_metal_kargs_mul_mv;
208
+ } ggml_metal_kargs_mul_mv;
209
209
 
210
210
  typedef struct {
211
211
  int32_t ne00;
@@ -229,7 +229,7 @@ typedef struct {
229
229
  int16_t nsg;
230
230
  int16_t nxpsg;
231
231
  int16_t r1ptg;
232
- } lm_ggml_metal_kargs_mul_mv_ext;
232
+ } ggml_metal_kargs_mul_mv_ext;
233
233
 
234
234
  typedef struct {
235
235
  int32_t nei0;
@@ -247,7 +247,7 @@ typedef struct {
247
247
  uint64_t nb12;
248
248
  int32_t ne0;
249
249
  int32_t ne1;
250
- } lm_ggml_metal_kargs_mul_mm_id;
250
+ } ggml_metal_kargs_mul_mm_id;
251
251
 
252
252
  typedef struct {
253
253
  int32_t nei0;
@@ -269,20 +269,20 @@ typedef struct {
269
269
  int32_t ne0;
270
270
  int32_t ne1;
271
271
  uint64_t nb1;
272
- } lm_ggml_metal_kargs_mul_mv_id;
272
+ } ggml_metal_kargs_mul_mv_id;
273
273
 
274
274
  typedef struct {
275
275
  int32_t ne00;
276
276
  int32_t ne00_4;
277
277
  uint64_t nb01;
278
278
  float eps;
279
- } lm_ggml_metal_kargs_norm;
279
+ } ggml_metal_kargs_norm;
280
280
 
281
281
  typedef struct {
282
282
  int32_t ne00;
283
283
  int32_t ne00_4;
284
284
  uint64_t nb01;
285
285
  float eps;
286
- } lm_ggml_metal_kargs_rms_norm;
286
+ } ggml_metal_kargs_rms_norm;
287
287
 
288
- #endif // LM_GGML_METAL_IMPL
288
+ #endif // GGML_METAL_IMPL