@genai-fi/nanogpt 0.5.3 → 0.5.5

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 (103) hide show
  1. package/dist/Generator.js +5 -5
  2. package/dist/NanoGPTModel.d.ts +2 -0
  3. package/dist/NanoGPTModel.js +8 -8
  4. package/dist/{Reshape-Bt_t7RNz.js → Reshape-Biok_3X1.js} +6 -6
  5. package/dist/TeachableLLM.d.ts +6 -0
  6. package/dist/TeachableLLM.js +6 -2
  7. package/dist/{TiedEmbedding-DORsPlNL.js → TiedEmbedding-8S8xn8e6.js} +5 -5
  8. package/dist/Trainer.d.ts +1 -0
  9. package/dist/Trainer.js +8 -7
  10. package/dist/{axis_util-CVbf1vmL.js → axis_util-BczFISHz.js} +1 -1
  11. package/dist/{broadcast_to-BBoMQXbL.js → broadcast_to-B7NGsBSh.js} +2 -2
  12. package/dist/{concat-BRRtq4S2.js → concat-DdKPyAtw.js} +1 -1
  13. package/dist/{dataset-ZHEPJmED.js → dataset-iqT4Otvb.js} +7 -7
  14. package/dist/{dropout-lQm_YyX3.js → dropout-B09InSJS.js} +1 -1
  15. package/dist/{gather-BWyutxwi.js → gather-D6MsdXqc.js} +1 -1
  16. package/dist/{gpgpu_math-Df7gzJWH.js → gpgpu_math-BFbOyvk4.js} +1 -1
  17. package/dist/{index-CnHyhpKc.js → index-Du-bmOP8.js} +98 -98
  18. package/dist/{kernel_funcs_utils-Dqo82NH4.js → kernel_funcs_utils-DShm7-0k.js} +33 -33
  19. package/dist/layers/BaseLayer.js +2 -2
  20. package/dist/layers/CausalSelfAttention.js +6 -6
  21. package/dist/layers/MLP.js +5 -5
  22. package/dist/layers/RMSNorm.js +3 -3
  23. package/dist/layers/RoPECache.js +3 -3
  24. package/dist/layers/TiedEmbedding.js +6 -6
  25. package/dist/layers/TransformerBlock.js +1 -1
  26. package/dist/{log_sum_exp-CRH7Np9v.js → log_sum_exp-CxfBtUaG.js} +5 -5
  27. package/dist/main.js +1 -1
  28. package/dist/{mat_mul-DeGU1U_C.js → mat_mul-CbiqIe2d.js} +1 -1
  29. package/dist/{max-CcnEArWK.js → max-0Xnlpv8k.js} +1 -1
  30. package/dist/{norm-BpWsOapl.js → norm-01kY9I2B.js} +5 -5
  31. package/dist/{ones-CDWGzVnm.js → ones-CrutWGas.js} +2 -2
  32. package/dist/ops/appendCache.js +3 -3
  33. package/dist/ops/attentionMask.js +1 -1
  34. package/dist/ops/cpu/appendCache.js +2 -2
  35. package/dist/ops/cpu/attentionMask.js +5 -5
  36. package/dist/ops/cpu/fusedSoftmax.js +2 -2
  37. package/dist/ops/cpu/gatherSub.js +3 -3
  38. package/dist/ops/cpu/gelu.js +1 -1
  39. package/dist/ops/cpu/matMulGelu.js +1 -1
  40. package/dist/ops/cpu/matMulMul.js +1 -1
  41. package/dist/ops/cpu/mulDropout.js +1 -1
  42. package/dist/ops/cpu/normRMS.js +1 -1
  43. package/dist/ops/cpu/qkv.js +3 -3
  44. package/dist/ops/cpu/rope.js +5 -5
  45. package/dist/ops/cpu/scatterSub.js +4 -4
  46. package/dist/ops/fusedSoftmax.js +1 -1
  47. package/dist/ops/gatherSub.js +1 -1
  48. package/dist/ops/gelu.js +1 -1
  49. package/dist/ops/grads/attentionMask.js +1 -1
  50. package/dist/ops/grads/fusedSoftmax.js +2 -2
  51. package/dist/ops/grads/gelu.js +1 -1
  52. package/dist/ops/grads/matMulGelu.js +1 -1
  53. package/dist/ops/grads/normRMS.js +1 -1
  54. package/dist/ops/grads/qkv.js +1 -1
  55. package/dist/ops/grads/rope.js +1 -1
  56. package/dist/ops/matMulGelu.js +1 -1
  57. package/dist/ops/matMulMul.js +1 -1
  58. package/dist/ops/mulDrop.js +1 -1
  59. package/dist/ops/node/sparseCrossEntropy.js +1 -1
  60. package/dist/ops/normRMS.js +1 -1
  61. package/dist/ops/qkv.js +1 -1
  62. package/dist/ops/scatterSub.js +1 -1
  63. package/dist/ops/webgl/appendCache.js +1 -1
  64. package/dist/ops/webgl/attentionMask.js +1 -1
  65. package/dist/ops/webgl/fusedSoftmax.js +96 -96
  66. package/dist/ops/webgl/gatherSub.js +1 -1
  67. package/dist/ops/webgl/gelu.js +2 -2
  68. package/dist/ops/webgl/matMulGelu.js +4 -4
  69. package/dist/ops/webgl/matMulMul.js +1 -1
  70. package/dist/ops/webgl/mulDropout.js +1 -1
  71. package/dist/ops/webgl/normRMS.js +2 -2
  72. package/dist/ops/webgl/qkv.js +1 -1
  73. package/dist/ops/webgl/rope.js +1 -1
  74. package/dist/ops/webgl/scatterSub.js +1 -1
  75. package/dist/{ops-DzQTmLIl.js → ops-CJNniCAV.js} +13 -13
  76. package/dist/{random_width-DI2h9CMs.js → random_width-C-v-35bY.js} +1324 -1279
  77. package/dist/{range-CkOJ7090.js → range-Bvs1hidm.js} +1 -1
  78. package/dist/{reshape-CTIbqjwm.js → reshape-BH7eBpwq.js} +1 -1
  79. package/dist/{sin-HzioENy_.js → sin-CPAZXNjH.js} +1 -1
  80. package/dist/{slice_util-n4wHKmex.js → slice_util-DskXqRZa.js} +1 -1
  81. package/dist/{softmax-DX6qXAbm.js → softmax-DhWoBa7r.js} +1 -1
  82. package/dist/{split-CVwhL8Oe.js → split-BCUhuU7B.js} +1 -1
  83. package/dist/{stack-S2-D2JAQ.js → stack-BV1v7l3S.js} +1 -1
  84. package/dist/{sum-UdfvaNhB.js → sum-Cvq06317.js} +1 -1
  85. package/dist/{tensor-IZex6Bwp.js → tensor-DgTOPY6h.js} +1 -1
  86. package/dist/{tensor2d-CqtBzOKq.js → tensor2d-CRWjDyUe.js} +1 -1
  87. package/dist/{tfjs_backend-DX9yVvwk.js → tfjs_backend-D9Ytje0G.js} +39 -39
  88. package/dist/training/AdamExt.js +1 -1
  89. package/dist/training/DatasetBuilder.js +2 -2
  90. package/dist/training/FullTrainer.js +36 -32
  91. package/dist/training/Trainer.d.ts +7 -4
  92. package/dist/training/Trainer.js +58 -50
  93. package/dist/training/sparseCrossEntropy.js +4 -4
  94. package/dist/utilities/dummy.js +2 -2
  95. package/dist/utilities/generate.js +3 -3
  96. package/dist/utilities/load.js +1 -1
  97. package/dist/utilities/profile.d.ts +1 -0
  98. package/dist/utilities/profile.js +6 -3
  99. package/dist/utilities/weights.js +2 -2
  100. package/dist/{variable-BGvK-VN3.js → variable-DZ3fF0R2.js} +1 -1
  101. package/dist/{zeros-CYMicyqz.js → zeros-BaHhQTWf.js} +1 -1
  102. package/package.json +1 -1
  103. package/dist/moments-DLTE6-1p.js +0 -53
@@ -1,5 +1,5 @@
1
- import { an as D, ao as N, Q as w, q as R, U as v, N as P } from "./index-CnHyhpKc.js";
2
- import { u as g } from "./gpgpu_math-Df7gzJWH.js";
1
+ import { am as D, an as N, Q as w, q as R, U as v, N as P } from "./index-Du-bmOP8.js";
2
+ import { u as g } from "./gpgpu_math-BFbOyvk4.js";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -74,7 +74,7 @@ function k(t) {
74
74
  * =============================================================================
75
75
  */
76
76
  function E(t, e) {
77
- return ["x", "y", "z", "w", "u", "v"].slice(0, e).map((o) => `${t}.${o}`);
77
+ return ["x", "y", "z", "w", "u", "v"].slice(0, e).map((a) => `${t}.${a}`);
78
78
  }
79
79
  function z(t, e) {
80
80
  return e === 1 ? [t] : E(t, e);
@@ -96,8 +96,8 @@ function z(t, e) {
96
96
  * =============================================================================
97
97
  */
98
98
  class C {
99
- constructor(e, o, u) {
100
- this.variableNames = ["A", "B"], this.outputShape = w(o, u), this.enableShapeUniforms = g(this.outputShape.length), this.userCode = `
99
+ constructor(e, a, u) {
100
+ this.variableNames = ["A", "B"], this.outputShape = w(a, u), this.enableShapeUniforms = g(this.outputShape.length), this.userCode = `
101
101
  float binaryOperation(float a, float b) {
102
102
  ${e}
103
103
  }
@@ -127,21 +127,21 @@ class C {
127
127
  * =============================================================================
128
128
  */
129
129
  class _ {
130
- constructor(e, o, u, d = !1) {
131
- this.variableNames = ["A", "B"], this.supportsBroadcasting = !0, this.packedInputs = !0, this.packedOutput = !0, this.outputShape = w(o, u);
132
- const a = this.outputShape.length;
133
- this.enableShapeUniforms = g(a);
130
+ constructor(e, a, u, d = !1) {
131
+ this.variableNames = ["A", "B"], this.supportsBroadcasting = !0, this.packedInputs = !0, this.packedOutput = !0, this.outputShape = w(a, u);
132
+ const o = this.outputShape.length;
133
+ this.enableShapeUniforms = g(o);
134
134
  let n = "";
135
135
  if (d)
136
- if (a === 0 || R(this.outputShape) === 1)
136
+ if (o === 0 || R(this.outputShape) === 1)
137
137
  n = `
138
138
  result.y = 0.;
139
139
  result.z = 0.;
140
140
  result.w = 0.;
141
141
  `;
142
142
  else if (n = `
143
- ${k(a)} coords = getOutputCoords();
144
- `, a === 1)
143
+ ${k(o)} coords = getOutputCoords();
144
+ `, o === 1)
145
145
  this.enableShapeUniforms ? n += `
146
146
  result.y = (coords + 1) >= outShape ? 0. : result.y;
147
147
  result.z = 0.;
@@ -152,20 +152,20 @@ class _ {
152
152
  result.w = 0.;
153
153
  `;
154
154
  else {
155
- const s = z("coords", a);
155
+ const s = z("coords", o);
156
156
  this.enableShapeUniforms ? n += `
157
157
  bool nextRowOutOfBounds =
158
- (${s[a - 2]} + 1) >= outShape[${a} - 2];
158
+ (${s[o - 2]} + 1) >= outShape[${o} - 2];
159
159
  bool nextColOutOfBounds =
160
- (${s[a - 1]} + 1) >= outShape[${a} - 1];
160
+ (${s[o - 1]} + 1) >= outShape[${o} - 1];
161
161
  result.y = nextColOutOfBounds ? 0. : result.y;
162
162
  result.z = nextRowOutOfBounds ? 0. : result.z;
163
163
  result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;
164
164
  ` : n += `
165
165
  bool nextRowOutOfBounds =
166
- (${s[a - 2]} + 1) >= ${this.outputShape[a - 2]};
166
+ (${s[o - 2]} + 1) >= ${this.outputShape[o - 2]};
167
167
  bool nextColOutOfBounds =
168
- (${s[a - 1]} + 1) >= ${this.outputShape[a - 1]};
168
+ (${s[o - 1]} + 1) >= ${this.outputShape[o - 1]};
169
169
  result.y = nextColOutOfBounds ? 0. : result.y;
170
170
  result.z = nextRowOutOfBounds ? 0. : result.z;
171
171
  result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w;
@@ -205,8 +205,8 @@ class _ {
205
205
  * =============================================================================
206
206
  */
207
207
  function A(t) {
208
- const { inputs: e, backend: o } = t, { x: u } = e;
209
- return o.incRef(u.dataId), { dataId: u.dataId, shape: u.shape, dtype: u.dtype };
208
+ const { inputs: e, backend: a } = t, { x: u } = e;
209
+ return a.incRef(u.dataId), { dataId: u.dataId, shape: u.shape, dtype: u.dtype };
210
210
  }
211
211
  /**
212
212
  * @license
@@ -225,8 +225,8 @@ function A(t) {
225
225
  * =============================================================================
226
226
  */
227
227
  function G(t) {
228
- const { inputs: e, backend: o } = t, { real: u, imag: d } = e, a = o.makeTensorInfo(u.shape, "complex64"), n = o.texData.get(a.dataId), l = A({ inputs: { x: u }, backend: o }), s = A({ inputs: { x: d }, backend: o });
229
- return n.complexTensorInfos = { real: l, imag: s }, a;
228
+ const { inputs: e, backend: a } = t, { real: u, imag: d } = e, o = a.makeTensorInfo(u.shape, "complex64"), n = a.texData.get(o.dataId), l = A({ inputs: { x: u }, backend: a }), s = A({ inputs: { x: d }, backend: a });
229
+ return n.complexTensorInfos = { real: l, imag: s }, o;
230
230
  }
231
231
  /**
232
232
  * @license
@@ -245,10 +245,10 @@ function G(t) {
245
245
  * =============================================================================
246
246
  */
247
247
  class V {
248
- constructor(e, o) {
248
+ constructor(e, a) {
249
249
  this.variableNames = ["A"], this.outputShape = e, this.enableShapeUniforms = g(this.outputShape.length), this.userCode = `
250
250
  float unaryOperation(float x) {
251
- ${o}
251
+ ${a}
252
252
  }
253
253
 
254
254
  void main() {
@@ -278,10 +278,10 @@ const K = "if (isnan(x)) return x;";
278
278
  * =============================================================================
279
279
  */
280
280
  class L {
281
- constructor(e, o) {
281
+ constructor(e, a) {
282
282
  this.variableNames = ["A"], this.packedInputs = !0, this.packedOutput = !0, this.outputShape = e, this.enableShapeUniforms = g(this.outputShape.length), this.userCode = `
283
283
  vec4 unaryOperation(vec4 x) {
284
- ${o}
284
+ ${a}
285
285
  }
286
286
 
287
287
  void main() {
@@ -309,11 +309,11 @@ class L {
309
309
  * limitations under the License.
310
310
  * =============================================================================
311
311
  */
312
- function Y({ opSnippet: t, packedOpSnippet: e, cpuKernelImpl: o, dtype: u }) {
313
- return ({ inputs: d, backend: a }) => {
314
- const { x: n } = d, l = a, s = u || n.dtype;
315
- if (l.shouldExecuteOnCPU([n]) && o != null) {
316
- const c = l.texData.get(n.dataId), x = o(c.values, s);
312
+ function Y({ opSnippet: t, packedOpSnippet: e, cpuKernelImpl: a, dtype: u }) {
313
+ return ({ inputs: d, backend: o }) => {
314
+ const { x: n } = d, l = o, s = u || n.dtype;
315
+ if (l.shouldExecuteOnCPU([n]) && a != null) {
316
+ const c = l.texData.get(n.dataId), x = a(c.values, s);
317
317
  return l.makeTensorInfo(n.shape, s, x);
318
318
  }
319
319
  const i = P().getBool("WEBGL_PACK_UNARY_OPERATIONS") && e != null;
@@ -321,7 +321,7 @@ function Y({ opSnippet: t, packedOpSnippet: e, cpuKernelImpl: o, dtype: u }) {
321
321
  return i ? r = new L(n.shape, e) : r = new V(n.shape, t), l.runWebGLProgram(r, [n], s);
322
322
  };
323
323
  }
324
- function q({ opSnippet: t, packedOpSnippet: e, checkOutOfBounds: o = !1, supportsComplex: u = !1, cpuKernelImpl: d, dtype: a }) {
324
+ function q({ opSnippet: t, packedOpSnippet: e, checkOutOfBounds: a = !1, supportsComplex: u = !1, cpuKernelImpl: d, dtype: o }) {
325
325
  return ({ inputs: n, backend: l }) => {
326
326
  const { a: s, b: i } = n, r = l;
327
327
  if (u && s.dtype === "complex64") {
@@ -342,7 +342,7 @@ function q({ opSnippet: t, packedOpSnippet: e, checkOutOfBounds: o = !1, support
342
342
  }), I = G({ inputs: { real: y, imag: O }, backend: r });
343
343
  return r.disposeIntermediateTensorInfo(y), r.disposeIntermediateTensorInfo(O), I;
344
344
  }
345
- const c = a || v(s.dtype, i.dtype);
345
+ const c = o || v(s.dtype, i.dtype);
346
346
  if ((s.dtype === "string" || i.dtype === "string" || r.shouldExecuteOnCPU([s, i])) && d != null) {
347
347
  const h = r.texData.get(s.dataId).values, f = r.texData.get(i.dataId).values, y = s.dtype === "string" ? (
348
348
  // tslint:disable-next-line: no-any
@@ -355,7 +355,7 @@ function q({ opSnippet: t, packedOpSnippet: e, checkOutOfBounds: o = !1, support
355
355
  }
356
356
  const x = P().getBool("WEBGL_PACK_BINARY_OPERATIONS") && e != null;
357
357
  let b;
358
- return x ? b = new _(e, s.shape, i.shape, o) : b = new C(t, s.shape, i.shape), r.runWebGLProgram(b, [s, i], c);
358
+ return x ? b = new _(e, s.shape, i.shape, a) : b = new C(t, s.shape, i.shape), r.runWebGLProgram(b, [s, i], c);
359
359
  };
360
360
  }
361
361
  export {
@@ -1,5 +1,5 @@
1
- import { T as g, c as p, e as o, i as v } from "../index-CnHyhpKc.js";
2
- import { v as _ } from "../variable-BGvK-VN3.js";
1
+ import { T as g, c as p, e as o, i as v } from "../index-Du-bmOP8.js";
2
+ import { v as _ } from "../variable-DZ3fF0R2.js";
3
3
  class M {
4
4
  parent;
5
5
  config;
@@ -3,13 +3,13 @@ import O from "./BaseLayer.js";
3
3
  import { qkv as P } from "../ops/qkv.js";
4
4
  import { rope as v } from "../ops/rope.js";
5
5
  import { appendCache as V } from "../ops/appendCache.js";
6
- import { H as c, t as C } from "../index-CnHyhpKc.js";
6
+ import { H as c, t as C } from "../index-Du-bmOP8.js";
7
7
  import { fusedSoftmax as T } from "../ops/fusedSoftmax.js";
8
- import { d as y } from "../tfjs_backend-DX9yVvwk.js";
9
- import { v as b } from "../variable-BGvK-VN3.js";
10
- import { r as k, d as L } from "../dropout-lQm_YyX3.js";
11
- import { r as N } from "../reshape-CTIbqjwm.js";
12
- import { m as R } from "../mat_mul-DeGU1U_C.js";
8
+ import { d as y } from "../tfjs_backend-D9Ytje0G.js";
9
+ import { v as b } from "../variable-DZ3fF0R2.js";
10
+ import { r as k, d as L } from "../dropout-B09InSJS.js";
11
+ import { r as N } from "../reshape-BH7eBpwq.js";
12
+ import { m as R } from "../mat_mul-CbiqIe2d.js";
13
13
  class $ extends O {
14
14
  divisor;
15
15
  index;
@@ -1,10 +1,10 @@
1
- import { t as l } from "../index-CnHyhpKc.js";
1
+ import { t as l } from "../index-Du-bmOP8.js";
2
2
  import u from "./BaseLayer.js";
3
3
  import { matMulGelu as M } from "../ops/matMulGelu.js";
4
- import { v as o } from "../variable-BGvK-VN3.js";
5
- import { r as h, d as f } from "../dropout-lQm_YyX3.js";
6
- import { r as d } from "../reshape-CTIbqjwm.js";
7
- import { m as c } from "../mat_mul-DeGU1U_C.js";
4
+ import { v as o } from "../variable-DZ3fF0R2.js";
5
+ import { r as h, d as f } from "../dropout-B09InSJS.js";
6
+ import { r as d } from "../reshape-BH7eBpwq.js";
7
+ import { m as c } from "../mat_mul-CbiqIe2d.js";
8
8
  class V extends u {
9
9
  index;
10
10
  hiddenUnits;
@@ -1,8 +1,8 @@
1
- import { t as s } from "../index-CnHyhpKc.js";
1
+ import { t as s } from "../index-Du-bmOP8.js";
2
2
  import e from "./BaseLayer.js";
3
3
  import { normRMS as a } from "../ops/normRMS.js";
4
- import { v as i } from "../variable-BGvK-VN3.js";
5
- import { o as m } from "../ones-CDWGzVnm.js";
4
+ import { v as i } from "../variable-DZ3fF0R2.js";
5
+ import { o as m } from "../ones-CrutWGas.js";
6
6
  class f extends e {
7
7
  GAMMA;
8
8
  constructor(r, t = "", o) {
@@ -1,6 +1,6 @@
1
- import { o as c, j as f, E as l, V as m, f as n, W as u, t as p, H as a } from "../index-CnHyhpKc.js";
2
- import { c as d, s as C } from "../sin-HzioENy_.js";
3
- import { r as h } from "../range-CkOJ7090.js";
1
+ import { o as c, j as f, E as l, V as m, f as n, W as u, t as p, H as a } from "../index-Du-bmOP8.js";
2
+ import { c as d, s as C } from "../sin-CPAZXNjH.js";
3
+ import { r as h } from "../range-Bvs1hidm.js";
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,10 +1,10 @@
1
- import "../random_width-DI2h9CMs.js";
2
- import "../index-CnHyhpKc.js";
3
- import { T as f } from "../TiedEmbedding-DORsPlNL.js";
4
- import "../tfjs_backend-DX9yVvwk.js";
1
+ import "../random_width-C-v-35bY.js";
2
+ import "../index-Du-bmOP8.js";
3
+ import { T as f } from "../TiedEmbedding-8S8xn8e6.js";
4
+ import "../tfjs_backend-D9Ytje0G.js";
5
5
  import "./BaseLayer.js";
6
- import "../variable-BGvK-VN3.js";
7
- import "../gather-BWyutxwi.js";
6
+ import "../variable-DZ3fF0R2.js";
7
+ import "../gather-D6MsdXqc.js";
8
8
  export {
9
9
  f as default
10
10
  };
@@ -2,7 +2,7 @@ import l from "./CausalSelfAttention.js";
2
2
  import r from "./MLP.js";
3
3
  import o from "./RMSNorm.js";
4
4
  import d from "./BaseLayer.js";
5
- import { t as p } from "../index-CnHyhpKc.js";
5
+ import { t as p } from "../index-Du-bmOP8.js";
6
6
  class k extends d {
7
7
  ln1;
8
8
  attn;
@@ -1,8 +1,8 @@
1
- import { o as r, j as p, E as u, a7 as E, a8 as h, a1 as S, s as $, a9 as d } from "./index-CnHyhpKc.js";
2
- import { e as K } from "./axis_util-CVbf1vmL.js";
3
- import { m as T } from "./max-CcnEArWK.js";
4
- import { r as m } from "./reshape-CTIbqjwm.js";
5
- import { s as _ } from "./sum-UdfvaNhB.js";
1
+ import { o as r, j as p, E as u, a6 as E, a7 as h, a1 as S, s as $, a8 as d } from "./index-Du-bmOP8.js";
2
+ import { e as K } from "./axis_util-BczFISHz.js";
3
+ import { m as T } from "./max-0Xnlpv8k.js";
4
+ import { r as m } from "./reshape-BH7eBpwq.js";
5
+ import { s as _ } from "./sum-Cvq06317.js";
6
6
  /**
7
7
  * @license
8
8
  * Copyright 2018 Google LLC. All Rights Reserved.
package/dist/main.js CHANGED
@@ -5,7 +5,7 @@ import { default as q } from "./tokeniser/bpe.js";
5
5
  import { default as A } from "./utilities/waitForModel.js";
6
6
  import { default as I } from "./data/textLoader.js";
7
7
  import { estimateMemoryUsage as K, estimateParameterCount as O, estimateResources as Q, estimateTrainingMemoryUsage as S, validateConfig as V } from "./utilities/parameters.js";
8
- import "./index-CnHyhpKc.js";
8
+ import "./index-Du-bmOP8.js";
9
9
  import "./ops/cpu/scatterSub.js";
10
10
  import "./ops/webgl/scatterSub.js";
11
11
  import "./ops/cpu/gatherSub.js";
@@ -1,4 +1,4 @@
1
- import { o as m, j as s, u as c, E as M, B as p } from "./index-CnHyhpKc.js";
1
+ import { o as m, j as s, u as c, E as M, B as p } from "./index-Du-bmOP8.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { o as r, j as e, E as x, M as c } from "./index-CnHyhpKc.js";
1
+ import { o as r, j as e, E as x, M as c } from "./index-Du-bmOP8.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,8 +1,8 @@
1
- import { o as l, j as c, E as y, a3 as E, a1 as w, a4 as o, a5 as u, W as v, f as I, a2 as A } from "./index-CnHyhpKc.js";
2
- import { e as $ } from "./axis_util-CVbf1vmL.js";
3
- import { m as f } from "./max-CcnEArWK.js";
4
- import { r as h } from "./reshape-CTIbqjwm.js";
5
- import { s as t } from "./sum-UdfvaNhB.js";
1
+ import { o as l, j as c, E as y, a0 as E, a1 as w, a2 as o, a3 as u, W as v, f as I, a4 as A } from "./index-Du-bmOP8.js";
2
+ import { e as $ } from "./axis_util-BczFISHz.js";
3
+ import { m as f } from "./max-0Xnlpv8k.js";
4
+ import { r as h } from "./reshape-BH7eBpwq.js";
5
+ import { s as t } from "./sum-Cvq06317.js";
6
6
  /**
7
7
  * @license
8
8
  * Copyright 2020 Google Inc. All Rights Reserved.
@@ -1,5 +1,5 @@
1
- import { n, p as t, q as m, E as i } from "./index-CnHyhpKc.js";
2
- import { z as c, c as f } from "./zeros-CYMicyqz.js";
1
+ import { n, p as t, q as m, E as i } from "./index-Du-bmOP8.js";
2
+ import { z as c, c as f } from "./zeros-BaHhQTWf.js";
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,8 +1,8 @@
1
- import { e as a } from "../index-CnHyhpKc.js";
1
+ import { e as a } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/appendCache.js";
3
3
  import "./webgl/appendCache.js";
4
- import { c as s } from "../concat-BRRtq4S2.js";
5
- import { z as c } from "../zeros-CYMicyqz.js";
4
+ import { c as s } from "../concat-DdKPyAtw.js";
5
+ import { z as c } from "../zeros-BaHhQTWf.js";
6
6
  function i(r, p, n, o) {
7
7
  if (!o) {
8
8
  const e = r.shape[2];
@@ -1,4 +1,4 @@
1
- import { e as o } from "../index-CnHyhpKc.js";
1
+ import { e as o } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/attentionMask.js";
3
3
  import "./webgl/attentionMask.js";
4
4
  import "./grads/attentionMask.js";
@@ -1,5 +1,5 @@
1
- import { r as d } from "../../index-CnHyhpKc.js";
2
- import { c as h } from "../../concat-BRRtq4S2.js";
1
+ import { r as d } from "../../index-Du-bmOP8.js";
2
+ import { c as h } from "../../concat-DdKPyAtw.js";
3
3
  function u(p) {
4
4
  const { cache: n, item: s } = p.inputs, { maxSize: r, pastLen: c } = p.attrs, t = n.shape[0], o = n.shape[1], a = n.shape[3], e = s.shape[2];
5
5
  if (c + e <= r) {
@@ -1,8 +1,8 @@
1
- import { r as a, g as p, f as u } from "../../index-CnHyhpKc.js";
2
- import { l as N, w as b } from "../../ops-DzQTmLIl.js";
3
- import { o as g } from "../../ones-CDWGzVnm.js";
4
- import { z as A } from "../../zeros-CYMicyqz.js";
5
- import { m as I } from "../../mat_mul-DeGU1U_C.js";
1
+ import { r as a, g as p, f as u } from "../../index-Du-bmOP8.js";
2
+ import { l as N, w as b } from "../../ops-CJNniCAV.js";
3
+ import { o as g } from "../../ones-CrutWGas.js";
4
+ import { z as A } from "../../zeros-BaHhQTWf.js";
5
+ import { m as I } from "../../mat_mul-CbiqIe2d.js";
6
6
  function o(n) {
7
7
  const { q: s, k: e } = n.inputs, { divisor: r } = n.attrs, c = s.shape[2], t = e.shape[2], m = N.bandPart(g([t, t]), -1, 0).cast("bool"), l = A([t, t]), i = p([t, t], Number.NEGATIVE_INFINITY), f = b(m, l, i), k = I(s, e, !1, !0).mul(u(r)), d = f.slice([0, 0], [c, t]).expandDims(0).expandDims(0);
8
8
  return k.add(d);
@@ -1,5 +1,5 @@
1
- import { r as n } from "../../index-CnHyhpKc.js";
2
- import { s as f } from "../../softmax-DX6qXAbm.js";
1
+ import { r as n } from "../../index-Du-bmOP8.js";
2
+ import { s as f } from "../../softmax-DhWoBa7r.js";
3
3
  function r(t) {
4
4
  const { inputs: s, attrs: i } = t, { logits: o } = s, { dim: a, dropoutRate: e } = i;
5
5
  if (!o)
@@ -1,6 +1,6 @@
1
- import { o as u, j as c, E as g, O as h, r as m, s as p } from "../../index-CnHyhpKc.js";
2
- import { r as l } from "../../range-CkOJ7090.js";
3
- import { s as N } from "../../stack-S2-D2JAQ.js";
1
+ import { o as u, j as c, E as g, O as h, r as m, s as p } from "../../index-Du-bmOP8.js";
2
+ import { r as l } from "../../range-Bvs1hidm.js";
3
+ import { s as N } from "../../stack-BV1v7l3S.js";
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { r as t, t as d } from "../../index-CnHyhpKc.js";
1
+ import { r as t, t as d } from "../../index-Du-bmOP8.js";
2
2
  const o = 0.7978845608028654, c = 0.044715;
3
3
  function m(u) {
4
4
  const { inputs: l } = u, { x: e } = l, n = e;
@@ -1,4 +1,4 @@
1
- import { r as a, t as i } from "../../index-CnHyhpKc.js";
1
+ import { r as a, t as i } from "../../index-Du-bmOP8.js";
2
2
  const c = 0.7978845608028654, m = 0.044715;
3
3
  function M(o) {
4
4
  const { inputs: s } = o, { x: t, kernel: l } = s, e = t, u = l;
@@ -1,4 +1,4 @@
1
- import { r as n, t as M } from "../../index-CnHyhpKc.js";
1
+ import { r as n, t as M } from "../../index-Du-bmOP8.js";
2
2
  function e(t) {
3
3
  const { inputs: r, attrs: o } = t, { transposeA: s, transposeB: l } = o, { x: c, kernel: u, y: a } = r, m = c, i = u, k = a;
4
4
  return M(() => m.matMul(i, s, l).mul(k));
@@ -1,4 +1,4 @@
1
- import { r as e, b as u } from "../../index-CnHyhpKc.js";
1
+ import { r as e, b as u } from "../../index-Du-bmOP8.js";
2
2
  function n(o) {
3
3
  const { inputs: r } = o, { a: l, b: t } = r;
4
4
  return console.warn("Using fallback mulDrop implementation without dropout."), u(l, t);
@@ -1,4 +1,4 @@
1
- import { r as o, t as d } from "../../index-CnHyhpKc.js";
1
+ import { r as o, t as d } from "../../index-Du-bmOP8.js";
2
2
  function i(t) {
3
3
  const { inputs: e } = t, { x: n, gamma: s } = e, r = n, a = s;
4
4
  return d(() => {
@@ -1,6 +1,6 @@
1
- import { r as q } from "../../index-CnHyhpKc.js";
2
- import { r as o } from "../../reshape-CTIbqjwm.js";
3
- import { s as x } from "../../split-CVwhL8Oe.js";
1
+ import { r as q } from "../../index-Du-bmOP8.js";
2
+ import { r as o } from "../../reshape-BH7eBpwq.js";
3
+ import { s as x } from "../../split-BCUhuU7B.js";
4
4
  function v(p) {
5
5
  const { x: c, kernel: K } = p.inputs, { heads: n } = p.attrs, [s, e, t] = c.shape, a = o(c, [s * e, t]), i = a.dot(K);
6
6
  a.dispose();
@@ -1,8 +1,8 @@
1
- import { r as S } from "../../index-CnHyhpKc.js";
2
- import { r as F } from "../../range-CkOJ7090.js";
3
- import { g as I } from "../../gather-BWyutxwi.js";
4
- import { s as E } from "../../stack-S2-D2JAQ.js";
5
- import { c as T } from "../../concat-BRRtq4S2.js";
1
+ import { r as S } from "../../index-Du-bmOP8.js";
2
+ import { r as F } from "../../range-Bvs1hidm.js";
3
+ import { g as I } from "../../gather-D6MsdXqc.js";
4
+ import { s as E } from "../../stack-BV1v7l3S.js";
5
+ import { c as T } from "../../concat-DdKPyAtw.js";
6
6
  function U(t, c, p, o, r) {
7
7
  const n = o.shape[3], s = p;
8
8
  if (s > n) return o;
@@ -1,7 +1,7 @@
1
- import { o as l, n as g, j as h, E as k, a6 as w, r as $, s as d, b as m } from "../../index-CnHyhpKc.js";
2
- import { r as b } from "../../range-CkOJ7090.js";
3
- import { s as E } from "../../stack-S2-D2JAQ.js";
4
- import { o as D } from "../../ones-CDWGzVnm.js";
1
+ import { o as l, n as g, j as h, E as k, a5 as w, r as $, s as d, b as m } from "../../index-Du-bmOP8.js";
2
+ import { r as b } from "../../range-Bvs1hidm.js";
3
+ import { s as E } from "../../stack-BV1v7l3S.js";
4
+ import { o as D } from "../../ones-CrutWGas.js";
5
5
  function N(a, r, t) {
6
6
  const s = r.rank > 1 ? r.shape[r.rank - 1] : 1, e = r.rank > 1 ? r.rank - 1 : 1, o = `Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${t.shape}, indices.shape: ${r.shape}, shape: ${a}, sliceDim: ${s}, and batchDim: ${e}.`;
7
7
  if (t.rank < e)
@@ -1,4 +1,4 @@
1
- import { e as t } from "../index-CnHyhpKc.js";
1
+ import { e as t } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/fusedSoftmax.js";
3
3
  import "./webgl/fusedSoftmax.js";
4
4
  import "./grads/fusedSoftmax.js";
@@ -1,4 +1,4 @@
1
- import { e as n } from "../index-CnHyhpKc.js";
1
+ import { e as n } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/gatherSub.js";
3
3
  import "./webgl/gatherSub.js";
4
4
  function f(r, e, t) {
package/dist/ops/gelu.js CHANGED
@@ -1,4 +1,4 @@
1
- import "../index-CnHyhpKc.js";
1
+ import "../index-Du-bmOP8.js";
2
2
  import "./cpu/gelu.js";
3
3
  import "./webgl/gelu.js";
4
4
  import { d as e, g as i } from "./grads/gelu.js";
@@ -1,4 +1,4 @@
1
- import { h as l, f as a } from "../../index-CnHyhpKc.js";
1
+ import { h as l, f as a } from "../../index-Du-bmOP8.js";
2
2
  import { matMulMul as i } from "../matMulMul.js";
3
3
  const m = {
4
4
  kernelName: "AttentionMask",
@@ -1,6 +1,6 @@
1
- import { h as d, b as u, s as f } from "../../index-CnHyhpKc.js";
1
+ import { h as d, b as u, s as f } from "../../index-Du-bmOP8.js";
2
2
  import { mulDrop as l } from "../mulDrop.js";
3
- import { s as g } from "../../sum-UdfvaNhB.js";
3
+ import { s as g } from "../../sum-Cvq06317.js";
4
4
  const T = {
5
5
  kernelName: "FusedSoftmax",
6
6
  outputsToSave: [!0],
@@ -1,4 +1,4 @@
1
- import { h as t, e as n } from "../../index-CnHyhpKc.js";
1
+ import { h as t, e as n } from "../../index-Du-bmOP8.js";
2
2
  import "../cpu/gelu.js";
3
3
  import "../webgl/gelu.js";
4
4
  const o = {
@@ -1,4 +1,4 @@
1
- import { h as a, e as o } from "../../index-CnHyhpKc.js";
1
+ import { h as a, e as o } from "../../index-Du-bmOP8.js";
2
2
  function s(e, n, r) {
3
3
  return o().runKernel("MatMulGeluGrad", { dy: e, x: n, kernel: r });
4
4
  }
@@ -1,4 +1,4 @@
1
- import { h as t, e as g } from "../../index-CnHyhpKc.js";
1
+ import { h as t, e as g } from "../../index-Du-bmOP8.js";
2
2
  function s(r, a, n) {
3
3
  return g().runKernel("RMSNormGrad", { dy: r, x: a, gamma: n });
4
4
  }
@@ -1,4 +1,4 @@
1
- import { h as Q } from "../../index-CnHyhpKc.js";
1
+ import { h as Q } from "../../index-Du-bmOP8.js";
2
2
  const V = {
3
3
  kernelName: "QKV",
4
4
  inputsToSave: ["x", "kernel"],
@@ -1,4 +1,4 @@
1
- import { h as a, e as i } from "../../index-CnHyhpKc.js";
1
+ import { h as a, e as i } from "../../index-Du-bmOP8.js";
2
2
  function p(n, e, s, o) {
3
3
  return i().runKernel("Rope", { x: n, sin: e, cos: s }, { pastLen: o });
4
4
  }
@@ -1,4 +1,4 @@
1
- import { e as u } from "../index-CnHyhpKc.js";
1
+ import { e as u } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/matMulGelu.js";
3
3
  import "./webgl/matMulGelu.js";
4
4
  import "./grads/matMulGelu.js";
@@ -1,4 +1,4 @@
1
- import { e as u } from "../index-CnHyhpKc.js";
1
+ import { e as u } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/matMulMul.js";
3
3
  import "./webgl/matMulMul.js";
4
4
  function m(e, r, t, l = !1, n = !1) {
@@ -1,4 +1,4 @@
1
- import { e as t } from "../index-CnHyhpKc.js";
1
+ import { e as t } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/mulDropout.js";
3
3
  import "./webgl/mulDropout.js";
4
4
  function m(r, o, e, n) {
@@ -1,4 +1,4 @@
1
- import { r as o } from "../../index-CnHyhpKc.js";
1
+ import { r as o } from "../../index-Du-bmOP8.js";
2
2
  function r(e) {
3
3
  const { logits: t, labels: n } = e.inputs;
4
4
  return e.backend.executeMultipleOutputs("SparseSoftmaxCrossEntropyWithLogits", [], [t, n], 2);
@@ -1,4 +1,4 @@
1
- import { e as n } from "../index-CnHyhpKc.js";
1
+ import { e as n } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/normRMS.js";
3
3
  import "./webgl/normRMS.js";
4
4
  import "./grads/normRMS.js";
package/dist/ops/qkv.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e as o } from "../index-CnHyhpKc.js";
1
+ import { e as o } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/qkv.js";
3
3
  import "./webgl/qkv.js";
4
4
  import "./grads/qkv.js";
@@ -1,4 +1,4 @@
1
- import { e as i } from "../index-CnHyhpKc.js";
1
+ import { e as i } from "../index-Du-bmOP8.js";
2
2
  import "./cpu/scatterSub.js";
3
3
  import "./webgl/scatterSub.js";
4
4
  function c(t, r, e) {
@@ -1,4 +1,4 @@
1
- import { r as p } from "../../index-CnHyhpKc.js";
1
+ import { r as p } from "../../index-Du-bmOP8.js";
2
2
  class m {
3
3
  variableNames = ["cache", "item"];
4
4
  outputShape;
@@ -1,4 +1,4 @@
1
- import { r as m } from "../../index-CnHyhpKc.js";
1
+ import { r as m } from "../../index-Du-bmOP8.js";
2
2
  class h {
3
3
  variableNames = ["q", "k"];
4
4
  outputShape;