@genai-fi/nanogpt 0.17.4 → 0.18.0

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 (258) hide show
  1. package/dist/Generator.d.ts +2 -15
  2. package/dist/Generator.js +45 -34
  3. package/dist/{RealDiv-CGwv0liw.js → RealDiv-ioj6Z-ox.js} +9 -9
  4. package/dist/{Reshape-BW__R4mZ.js → Reshape-BZC-ebeR.js} +7 -7
  5. package/dist/{Reshape-CPBkTIH2.js → Reshape-pwprEaej.js} +1 -1
  6. package/dist/TeachableLLM.d.ts +3 -8
  7. package/dist/TeachableLLM.js +61 -44
  8. package/dist/Trainer.d.ts +6 -4
  9. package/dist/Trainer.js +107 -92
  10. package/dist/{axis_util-GTVlo58H.js → axis_util-QWWgLjut.js} +1 -1
  11. package/dist/backend.js +2 -2
  12. package/dist/{backend_util-GaFarB78.js → backend_util-qwSFfxYx.js} +21 -21
  13. package/dist/{backend_webgpu-BqASlsbV.js → backend_webgpu-DI2wXEC2.js} +8 -8
  14. package/dist/{broadcast_to-eS93CCN_.js → broadcast_to-C_EJTVTZ.js} +2 -2
  15. package/dist/checks/appendCache.js +2 -2
  16. package/dist/checks/attentionMask.js +5 -5
  17. package/dist/checks/gelu.js +2 -2
  18. package/dist/checks/matMulGelu.js +2 -2
  19. package/dist/checks/normRMS.js +6 -6
  20. package/dist/checks/normRMSGrad.js +3 -3
  21. package/dist/checks/packUnpack.js +6 -6
  22. package/dist/checks/qkv.js +2 -2
  23. package/dist/checks/rope.js +2 -2
  24. package/dist/{clip_by_value-DDA7rrcT.js → clip_by_value-CLAD4h_I.js} +1 -1
  25. package/dist/complex-3DpPEG9B.js +11 -0
  26. package/dist/{concat-CAQpCret.js → concat-Dqk7Xk7h.js} +5 -5
  27. package/dist/{concat_util-D18dJ4fD.js → concat_util-C1Mxe27t.js} +1 -1
  28. package/dist/{dataset-CGGp1z9P.js → dataset-DlqAN81i.js} +3 -3
  29. package/dist/{dropout_util--NxWuYg2.js → dropout_util-N0z8Os-K.js} +1 -1
  30. package/dist/{expand_dims-Bkd1YD5x.js → expand_dims-D0rBtgT1.js} +4 -4
  31. package/dist/{exports_initializers-CYzKLjN7.js → exports_initializers-DIOZQt_L.js} +1 -1
  32. package/dist/{floor-BQtb-Azg.js → floor-CymuCmTO.js} +1 -1
  33. package/dist/{gather-qIqEqaGn.js → gather-DEyjXNb1.js} +1 -1
  34. package/dist/{gelu-B220X1Go.js → gelu-DpTCC3eB.js} +1 -1
  35. package/dist/{gpgpu_math-BwvV12df.js → gpgpu_math-3bCb5ooU.js} +25 -25
  36. package/dist/{index-CjOWnMXP.js → index-BQvB7LCC.js} +15 -15
  37. package/dist/{index-CUXkjxiT.js → index-DSGwv2Yx.js} +33 -33
  38. package/dist/inference/types.d.ts +16 -0
  39. package/dist/inference/types.js +1 -0
  40. package/dist/{kernel_funcs_utils-pq0CK9co.js → kernel_funcs_utils-DGqzNlHT.js} +6 -6
  41. package/dist/layers/BaseLayer.js +4 -4
  42. package/dist/layers/CausalSelfAttention.js +6 -6
  43. package/dist/layers/LoRA.js +4 -4
  44. package/dist/layers/MLP.js +4 -4
  45. package/dist/layers/PositionEmbedding.js +5 -5
  46. package/dist/layers/RMSNorm.js +3 -3
  47. package/dist/layers/RoPECache.js +4 -4
  48. package/dist/layers/TiedEmbedding.js +6 -6
  49. package/dist/layers/TransformerBlock.js +1 -1
  50. package/dist/layers/WeightStore.js +2 -2
  51. package/dist/loader/load.d.ts +2 -8
  52. package/dist/loader/loadTransformers.d.ts +2 -8
  53. package/dist/loader/loadTransformers.js +13 -11
  54. package/dist/loader/newZipLoad.d.ts +2 -8
  55. package/dist/loader/newZipLoad.js +25 -10
  56. package/dist/loader/oldZipLoad.js +13 -13
  57. package/dist/loader/save.d.ts +9 -2
  58. package/dist/loader/save.js +64 -55
  59. package/dist/loader/types.d.ts +29 -1
  60. package/dist/main.d.ts +2 -0
  61. package/dist/main.js +45 -43
  62. package/dist/{matMul16-BcVC_E62.js → matMul16-BIT70Vya.js} +3 -3
  63. package/dist/{matMulGelu-JNLZqKQp.js → matMulGelu-CsZnh18H.js} +18 -18
  64. package/dist/mat_mul-DP86qZtZ.js +11 -0
  65. package/dist/mod-BXjLYwvM.js +11 -0
  66. package/dist/models/NanoGPTV1.js +2 -2
  67. package/dist/models/NanoGPTV2.js +2 -2
  68. package/dist/models/model.d.ts +3 -2
  69. package/dist/models/model.js +13 -13
  70. package/dist/{not_equal-hurPF26l.js → not_equal-CkQKkKZy.js} +15 -15
  71. package/dist/{ones-BytntneX.js → ones-DbVB5N58.js} +3 -3
  72. package/dist/ops/adamAdjust.js +3 -3
  73. package/dist/ops/adamMoments.js +3 -3
  74. package/dist/ops/add16.js +1 -1
  75. package/dist/ops/appendCache.js +6 -6
  76. package/dist/ops/attentionMask.js +3 -3
  77. package/dist/ops/concat16.js +3 -3
  78. package/dist/ops/cpu/adamAdjust.js +9 -9
  79. package/dist/ops/cpu/adamMoments.js +5 -5
  80. package/dist/ops/cpu/appendCache.js +2 -2
  81. package/dist/ops/cpu/attentionMask.js +6 -6
  82. package/dist/ops/cpu/fusedSoftmax.js +4 -4
  83. package/dist/ops/cpu/gatherSub.js +5 -5
  84. package/dist/ops/cpu/gelu.js +4 -4
  85. package/dist/ops/cpu/matMul16.js +2 -2
  86. package/dist/ops/cpu/matMulGelu.js +7 -7
  87. package/dist/ops/cpu/matMulMul.js +2 -2
  88. package/dist/ops/cpu/mulDropout.js +5 -5
  89. package/dist/ops/cpu/normRMS.js +1 -1
  90. package/dist/ops/cpu/qkv.js +3 -3
  91. package/dist/ops/cpu/rope.js +5 -5
  92. package/dist/ops/cpu/scatterSub.js +5 -5
  93. package/dist/ops/dot16.js +2 -2
  94. package/dist/ops/dropout.js +6 -6
  95. package/dist/ops/dropout16.js +1 -1
  96. package/dist/ops/gatherSub.js +1 -1
  97. package/dist/ops/gelu.js +2 -2
  98. package/dist/ops/globalNorm.js +7 -7
  99. package/dist/ops/grads/add16.js +1 -1
  100. package/dist/ops/grads/attentionMask.js +2 -2
  101. package/dist/ops/grads/dropout16.js +1 -1
  102. package/dist/ops/grads/gelu.js +2 -2
  103. package/dist/ops/grads/matMul16.js +3 -3
  104. package/dist/ops/grads/matMulGelu.js +1 -1
  105. package/dist/ops/grads/mul16.js +1 -1
  106. package/dist/ops/grads/normRMS.js +7 -7
  107. package/dist/ops/grads/pack16.js +3 -3
  108. package/dist/ops/grads/qkv.js +11 -11
  109. package/dist/ops/grads/rope.js +2 -2
  110. package/dist/ops/grads/softmax16.js +1 -1
  111. package/dist/ops/grads/unpack16.js +2 -2
  112. package/dist/ops/matMul16.js +3 -3
  113. package/dist/ops/matMulGelu.js +6 -6
  114. package/dist/ops/matMulMul.js +3 -3
  115. package/dist/ops/mul16.js +1 -1
  116. package/dist/ops/mulDrop.js +3 -3
  117. package/dist/ops/normRMS.js +4 -4
  118. package/dist/ops/pack16.js +2 -2
  119. package/dist/ops/qkv.js +3 -3
  120. package/dist/ops/reshape16.js +6 -6
  121. package/dist/ops/rope.js +2 -2
  122. package/dist/ops/scatterSub.js +1 -1
  123. package/dist/ops/slice16.js +2 -2
  124. package/dist/ops/softmax16.js +1 -1
  125. package/dist/ops/sub16.js +1 -1
  126. package/dist/ops/sum16.js +6 -6
  127. package/dist/ops/transpose16.js +3 -3
  128. package/dist/ops/unpack16.js +2 -2
  129. package/dist/ops/webgl/adamAdjust.js +2 -2
  130. package/dist/ops/webgl/adamMoments.js +1 -1
  131. package/dist/ops/webgl/appendCache.js +1 -1
  132. package/dist/ops/webgl/attentionMask.js +1 -1
  133. package/dist/ops/webgl/dropout16.js +1 -1
  134. package/dist/ops/webgl/fusedSoftmax.js +7 -7
  135. package/dist/ops/webgl/gatherSub.js +3 -3
  136. package/dist/ops/webgl/gelu.js +2 -2
  137. package/dist/ops/webgl/log.js +3 -3
  138. package/dist/ops/webgl/matMul16.js +13 -13
  139. package/dist/ops/webgl/matMulGelu.js +4 -4
  140. package/dist/ops/webgl/matMulMul.js +2 -2
  141. package/dist/ops/webgl/mulDropout.js +1 -1
  142. package/dist/ops/webgl/normRMS.js +2 -2
  143. package/dist/ops/webgl/qkv.js +1 -1
  144. package/dist/ops/webgl/rope.js +1 -1
  145. package/dist/ops/webgl/scatterSub.js +2 -2
  146. package/dist/ops/webgpu/adamAdjust.js +3 -3
  147. package/dist/ops/webgpu/adamMoments.js +3 -3
  148. package/dist/ops/webgpu/add16.js +6 -6
  149. package/dist/ops/webgpu/appendCache.js +3 -3
  150. package/dist/ops/webgpu/attentionMask.js +2 -2
  151. package/dist/ops/webgpu/attentionMask32_program.js +2 -2
  152. package/dist/ops/webgpu/clipScale.js +7 -7
  153. package/dist/ops/webgpu/concat16.js +5 -5
  154. package/dist/ops/webgpu/dropout16.js +6 -6
  155. package/dist/ops/webgpu/gatherSub.js +3 -3
  156. package/dist/ops/webgpu/gelu.js +8 -8
  157. package/dist/ops/webgpu/matMul16.js +16 -16
  158. package/dist/ops/webgpu/matMul16_program.js +2 -2
  159. package/dist/ops/webgpu/mul16.js +5 -5
  160. package/dist/ops/webgpu/norm2.js +1 -1
  161. package/dist/ops/webgpu/normRMS.js +2 -2
  162. package/dist/ops/webgpu/normRMSGrad.js +4 -4
  163. package/dist/ops/webgpu/pack16.js +4 -4
  164. package/dist/ops/webgpu/pack16_program.js +2 -2
  165. package/dist/ops/webgpu/qkv.js +2 -2
  166. package/dist/ops/webgpu/rope.js +3 -3
  167. package/dist/ops/webgpu/scatterSub.js +3 -3
  168. package/dist/ops/webgpu/slice16.js +4 -4
  169. package/dist/ops/webgpu/softmax16.js +4 -4
  170. package/dist/ops/webgpu/softmax16_program.js +2 -2
  171. package/dist/ops/webgpu/softmax16_subgroup_program.js +2 -2
  172. package/dist/ops/webgpu/softmax16grad.js +4 -4
  173. package/dist/ops/webgpu/sub16.js +6 -6
  174. package/dist/ops/webgpu/sum16.js +3 -3
  175. package/dist/ops/webgpu/transpose16.js +8 -8
  176. package/dist/ops/webgpu/transpose16_program.js +2 -2
  177. package/dist/ops/webgpu/transpose16_shared_program.js +3 -3
  178. package/dist/ops/webgpu/unpack16.js +3 -3
  179. package/dist/ops/webgpu/utils/binary_op.js +3 -3
  180. package/dist/ops/webgpu/utils/reductions.js +5 -5
  181. package/dist/{ops-CsXeTq1P.js → ops-CURIZSVt.js} +100 -100
  182. package/dist/{pack16-bqltoUlR.js → pack16-WlOSOuZA.js} +2 -2
  183. package/dist/patches/webgpu_backend.js +6 -6
  184. package/dist/patches/webgpu_base.js +1 -1
  185. package/dist/patches/webgpu_program.js +2 -2
  186. package/dist/{random_normal-IBRrha8a.js → random_normal-CIm8lk2-.js} +1 -1
  187. package/dist/{random_width-DN5ZtQkM.js → random_width-B_fVXhGx.js} +131 -131
  188. package/dist/{range-C-CjF-LI.js → range-BDxO73mk.js} +1 -1
  189. package/dist/{readers-iz5u3HBo.js → readers-17HLdxVM.js} +2 -2
  190. package/dist/relu-DTvZKBsZ.js +9 -0
  191. package/dist/{reshape-BDOuCSNW.js → reshape-BIN71H3p.js} +1 -1
  192. package/dist/{resize_nearest_neighbor-BojqlfRe.js → resize_nearest_neighbor-C6_0dAnK.js} +41 -41
  193. package/dist/{rope-0j_f1TPm.js → rope-CC5RjmKU.js} +4 -4
  194. package/dist/{scatter_nd_util-ByNJaL6I.js → scatter_nd_util-C-x73Cj6.js} +1 -1
  195. package/dist/{segment_util-Dasb2Zaf.js → segment_util-4zuHV5IG.js} +2 -2
  196. package/dist/{selu_util-BLhIqRkw.js → selu_util-BXdhy_W6.js} +5 -5
  197. package/dist/{shared-CagdqkLh.js → shared-DRWDyk9w.js} +6 -6
  198. package/dist/{shared-3agzAqQ_.js → shared-zTaJ5siv.js} +1 -1
  199. package/dist/slice-BvItlgXu.js +12 -0
  200. package/dist/{slice_util-CC35pLmT.js → slice_util-DPY56GzQ.js} +5 -5
  201. package/dist/{softmax-D4q1LJN7.js → softmax-BLGJqdwx.js} +1 -1
  202. package/dist/split-BN9LkEgS.js +9 -0
  203. package/dist/{squeeze-ho4wLUek.js → squeeze-O_YWJpw_.js} +2 -2
  204. package/dist/{stack-DudVrtmG.js → stack-z6QE7kmP.js} +1 -1
  205. package/dist/{step-BTxPtq1r.js → step-DQY6_ABw.js} +4 -4
  206. package/dist/{sum-BpiwSWvg.js → sum-D39FeU5h.js} +3 -3
  207. package/dist/{tensor-BWFldCso.js → tensor-D8e0Gd7c.js} +1 -1
  208. package/dist/{tensor1d-LMGMIUlr.js → tensor1d-BMl0eZYV.js} +1 -1
  209. package/dist/{tensor2d-BnXMKScO.js → tensor2d-DTtQ1QcT.js} +1 -1
  210. package/dist/{tensor4d-C6UCG_u8.js → tensor4d-Dj4rDssL.js} +1 -1
  211. package/dist/{tfjs_backend-BGnG-ppu.js → tfjs_backend-Bk3PmK91.js} +65 -65
  212. package/dist/{tile-CFy-xTO6.js → tile-CsWlVKKz.js} +1 -1
  213. package/dist/tokeniser/BaseTokeniser.d.ts +4 -1
  214. package/dist/tokeniser/BaseTokeniser.js +21 -5
  215. package/dist/tokeniser/CharTokeniser.d.ts +1 -1
  216. package/dist/tokeniser/CharTokeniser.js +62 -50
  217. package/dist/tokeniser/bpe.d.ts +1 -1
  218. package/dist/tokeniser/bpe.js +41 -35
  219. package/dist/tokeniser/type.d.ts +3 -1
  220. package/dist/training/AdamW.d.ts +3 -0
  221. package/dist/training/AdamW.js +59 -30
  222. package/dist/training/BasicTrainer.d.ts +1 -0
  223. package/dist/training/BasicTrainer.js +112 -92
  224. package/dist/training/DatasetBuilder.js +3 -3
  225. package/dist/training/Evaluator.js +2 -2
  226. package/dist/training/LRScheduler.d.ts +1 -0
  227. package/dist/training/LRScheduler.js +18 -12
  228. package/dist/training/PreTrainer.js +3 -3
  229. package/dist/training/SFTDatasetBuilder.js +3 -3
  230. package/dist/training/SFTTrainer.js +1 -1
  231. package/dist/training/orthoGrad.js +1 -1
  232. package/dist/training/sparseCrossEntropy.js +30 -30
  233. package/dist/training/types.d.ts +5 -3
  234. package/dist/training/validation.js +13 -13
  235. package/dist/{transpose-9kRxIXWR.js → transpose-Qxz-4os3.js} +7 -7
  236. package/dist/{unsorted_segment_sum-DJvk5xnh.js → unsorted_segment_sum-BfFVV9Zm.js} +20 -20
  237. package/dist/utilities/datasetID.d.ts +2 -0
  238. package/dist/utilities/datasetID.js +21 -0
  239. package/dist/utilities/dummy.js +6 -6
  240. package/dist/utilities/multinomialCPU.js +2 -2
  241. package/dist/utilities/packed.js +1 -1
  242. package/dist/utilities/performance.js +1 -1
  243. package/dist/utilities/profile.js +1 -1
  244. package/dist/utilities/safetensors.js +2 -2
  245. package/dist/utilities/sentences.js +5 -5
  246. package/dist/utilities/weights.js +2 -2
  247. package/dist/{variable-Ck482e3n.js → variable-SSATClyt.js} +1 -1
  248. package/dist/{webgpu_program-B4HmApL1.js → webgpu_program-CbjdYLYk.js} +1 -1
  249. package/dist/{webgpu_util-DYlGSwOJ.js → webgpu_util-DuofJBMo.js} +7 -7
  250. package/dist/{zeros-DvZpK8s6.js → zeros-Bw0puq_w.js} +2 -2
  251. package/dist/{zeros_like-CWjDdwr-.js → zeros_like-rOHr54NY.js} +69 -69
  252. package/package.json +3 -3
  253. package/dist/complex-DI35Q-gW.js +0 -11
  254. package/dist/mat_mul-DhG0Newp.js +0 -11
  255. package/dist/mod-CSdCpRjf.js +0 -11
  256. package/dist/relu-J_X6MUzx.js +0 -9
  257. package/dist/slice-BzS11Qh0.js +0 -12
  258. package/dist/split-C2Sj255c.js +0 -9
@@ -5,6 +5,7 @@ export default class LRScheduler {
5
5
  private step;
6
6
  private startLearningRate;
7
7
  constructor(learningRate: number, config: LRSchedulerConfig);
8
+ serializeConfig(): LRSchedulerConfig;
8
9
  updateConfig(newConfig: Partial<LRSchedulerConfig>, learningRate?: number): void;
9
10
  get lr(): number;
10
11
  getNextLR(): number;
@@ -1,28 +1,34 @@
1
- class h {
2
- constructor(t, i) {
3
- this.learningRate = t, this.config = i, this.startLearningRate = t;
1
+ class o {
2
+ constructor(i, t) {
3
+ this.learningRate = i, this.config = t, this.startLearningRate = i, t.step !== void 0 && (this.step = t.step);
4
4
  }
5
5
  step = 0;
6
6
  startLearningRate;
7
- updateConfig(t, i) {
8
- this.config = { ...this.config, ...t }, i !== void 0 && (this.startLearningRate = i);
7
+ serializeConfig() {
8
+ return {
9
+ ...this.config,
10
+ step: this.step
11
+ };
12
+ }
13
+ updateConfig(i, t) {
14
+ this.config = { ...this.config, ...i }, t !== void 0 && (this.startLearningRate = t);
9
15
  }
10
16
  get lr() {
11
17
  return this.learningRate;
12
18
  }
13
19
  getNextLR() {
14
- const t = this.step;
15
- if (this.config.warmupSteps > 0 && t < this.config.warmupSteps) {
16
- const r = (t + 1) / this.config.warmupSteps, e = this.startLearningRate * r;
20
+ const i = this.step;
21
+ if (this.config.warmupSteps > 0 && i < this.config.warmupSteps) {
22
+ const r = (i + 1) / this.config.warmupSteps, e = this.startLearningRate * r;
17
23
  return this.learningRate = e, this.step++, e;
18
24
  }
19
- const i = this.config.epochSteps * this.config.decayEpochs;
20
- if (t >= i || i <= this.config.warmupSteps)
25
+ const t = this.config.epochSteps * this.config.decayEpochs;
26
+ if (i >= t || t <= this.config.warmupSteps)
21
27
  return this.learningRate = this.config.minLearningRate, this.step++, this.config.minLearningRate;
22
- const n = (t - this.config.warmupSteps) / (i - this.config.warmupSteps), a = 0.5 * (1 + Math.cos(Math.PI * n)), s = this.config.minLearningRate + a * (this.startLearningRate - this.config.minLearningRate);
28
+ const n = (i - this.config.warmupSteps) / (t - this.config.warmupSteps), a = 0.5 * (1 + Math.cos(Math.PI * n)), s = this.config.minLearningRate + a * (this.startLearningRate - this.config.minLearningRate);
23
29
  return this.learningRate = s, this.step++, s;
24
30
  }
25
31
  }
26
32
  export {
27
- h as default
33
+ o as default
28
34
  };
@@ -1,6 +1,6 @@
1
1
  import r from "./BasicTrainer.js";
2
- import { DatasetBuilder as s } from "./DatasetBuilder.js";
3
- const n = {
2
+ import { DatasetBuilder as n } from "./DatasetBuilder.js";
3
+ const s = {
4
4
  decayEpochs: 100,
5
5
  epochSteps: 1e4,
6
6
  warmupSteps: 1e3,
@@ -11,7 +11,7 @@ const n = {
11
11
  };
12
12
  class m extends r {
13
13
  constructor(i, e, t, a) {
14
- super(i, e, { ...n, ...t }, a), this.tokenizer = e, this.optimizerConfig.minLearningRate = this.optimizerConfig.learningRate / 10, this.updateOptimizer(), this.datasetBuilder = new s(e, i.config.blockSize);
14
+ super(i, e, { ...s, ...t }, a), this.tokenizer = e, this.optimizerConfig.minLearningRate = t?.minLearningRate ?? this.optimizerConfig.learningRate / 20, this.updateOptimizer(), this.datasetBuilder = new n(e, i.config.blockSize);
15
15
  }
16
16
  datasetBuilder;
17
17
  }
@@ -1,6 +1,6 @@
1
- import { t as y } from "../index-CUXkjxiT.js";
2
- import "../dataset-CGGp1z9P.js";
3
- import { g as I } from "../readers-iz5u3HBo.js";
1
+ import { t as y } from "../index-DSGwv2Yx.js";
2
+ import "../dataset-DlqAN81i.js";
3
+ import { g as I } from "../readers-17HLdxVM.js";
4
4
  import "../index-Cp39cXWe.js";
5
5
  function w(p, o, t, l) {
6
6
  const s = [t.bosToken], a = [!1], u = {
@@ -12,7 +12,7 @@ const n = {
12
12
  };
13
13
  class m extends r {
14
14
  constructor(t, e, i, a) {
15
- super(t, e, { ...n, ...i }, a), this.tokenizer = e, this.optimizerConfig.minLearningRate = this.optimizerConfig.learningRate / 10, this.updateOptimizer(), this.datasetBuilder = new s(e, t.config.blockSize), this.maskedLoss = !0;
15
+ super(t, e, { ...n, ...i }, a), this.tokenizer = e, this.optimizerConfig.minLearningRate = i?.minLearningRate ?? this.optimizerConfig.learningRate / 20, this.updateOptimizer(), this.datasetBuilder = new s(e, t.config.blockSize), this.maskedLoss = !0;
16
16
  }
17
17
  datasetBuilder;
18
18
  }
@@ -1,4 +1,4 @@
1
- import { t as d } from "../index-CUXkjxiT.js";
1
+ import { t as d } from "../index-DSGwv2Yx.js";
2
2
  function l(m, t, s) {
3
3
  return d(() => {
4
4
  const r = m.reshape([-1]), o = t.reshape([-1]), e = r.mul(r).sum().add(s), c = r.mul(o).sum().div(e), n = o.sub(r.mul(c)), a = o.norm(), u = n.norm().add(s);
@@ -1,24 +1,24 @@
1
- import { gatherSub as $ } from "../ops/gatherSub.js";
1
+ import { gatherSub as j } from "../ops/gatherSub.js";
2
2
  import { scatterSub as T } from "../ops/scatterSub.js";
3
- import { t as F, a1 as G, j as A, m as x, i as U, a2 as D, a as j, a3 as q } from "../index-CUXkjxiT.js";
4
- import { m as J, l as K, a as E, n as N, w as O } from "../not_equal-hurPF26l.js";
5
- import { s as m } from "../sum-BpiwSWvg.js";
6
- import { s as Q } from "../softmax-D4q1LJN7.js";
7
- function R(e, l, a, g, v, t = 0) {
8
- return F(() => {
9
- const S = e.shape[e.shape.length - 1], i = v || e.shape.slice(0, -1), f = i.reduce((n, p) => n * p, 1), h = e.shape.length > 2 ? e.reshape([f, S]) : e, y = l.shape.length > 1 ? l.reshape([f]).cast("int32") : l.cast("int32"), u = J(h, -1, !0), o = G(h, u), r = K(o, -1), d = $(r, y, o);
3
+ import { t as H, a1 as G, h as A, m as x, d as U, a2 as D, b as q, a3 as F } from "../index-DSGwv2Yx.js";
4
+ import { m as J, l as K, a as E, n as N, w as O } from "../not_equal-CkQKkKZy.js";
5
+ import { s as m } from "../sum-D39FeU5h.js";
6
+ import { s as Q } from "../softmax-BLGJqdwx.js";
7
+ function R(e, h, t, g, v, a = 0) {
8
+ return H(() => {
9
+ const S = e.shape[e.shape.length - 1], i = v || e.shape.slice(0, -1), l = i.reduce((n, p) => n * p, 1), f = e.shape.length > 2 ? e.reshape([l, S]) : e, b = h.shape.length > 1 ? h.reshape([l]).cast("int32") : h.cast("int32"), u = J(f, -1, !0), o = G(f, u), r = K(o, -1), d = j(r, b, o);
10
10
  let s;
11
- if (t > 0) {
11
+ if (a > 0) {
12
12
  const n = G(r, E(o, -1));
13
- s = A(x(d, 1 - t), x(n, t));
13
+ s = A(x(d, 1 - a), x(n, a));
14
14
  } else
15
15
  s = d;
16
- if (a)
17
- if (s = x(s, a), g) {
18
- const n = m(a.reshape(i), -1);
16
+ if (t)
17
+ if (s = x(s, t), g) {
18
+ const n = m(t.reshape(i), -1);
19
19
  s = U(m(s.reshape(i), -1), n);
20
20
  } else {
21
- const n = m(a);
21
+ const n = m(t);
22
22
  s = U(m(s), n);
23
23
  }
24
24
  else
@@ -26,44 +26,44 @@ function R(e, l, a, g, v, t = 0) {
26
26
  return s;
27
27
  });
28
28
  }
29
- function as(e, l, a = 0) {
29
+ function ts(e, h, t = 0) {
30
30
  return D(
31
31
  // @ts-expect-error Invalid params
32
- (t, S, i) => {
33
- const f = t.shape[t.shape.length - 1], h = t.shape.slice(0, -1), y = h.reduce((p, c) => p * c, 1), u = t.reshape([y, f]), o = S.reshape([y]).cast("int32");
32
+ (a, S, i) => {
33
+ const l = a.shape[a.shape.length - 1], f = a.shape.slice(0, -1), b = f.reduce((p, c) => p * c, 1), u = a.reshape([b, l]), o = S.reshape([b]).cast("int32");
34
34
  let r, d = null;
35
35
  if (e) {
36
- const p = j(-100, "int32"), c = N(o, p);
37
- d = c.cast("float32"), r = O(c, o, q(o));
36
+ const p = q(-100, "int32"), c = N(o, p);
37
+ d = c.cast("float32"), r = O(c, o, F(o));
38
38
  } else
39
39
  r = o;
40
40
  const s = R(
41
41
  u,
42
42
  r,
43
43
  d || void 0,
44
- l,
45
44
  h,
46
- a
45
+ f,
46
+ t
47
47
  );
48
- return i(d ? [u, r, d] : [u, r]), u.dispose(), o.dispose(), { value: s, gradFunc: (p, c) => F(() => {
49
- const C = c[0], z = c[1], b = e ? c[2] : void 0, w = Q(C), H = b ? m(b) : j(C.shape[0], "float32"), I = p.div(H).broadcastTo([C.shape[0]]), M = b && e ? x(I, b) : I;
48
+ return i(d ? [u, r, d] : [u, r]), u.dispose(), o.dispose(), { value: s, gradFunc: (p, c) => H(() => {
49
+ const C = c[0], z = c[1], y = e ? c[2] : void 0, w = Q(C), P = y ? m(y) : q(C.shape[0], "float32"), I = p.div(P).broadcastTo([C.shape[0]]), M = y && e ? x(I, y) : I;
50
50
  let L;
51
- if (a > 0) {
52
- const V = a / f, W = G(w, V);
51
+ if (t > 0) {
52
+ const W = t / l, $ = G(w, W);
53
53
  L = T(
54
- W,
54
+ $,
55
55
  z,
56
- x(M, 1 - a)
56
+ x(M, 1 - t)
57
57
  );
58
58
  } else
59
59
  L = T(w, z, M);
60
- const P = q(S);
61
- return [L.reshape(t.shape), P];
60
+ const V = F(S);
61
+ return [L.reshape(a.shape), V];
62
62
  }) };
63
63
  }
64
64
  );
65
65
  }
66
66
  export {
67
- as as createSoftmaxCrossEntropyWithGrad,
67
+ ts as createSoftmaxCrossEntropyWithGrad,
68
68
  R as sparseSoftmaxCrossEntropy
69
69
  };
@@ -19,21 +19,23 @@ export interface TrainingLogEntry {
19
19
  weightNorm?: number;
20
20
  weightStatistics?: Map<string, TensorStatistics>;
21
21
  memoryUsage?: number;
22
- tokensPerSecond?: number;
22
+ tokensPerSecond: number;
23
23
  duration: number;
24
- totalSamples: number;
25
- samplesPerSecond: number;
24
+ totalTokens: number;
26
25
  }
27
26
  export interface LRSchedulerConfig {
28
27
  warmupSteps: number;
29
28
  decayEpochs: number;
30
29
  minLearningRate: number;
31
30
  epochSteps: number;
31
+ step?: number;
32
32
  }
33
33
  export interface AdamWOptimizerConfig extends LRSchedulerConfig {
34
34
  learningRate: number;
35
35
  beta1: number;
36
36
  beta2: number;
37
+ accBeta1?: number;
38
+ accBeta2?: number;
37
39
  epsilon?: number;
38
40
  weightDecay: number;
39
41
  lossScaling: number;
@@ -1,22 +1,22 @@
1
- import "../index-CUXkjxiT.js";
2
- import "../random_width-DN5ZtQkM.js";
3
- import "../zeros_like-CWjDdwr-.js";
1
+ import "../index-DSGwv2Yx.js";
2
+ import "../random_width-B_fVXhGx.js";
3
+ import "../zeros_like-rOHr54NY.js";
4
4
  import "../Generator.js";
5
5
  import "../index-Cp39cXWe.js";
6
- import "../dataset-CGGp1z9P.js";
6
+ import "../dataset-DlqAN81i.js";
7
7
  import "../ops/cpu/attentionMask.js";
8
8
  import "../ops/webgl/attentionMask.js";
9
9
  import "../ops/grads/attentionMask.js";
10
10
  import "../ops/cpu/rope.js";
11
11
  import "../ops/webgl/rope.js";
12
- import "../rope-0j_f1TPm.js";
12
+ import "../rope-CC5RjmKU.js";
13
13
  import "../ops/cpu/appendCache.js";
14
14
  import "../ops/webgl/appendCache.js";
15
15
  import "../ops/grads/softmax16.js";
16
- import "../matMul16-BcVC_E62.js";
16
+ import "../matMul16-BIT70Vya.js";
17
17
  import "../ops/webgl/matMul16.js";
18
18
  import "../ops/cpu/matMul16.js";
19
- import "../pack16-bqltoUlR.js";
19
+ import "../pack16-WlOSOuZA.js";
20
20
  import "../ops/transpose16.js";
21
21
  import "../ops/reshape16.js";
22
22
  import "../ops/cpu/qkv.js";
@@ -30,23 +30,23 @@ import "../ops/webgl/dropout16.js";
30
30
  import "../ops/grads/add16.js";
31
31
  import "../jszip.min-BZhlzntC.js";
32
32
  import "../index-DvYrXKkX.js";
33
- import "../ops/cpu/gatherSub.js";
34
- import "../ops/webgl/gatherSub.js";
35
- import "../ops/cpu/scatterSub.js";
36
- import "../ops/webgl/scatterSub.js";
37
33
  import "../ops/cpu/adamAdjust.js";
38
34
  import "../ops/webgl/adamAdjust.js";
39
35
  import "../ops/cpu/adamMoments.js";
40
36
  import "../ops/webgl/adamMoments.js";
37
+ import "../ops/cpu/gatherSub.js";
38
+ import "../ops/webgl/gatherSub.js";
39
+ import "../ops/cpu/scatterSub.js";
40
+ import "../ops/webgl/scatterSub.js";
41
41
  import { PAGE_FACTOR as m, shuffle as h } from "./DatasetBuilder.js";
42
42
  import { tokensFromTasks as k } from "./tasks/Task.js";
43
43
  import "../papaparse.min-C0cScC2i.js";
44
44
  import "../ops/cpu/matMulGelu.js";
45
- import "../matMulGelu-JNLZqKQp.js";
45
+ import "../matMulGelu-CsZnh18H.js";
46
46
  import "../ops/grads/matMulGelu.js";
47
47
  import "../ops/cpu/gelu.js";
48
48
  import "../ops/webgl/gelu.js";
49
- import "../gelu-B220X1Go.js";
49
+ import "../gelu-DpTCC3eB.js";
50
50
  import "../ops/webgl/log.js";
51
51
  import "../checks/normRMS.js";
52
52
  import "../checks/normRMSGrad.js";
@@ -1,5 +1,5 @@
1
- import { o as u, q as i, E as o, ao as $, ap as g, aq as x, x as l, t as m, ar as p } from "./index-CUXkjxiT.js";
2
- import { c as k } from "./complex-DI35Q-gW.js";
1
+ import { o as u, n as i, E as o, ao as $, ap as g, aq as m, v as l, t as x, ar as p } from "./index-DSGwv2Yx.js";
2
+ import { c as k } from "./complex-3DpPEG9B.js";
3
3
  function K(r) {
4
4
  const e = { input: i(r, "input", "imag") };
5
5
  return o.runKernel($, e);
@@ -12,25 +12,25 @@ function E(r) {
12
12
  const _ = /* @__PURE__ */ u({ neg_: E });
13
13
  function b(r) {
14
14
  const e = { input: i(r, "input", "real") };
15
- return o.runKernel(x, e);
15
+ return o.runKernel(m, e);
16
16
  }
17
17
  const d = /* @__PURE__ */ u({ real_: b });
18
- function N(r, t, e) {
18
+ function v(r, t, e) {
19
19
  const n = i(r, "x", "transpose");
20
20
  if (t == null && (t = n.shape.map((s, a) => a).reverse()), l(n.rank === t.length, () => `Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`), t.forEach((s) => {
21
21
  l(s >= 0 && s < n.rank, () => `All entries in 'perm' must be between 0 and ${n.rank - 1} but got ${t}`);
22
22
  }), n.rank <= 1)
23
23
  return n.clone();
24
24
  const f = { x: n }, c = { perm: t };
25
- return n.dtype === "complex64" ? m(() => {
25
+ return n.dtype === "complex64" ? x(() => {
26
26
  let s = d(n), a = h(n);
27
27
  return s = o.runKernel(p, { x: s }, c), a = o.runKernel(p, { x: a }, c), e && (a = _(a)), k(s, a);
28
28
  }) : o.runKernel(p, f, c);
29
29
  }
30
- const v = /* @__PURE__ */ u({ transpose_: N });
30
+ const y = /* @__PURE__ */ u({ transpose_: v });
31
31
  export {
32
32
  h as i,
33
33
  _ as n,
34
34
  d as r,
35
- v as t
35
+ y as t
36
36
  };
@@ -1,8 +1,8 @@
1
- import { o as h, q as c, E as d, bm as T, bn as q, bo as H, x as l, bp as P, L as _, bq as y, br as B, bs as I, bt as W, bu as A, bv as L, bw as G, bx as O, by as z, bz as F, B as M, _ as j, bA as J, bB as U, bC as V, a2 as Q, a1 as N, m as X, bD as Y, bE as Z, bF as R, bG as nn, bH as tn, bI as sn, bJ as en, bK as rn, bL as on, bM as an, bN as un, aE as cn, bO as ln } from "./index-CUXkjxiT.js";
2
- import { k as C, c as g, m as D } from "./step-BTxPtq1r.js";
3
- import { r as b } from "./reshape-BDOuCSNW.js";
4
- import { m as pn, b as hn, e as w } from "./not_equal-hurPF26l.js";
5
- import { s as K } from "./sum-BpiwSWvg.js";
1
+ import { o as h, n as c, E as d, bm as T, bn as q, bo as H, v as l, bp as P, J as _, bq as y, br as I, bs as W, bt as B, bu as A, bv as G, bw as L, bx as O, by as z, bz as F, z as M, _ as j, bA as J, bB as U, bC as V, a2 as Q, a1 as N, m as X, bD as Y, bE as Z, bF as R, bG as nn, bH as tn, bI as sn, bJ as en, bK as rn, bL as on, bM as an, bN as un, aE as cn, bO as ln } from "./index-DSGwv2Yx.js";
2
+ import { k as C, c as g, m as D } from "./step-DQY6_ABw.js";
3
+ import { r as b } from "./reshape-BIN71H3p.js";
4
+ import { m as pn, b as hn, e as w } from "./not_equal-CkQKkKZy.js";
5
+ import { s as K } from "./sum-D39FeU5h.js";
6
6
  function fn(s, n = null, t = !1) {
7
7
  const i = { x: c(s, "x", "all", "bool") }, o = { axis: n, keepDims: t };
8
8
  return d.runKernel(T, i, o);
@@ -37,7 +37,7 @@ function xn(s, n, t) {
37
37
  const e = c(s, "x", "batchToSpaceND"), i = n.reduce((r, a) => r * a);
38
38
  l(e.rank >= 1 + n.length, () => `input rank is ${e.rank} but should be > than blockShape.length ${n.length}`), l(t.length === n.length, () => `crops.length is ${t.length} but should be equal to blockShape.length ${n.length}`), l(e.shape[0] % i === 0, () => `input tensor batch is ${e.shape[0]} but is not divisible by the product of the elements of blockShape ${n.join(" * ")} === ${i}`);
39
39
  const o = { x: e }, p = { blockShape: n, crops: t };
40
- return d.runKernel(B, o, p);
40
+ return d.runKernel(I, o, p);
41
41
  }
42
42
  const ot = /* @__PURE__ */ h({ batchToSpaceND_: xn });
43
43
  function kn(s) {
@@ -57,7 +57,7 @@ function vn(s, n, t, e, i, o) {
57
57
  offset: m,
58
58
  mean: r,
59
59
  variance: a
60
- }, k = { varianceEpsilon: o }, $ = d.runKernel(I, x, k);
60
+ }, k = { varianceEpsilon: o }, $ = d.runKernel(W, x, k);
61
61
  return b($, p.shape);
62
62
  }
63
63
  const at = /* @__PURE__ */ h({ batchNorm_: vn });
@@ -67,7 +67,7 @@ function gn(s, n, t, e, i = "NHWC", o = [1, 1], p) {
67
67
  r.rank === 3 && (m = !0, u = b(r, [1, r.shape[0], r.shape[1], r.shape[2]])), l(u.rank === 4, () => `Error in conv2d: input must be rank 4, but got rank ${u.rank}.`), l(a.rank === 4, () => `Error in conv2d: filter must be rank 4, but got rank ${a.rank}.`), g("conv2d", e, p);
68
68
  const f = i === "NHWC" ? u.shape[3] : u.shape[1];
69
69
  l(f === a.shape[2], () => `Error in conv2d: depth of input (${f}) must match input depth for filter ${a.shape[2]}.`), l(C(t, o), () => `Error in conv2D: Either strides or dilations must be 1. Got strides ${t} and dilations '${o}'`), l(D(o), () => "Error in conv2D: Dilated rates should be larger than 0."), l(D(t), () => "Error in conv2D: Strides should be larger than 0.");
70
- const x = { x: u, filter: a }, k = { strides: t, pad: e, dataFormat: i, dilations: o, dimRoundingMode: p }, $ = d.runKernel(W, x, k);
70
+ const x = { x: u, filter: a }, k = { strides: t, pad: e, dataFormat: i, dilations: o, dimRoundingMode: p }, $ = d.runKernel(B, x, k);
71
71
  return m ? b($, [$.shape[1], $.shape[2], $.shape[3]]) : $;
72
72
  }
73
73
  const S = /* @__PURE__ */ h({ conv2d_: gn });
@@ -96,12 +96,12 @@ function Nn(s, n, t, e, i, o) {
96
96
  const ut = /* @__PURE__ */ h({ conv2dTranspose_: Nn });
97
97
  function _n(s) {
98
98
  const t = { x: c(s, "x", "cos", "float32") };
99
- return d.runKernel(L, t);
99
+ return d.runKernel(G, t);
100
100
  }
101
101
  const ct = /* @__PURE__ */ h({ cos_: _n });
102
102
  function wn(s) {
103
103
  const t = { x: c(s, "x", "cosh", "float32") };
104
- return d.runKernel(G, t);
104
+ return d.runKernel(L, t);
105
105
  }
106
106
  const lt = /* @__PURE__ */ h({ cosh_: wn });
107
107
  function Kn(s, n = 0, t = !1, e = !1) {
@@ -143,7 +143,7 @@ function yn(s) {
143
143
  return d.runKernel(V, t);
144
144
  }
145
145
  const mt = /* @__PURE__ */ h({ softplus_: yn });
146
- function Bn(s, n = -1) {
146
+ function In(s, n = -1) {
147
147
  const t = c(s, "logits", "logSoftmax");
148
148
  if (n === -1 && (n = t.rank - 1), n !== t.rank - 1)
149
149
  throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${t.rank} and axis was ${n}`);
@@ -155,20 +155,20 @@ function Bn(s, n = -1) {
155
155
  } };
156
156
  })(t);
157
157
  }
158
- const $t = /* @__PURE__ */ h({ logSoftmax_: Bn });
159
- function In(s) {
158
+ const $t = /* @__PURE__ */ h({ logSoftmax_: In });
159
+ function Wn(s) {
160
160
  const t = { x: c(s, "x", "logicalNot", "bool") };
161
161
  return d.runKernel(Y, t);
162
162
  }
163
- const bt = /* @__PURE__ */ h({ logicalNot_: In });
164
- function Wn(s, n, t, e, i) {
163
+ const bt = /* @__PURE__ */ h({ logicalNot_: Wn });
164
+ function Bn(s, n, t, e, i) {
165
165
  const o = c(s, "x", "maxPool"), p = 1;
166
166
  let r = o, a = !1;
167
167
  o.rank === 3 && (a = !0, r = b(o, [1, o.shape[0], o.shape[1], o.shape[2]])), l(r.rank === 4, () => `Error in maxPool: input must be rank 4 but got rank ${r.rank}.`), l(C(t, p), () => `Error in maxPool: Either strides or dilations must be 1. Got strides ${t} and dilations '${p}'`), g("maxPool", e, i);
168
168
  const u = { x: r }, m = { filterSize: n, strides: t, pad: e, dimRoundingMode: i }, f = d.runKernel(Z, u, m);
169
169
  return a ? b(f, [f.shape[1], f.shape[2], f.shape[3]]) : f;
170
170
  }
171
- const xt = /* @__PURE__ */ h({ maxPool_: Wn });
171
+ const xt = /* @__PURE__ */ h({ maxPool_: Bn });
172
172
  function An(s, n, t = 1, e = 0, i = "int32") {
173
173
  if (n < 2)
174
174
  throw new Error(`Error in oneHot: depth must be >=2, but it is ${n}`);
@@ -176,19 +176,19 @@ function An(s, n, t = 1, e = 0, i = "int32") {
176
176
  return d.runKernel(R, p, r);
177
177
  }
178
178
  const kt = /* @__PURE__ */ h({ oneHot_: An });
179
- function Ln(s) {
179
+ function Gn(s) {
180
180
  const t = { x: c(s, "x", "onesLike") };
181
181
  return d.runKernel(nn, t);
182
182
  }
183
- const vt = /* @__PURE__ */ h({ onesLike_: Ln });
184
- function Gn(s, n, t = 0) {
183
+ const vt = /* @__PURE__ */ h({ onesLike_: Gn });
184
+ function Ln(s, n, t = 0) {
185
185
  const e = c(s, "x", "pad");
186
186
  if (e.rank === 0)
187
187
  throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");
188
188
  const i = { paddings: n, constantValue: t }, o = { x: e };
189
189
  return d.runKernel(tn, o, i);
190
190
  }
191
- const gt = /* @__PURE__ */ h({ pad_: Gn });
191
+ const gt = /* @__PURE__ */ h({ pad_: Ln });
192
192
  function On(s, n, t) {
193
193
  const e = c(s, "x", "spaceToBatchND");
194
194
  l(e.rank >= 1 + n.length, () => `input rank ${e.rank} should be > than [blockShape] ${n.length}`), l(t.length === n.length, () => `paddings.shape[0] ${t.length} must be equal to [blockShape] ${n.length}`), l(e.shape.reduce((p, r, a) => a > 0 && a <= n.length ? p && (r + t[a - 1][0] + t[a - 1][1]) % n[a - 1] === 0 : p, !0), () => `input spatial dimensions ${e.shape.slice(1)} with paddings ${t.toString()} must be divisible by blockShapes ${n.toString()}`);
@@ -0,0 +1,2 @@
1
+ import { DatasetMetadata } from '../loader/types';
2
+ export default function generateDatasetID(datasets: DatasetMetadata[]): string;
@@ -0,0 +1,21 @@
1
+ function h(s) {
2
+ const c = s.map((n) => String(n.id)).sort();
3
+ let e = 2166136261, o = 2654435769;
4
+ const t = (n) => {
5
+ e ^= n & 255, e = Math.imul(e, 16777619), o ^= n & 255, o = Math.imul(o, 2246822507);
6
+ }, g = (n) => {
7
+ const r = n.length >>> 0;
8
+ t(r & 255), t(r >>> 8 & 255), t(r >>> 16 & 255), t(r >>> 24 & 255);
9
+ for (let a = 0; a < n.length; a++) {
10
+ const l = n.charCodeAt(a);
11
+ t(l & 255), t(l >>> 8 & 255);
12
+ }
13
+ }, i = c.length >>> 0;
14
+ t(i & 255), t(i >>> 8 & 255), t(i >>> 16 & 255), t(i >>> 24 & 255);
15
+ for (const n of c)
16
+ g(n);
17
+ return "dataset__" + (e >>> 0).toString(36) + "_" + (o >>> 0).toString(36);
18
+ }
19
+ export {
20
+ h as default
21
+ };
@@ -1,10 +1,10 @@
1
- import { b as y, h as I, v as P } from "../index-CUXkjxiT.js";
2
- import { z as c } from "../zeros-DvZpK8s6.js";
1
+ import { Y as y, e as I, Z as P } from "../index-DSGwv2Yx.js";
2
+ import { z as c } from "../zeros-Bw0puq_w.js";
3
3
  async function w(s) {
4
4
  const t = c([1, s.config.blockSize], "int32"), n = s.forward({ training: !1 }, t);
5
5
  await n.data(), n.dispose(), t.dispose();
6
6
  }
7
- async function b(s) {
7
+ async function G(s) {
8
8
  const t = y(), n = t.numBytesInGPUAllocated ?? t.numBytesAllocatedInGPU ?? t.numBytes;
9
9
  await w(s);
10
10
  const a = c([1, s.config.blockSize], "int32"), e = {
@@ -32,12 +32,12 @@ async function b(s) {
32
32
  }
33
33
  return e;
34
34
  }
35
- function v(s) {
35
+ function b(s) {
36
36
  const t = c([1, s.config.blockSize], "int32");
37
37
  s.forward({ training: !1 }, t).dispose(), t.dispose();
38
38
  }
39
39
  export {
40
- v as dummyPass,
40
+ b as dummyPass,
41
41
  w as dummyPassAsync,
42
- b as dummyPassTrainAsync
42
+ G as dummyPassTrainAsync
43
43
  };
@@ -1,5 +1,5 @@
1
- import "../index-CUXkjxiT.js";
2
- import { t as e } from "../tensor2d-BnXMKScO.js";
1
+ import "../index-DSGwv2Yx.js";
2
+ import { t as e } from "../tensor2d-DTtQ1QcT.js";
3
3
  function f(n, i) {
4
4
  let r = 0;
5
5
  const o = i ?? Math.random();
@@ -1,4 +1,4 @@
1
- import { h as n } from "../index-CUXkjxiT.js";
1
+ import { e as n } from "../index-DSGwv2Yx.js";
2
2
  function o() {
3
3
  return n().backendName === "webgpu";
4
4
  }
@@ -1,4 +1,4 @@
1
- import { t as s } from "../index-CUXkjxiT.js";
1
+ import { t as s } from "../index-DSGwv2Yx.js";
2
2
  async function f(e, o = 10, r = !1) {
3
3
  for (let t = 0; t < 100; t++) {
4
4
  const a = r ? await e() : s(e);
@@ -1,4 +1,4 @@
1
- import { b as a } from "../index-CUXkjxiT.js";
1
+ import { Y as a } from "../index-DSGwv2Yx.js";
2
2
  const s = 1024 * 1024;
3
3
  class l {
4
4
  log = /* @__PURE__ */ new Map();
@@ -1,5 +1,5 @@
1
- import "../index-CUXkjxiT.js";
2
- import { t as y } from "../tensor-BWFldCso.js";
1
+ import "../index-DSGwv2Yx.js";
2
+ import { t as y } from "../tensor-D8e0Gd7c.js";
3
3
  function l(t) {
4
4
  if (t === "float32") return "F32";
5
5
  if (t === "int32") return "I32";
@@ -1,8 +1,8 @@
1
- import { m as w } from "../index-CUXkjxiT.js";
2
- import { t as f } from "../tensor2d-BnXMKScO.js";
3
- import { e as y } from "../expand_dims-Bkd1YD5x.js";
4
- import { s as g } from "../sum-BpiwSWvg.js";
5
- import { c as T } from "../concat-CAQpCret.js";
1
+ import { m as w } from "../index-DSGwv2Yx.js";
2
+ import { t as f } from "../tensor2d-DTtQ1QcT.js";
3
+ import { e as y } from "../expand_dims-D0rBtgT1.js";
4
+ import { s as g } from "../sum-D39FeU5h.js";
5
+ import { c as T } from "../concat-Dqk7Xk7h.js";
6
6
  const p = 16;
7
7
  function A(o, t) {
8
8
  if (!t)
@@ -1,5 +1,5 @@
1
- import "../index-CUXkjxiT.js";
2
- import { t as p } from "../tensor-BWFldCso.js";
1
+ import "../index-DSGwv2Yx.js";
2
+ import { t as p } from "../tensor-D8e0Gd7c.js";
3
3
  function h(n) {
4
4
  const e = n.reduce((s, o) => s + o.length, 0), a = new Float32Array(e);
5
5
  let t = 0;
@@ -1,4 +1,4 @@
1
- import { E as i } from "./index-CUXkjxiT.js";
1
+ import { E as i } from "./index-DSGwv2Yx.js";
2
2
  function m(r, a = !0, e, t) {
3
3
  return i.makeVariable(r, a, e, t);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { ad as z, ac as F, ab as E, a9 as j, x as A } from "./index-CUXkjxiT.js";
1
+ import { ad as z, ac as F, ab as E, a9 as j, v as A } from "./index-DSGwv2Yx.js";
2
2
  function L(t, s) {
3
3
  if (Math.max(...t) > 5)
4
4
  throw new Error("Cannot symbolically compute strides for rank > 6 tensor.");
@@ -1,4 +1,4 @@
1
- import { x as u } from "./index-CUXkjxiT.js";
1
+ import { v as u } from "./index-DSGwv2Yx.js";
2
2
  const c = (r) => {
3
3
  let t = 1;
4
4
  for (let n = 0; n < r.length; n++)
@@ -23,16 +23,16 @@ function p(r, t, n = !1) {
23
23
  const a = c(r.x.map((i) => t[i])), o = c(r.y.map((i) => t[i]));
24
24
  return a <= 4 ? [4, 16, 1] : o <= 4 ? [16, 4, 1] : [16, 16, 1];
25
25
  }
26
- function x(r, t, n = !1) {
26
+ function M(r, t, n = !1) {
27
27
  if (n)
28
28
  return [4, 4, 1];
29
29
  const a = c(r.x.map((i) => t[i])), o = c(r.y.map((i) => t[i]));
30
30
  return a <= 4 ? [1, 2, 1] : o <= 4 ? [2, 1, 1] : [2, 2, 1];
31
31
  }
32
- function M(r) {
32
+ function h(r) {
33
33
  return { x: r.map((t, n) => n) };
34
34
  }
35
- function h(r) {
35
+ function x(r) {
36
36
  if (r === "float32" || r === "int32" || r === "bool" || r === "string" || r === "packedF16")
37
37
  return 4;
38
38
  if (r === "complex64")
@@ -52,13 +52,13 @@ var s;
52
52
  r[r.MatMulReduceProgram = 0] = "MatMulReduceProgram", r[r.MatMulSplitKProgram = 1] = "MatMulSplitKProgram", r[r.MatMulSmallOutputSizeProgram = 2] = "MatMulSmallOutputSizeProgram", r[r.MatMulPackedProgram = 3] = "MatMulPackedProgram", r[r.MatMulMax = 4] = "MatMulMax";
53
53
  })(s || (s = {}));
54
54
  export {
55
- h as G,
55
+ x as G,
56
56
  s as M,
57
57
  d as a,
58
58
  b,
59
59
  m as c,
60
60
  p as d,
61
- x as e,
62
- M as f,
61
+ M as e,
62
+ h as f,
63
63
  g as i
64
64
  };
@@ -1,5 +1,5 @@
1
- import { u as n, Q as m, U as i, E as c } from "./index-CUXkjxiT.js";
2
- import { c as f } from "./complex-DI35Q-gW.js";
1
+ import { q as n, L as m, N as i, E as c } from "./index-DSGwv2Yx.js";
2
+ import { c as f } from "./complex-3DpPEG9B.js";
3
3
  function e(o, r = "float32") {
4
4
  if (n(o), r === "complex64") {
5
5
  const s = e(o, "float32"), t = e(o, "float32");