@genai-fi/nanogpt 0.7.1 → 0.7.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 (133) hide show
  1. package/dist/Generator.js +7 -7
  2. package/dist/NanoGPTModel.js +8 -8
  3. package/dist/{RealDiv-CVYNbZxu.js → RealDiv-Dy0p8Bvo.js} +7 -7
  4. package/dist/{Reshape-CEsEp0AI.js → Reshape-DH5srBP0.js} +2 -2
  5. package/dist/{Reshape-Do18N3gO.js → Reshape-DvudQDvJ.js} +1 -1
  6. package/dist/TeachableLLM.js +5 -5
  7. package/dist/{TiedEmbedding-ccLBFiZi.js → TiedEmbedding-BxOerUmB.js} +4 -4
  8. package/dist/{axis_util-5DTW2tFV.js → axis_util-BzbKo31C.js} +1 -1
  9. package/dist/backend.js +2 -2
  10. package/dist/{backend_util-C9Ut8n0Q.js → backend_util-TE7aTPhZ.js} +4 -4
  11. package/dist/{broadcast_to-Ba9h_8DO.js → broadcast_to-CdbwV-Dj.js} +2 -2
  12. package/dist/{concat-CbXTetof.js → concat-CsxrgovM.js} +1 -1
  13. package/dist/{dataset-U3PrjwgU.js → dataset-CtdBYwjo.js} +3 -3
  14. package/dist/{dropout-DPfPgWWe.js → dropout-DYs5QFGQ.js} +1 -1
  15. package/dist/{gather-Bbh8DHhM.js → gather-CMMy2KEG.js} +1 -1
  16. package/dist/{gelu-BFwVnd1r.js → gelu-C-dPj6Ku.js} +1 -1
  17. package/dist/{gpgpu_math-DffelNS-.js → gpgpu_math-DGNLNL4I.js} +2 -2
  18. package/dist/{index-UdZhlibC.js → index-BoWRt-10.js} +4 -4
  19. package/dist/{index-DYD_yPa-.js → index-CLthM0TO.js} +10 -10
  20. package/dist/{kernel_funcs_utils-CXDy3EN7.js → kernel_funcs_utils-BYKWV8Aa.js} +3 -3
  21. package/dist/layers/BaseLayer.js +2 -2
  22. package/dist/layers/CausalSelfAttention.js +6 -6
  23. package/dist/layers/MLP.js +5 -5
  24. package/dist/layers/RMSNorm.js +3 -3
  25. package/dist/layers/RoPECache.js +4 -4
  26. package/dist/layers/TiedEmbedding.js +5 -5
  27. package/dist/layers/TransformerBlock.js +1 -1
  28. package/dist/loader/loadTransformers.js +1 -1
  29. package/dist/loader/oldZipLoad.js +5 -5
  30. package/dist/{log_sum_exp-BnmCkHWl.js → log_sum_exp-DbjkV734.js} +5 -5
  31. package/dist/main.js +5 -5
  32. package/dist/{mat_mul-dwmZz69e.js → mat_mul-8m8pfdcx.js} +1 -1
  33. package/dist/{max-ByjEGoFx.js → max-Ddnnb5xe.js} +1 -1
  34. package/dist/{mulmat_packed_gpu-IGPBp6h9.js → mulmat_packed_gpu-VSekgsNv.js} +1 -1
  35. package/dist/{ones-C8Mfln6-.js → ones-Dj0SDhHf.js} +2 -2
  36. package/dist/ops/adamAdjust.js +1 -1
  37. package/dist/ops/adamMoments.js +1 -1
  38. package/dist/ops/appendCache.js +3 -3
  39. package/dist/ops/attentionMask.js +1 -1
  40. package/dist/ops/cpu/adamAdjust.js +1 -1
  41. package/dist/ops/cpu/adamMoments.js +2 -2
  42. package/dist/ops/cpu/appendCache.js +2 -2
  43. package/dist/ops/cpu/attentionMask.js +5 -5
  44. package/dist/ops/cpu/fusedSoftmax.js +2 -2
  45. package/dist/ops/cpu/gatherSub.js +3 -3
  46. package/dist/ops/cpu/gelu.js +1 -1
  47. package/dist/ops/cpu/matMulGelu.js +2 -2
  48. package/dist/ops/cpu/matMulMul.js +1 -1
  49. package/dist/ops/cpu/mulDropout.js +1 -1
  50. package/dist/ops/cpu/normRMS.js +1 -1
  51. package/dist/ops/cpu/qkv.js +3 -3
  52. package/dist/ops/cpu/rope.js +5 -5
  53. package/dist/ops/cpu/scatterSub.js +5 -5
  54. package/dist/ops/fusedSoftmax.js +1 -1
  55. package/dist/ops/gatherSub.js +1 -1
  56. package/dist/ops/gelu.js +2 -2
  57. package/dist/ops/grads/attentionMask.js +1 -1
  58. package/dist/ops/grads/fusedSoftmax.js +2 -2
  59. package/dist/ops/grads/gelu.js +2 -2
  60. package/dist/ops/grads/matMulGelu.js +1 -1
  61. package/dist/ops/grads/normRMS.js +1 -1
  62. package/dist/ops/grads/qkv.js +1 -1
  63. package/dist/ops/grads/rope.js +1 -1
  64. package/dist/ops/matMulGelu.js +1 -1
  65. package/dist/ops/matMulMul.js +1 -1
  66. package/dist/ops/mulDrop.js +1 -1
  67. package/dist/ops/normRMS.js +1 -1
  68. package/dist/ops/qkv.js +1 -1
  69. package/dist/ops/rope.js +4 -4
  70. package/dist/ops/scatterSub.js +1 -1
  71. package/dist/ops/webgl/adamAdjust.js +2 -2
  72. package/dist/ops/webgl/adamMoments.js +7 -5
  73. package/dist/ops/webgl/appendCache.js +1 -1
  74. package/dist/ops/webgl/attentionMask.js +1 -1
  75. package/dist/ops/webgl/fusedSoftmax.js +4 -4
  76. package/dist/ops/webgl/gatherSub.js +1 -1
  77. package/dist/ops/webgl/gelu.js +2 -2
  78. package/dist/ops/webgl/log.js +3 -3
  79. package/dist/ops/webgl/matMulGelu.js +4 -4
  80. package/dist/ops/webgl/matMulMul.js +1 -1
  81. package/dist/ops/webgl/mulDropout.js +1 -1
  82. package/dist/ops/webgl/normRMS.js +2 -2
  83. package/dist/ops/webgl/qkv.js +1 -1
  84. package/dist/ops/webgl/rope.js +1 -1
  85. package/dist/ops/webgl/scatterSub.js +1 -1
  86. package/dist/ops/webgpu/adamAdjust.js +15 -13
  87. package/dist/ops/webgpu/adamMoments.js +18 -11
  88. package/dist/ops/webgpu/appendCache.js +18 -15
  89. package/dist/ops/webgpu/attentionMask.js +24 -18
  90. package/dist/ops/webgpu/gatherSub.js +17 -30
  91. package/dist/ops/webgpu/gelu.js +3 -3
  92. package/dist/ops/webgpu/normRMS.js +16 -8
  93. package/dist/ops/webgpu/normRMSGrad.js +25 -20
  94. package/dist/ops/webgpu/qkv.js +23 -19
  95. package/dist/ops/webgpu/rope.js +37 -24
  96. package/dist/ops/webgpu/scatterSub.js +16 -14
  97. package/dist/ops/webgpu/utils/reductions.js +4 -4
  98. package/dist/{ops-aRTXR2Sr.js → ops-BFGCx8Ri.js} +15 -15
  99. package/dist/{random_width-DbSpgl4o.js → random_width-sZORGo5k.js} +22 -22
  100. package/dist/{range-D9CZhVlR.js → range-CRuAh-gd.js} +1 -1
  101. package/dist/{reciprocal-CGB48wZB.js → reciprocal-BvGAyKyu.js} +1 -1
  102. package/dist/{register_all_kernels-DnbAyBXt.js → register_all_kernels-BwDSRN-f.js} +30 -30
  103. package/dist/{reshape-BR0eoLYN.js → reshape-CdBq1WJ6.js} +1 -1
  104. package/dist/{scatter_nd_util-OjyAxku2.js → scatter_nd_util-DUstGbU1.js} +1 -1
  105. package/dist/{selu_util-Ce6pu9IM.js → selu_util-BJEXVvjX.js} +3 -3
  106. package/dist/{shared-Czipaeb6.js → shared-B8ztnyEk.js} +6 -6
  107. package/dist/{shared-DS5waSIY.js → shared-wS99K7_n.js} +1 -1
  108. package/dist/{sin-CiBxrDqX.js → sin-BeA3tsEd.js} +1 -1
  109. package/dist/{slice-BHbDHObE.js → slice-BiOsknYS.js} +1 -1
  110. package/dist/{softmax-JMEIUo2J.js → softmax-Bv_6lyMX.js} +1 -1
  111. package/dist/{split-CRU0PjVV.js → split-B-dikLRw.js} +1 -1
  112. package/dist/{stack-ikk2Y8_P.js → stack-B17UN2nn.js} +1 -1
  113. package/dist/{sum-NLYbiDag.js → sum-66ew2byf.js} +1 -1
  114. package/dist/{tensor-Do9PKbIE.js → tensor-JwS7ZYY6.js} +1 -1
  115. package/dist/{tensor2d-CWHxHpLh.js → tensor2d-wxPAnDQy.js} +1 -1
  116. package/dist/training/Adam.js +2 -2
  117. package/dist/training/AdamExt.js +1 -1
  118. package/dist/training/DatasetBuilder.js +35 -32
  119. package/dist/training/FullTrainer.js +1 -1
  120. package/dist/training/Trainer.js +2 -2
  121. package/dist/training/sparseCrossEntropy.js +4 -4
  122. package/dist/utilities/dummy.js +2 -2
  123. package/dist/utilities/generate.js +3 -3
  124. package/dist/utilities/multinomialCPU.js +2 -2
  125. package/dist/utilities/performance.js +1 -1
  126. package/dist/utilities/profile.js +1 -1
  127. package/dist/utilities/safetensors.js +2 -2
  128. package/dist/utilities/weights.js +2 -2
  129. package/dist/{variable-BTBkayv_.js → variable-BuddVFLa.js} +1 -1
  130. package/dist/{webgpu_program-WaoMq-WD.js → webgpu_program-PFzf1hAQ.js} +1 -1
  131. package/dist/{webgpu_util-DhSeP4b6.js → webgpu_util-D____QpY.js} +1 -1
  132. package/dist/{zeros-DnPT2nD4.js → zeros--BdLQ3oG.js} +1 -1
  133. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { f } from "../../index-UdZhlibC.js";
2
- import { g as m } from "../../webgpu_program-WaoMq-WD.js";
3
- import { f as k, c as l } from "../../webgpu_util-DhSeP4b6.js";
1
+ import { f, a2 as m } from "../../index-BoWRt-10.js";
2
+ import { g as k } from "../../webgpu_program-PFzf1hAQ.js";
3
+ import { f as l, c as v } from "../../webgpu_util-D____QpY.js";
4
4
  class g {
5
5
  variableNames = ["q", "k"];
6
6
  outputShape;
@@ -14,13 +14,13 @@ class g {
14
14
  nh;
15
15
  T1;
16
16
  T2;
17
- constructor(t, e, i, r, s) {
18
- if (this.shaderKey = `AttentionMask_${s}`, this.outputShape = [t, e, i, r], this.hs = s, this.nh = e, this.T1 = i, this.T2 = r, this.dispatchLayout = k(this.outputShape), this.dispatch = l(this.dispatchLayout, this.outputShape, this.workgroupSize), s % 4 !== 0)
17
+ constructor(t, e, s, o, i) {
18
+ if (this.shaderKey = `AttentionMask_${i}`, this.outputShape = [t, e, s, o], this.hs = i, this.nh = e, this.T1 = s, this.T2 = o, this.dispatchLayout = l(this.outputShape), this.dispatch = v(this.dispatchLayout, this.outputShape, this.workgroupSize), i % 4 !== 0)
19
19
  throw new Error("Head size must be a multiple of 4 for AttentionMaskProgram");
20
20
  }
21
21
  getUserCode() {
22
22
  return `
23
- ${m("index")} {
23
+ ${k("index")} {
24
24
 
25
25
  let coords = getCoordsFromIndex(index);
26
26
  let b = coords[0];
@@ -33,13 +33,14 @@ class g {
33
33
  setOutputAtIndex(index, uniforms.inf);
34
34
  return;
35
35
  }
36
+
37
+ let q0 = getIndexFromCoords4D(vec4<i32>(b, h, t1, 0), uniforms.qShape);
38
+ let k0 = getIndexFromCoords4D(vec4<i32>(b, h, t2, 0), uniforms.kShape);
36
39
 
37
40
  var sum: f32 = 0.0;
38
41
  for (var i: i32 = 0; i < ${this.hs}; i = i + 4) {
39
- let q0 = getIndexFromCoords4D(vec4<i32>(b, h, t1, i), uniforms.qShape);
40
- let qv = vec4<f32>(q[q0], q[q0 + 1], q[q0 + 2], q[q0 + 3]);
41
- let k0 = getIndexFromCoords4D(vec4<i32>(b, h, t2, i), uniforms.kShape);
42
- let kv = vec4<f32>(k[k0], k[k0 + 1], k[k0 + 2], k[k0 + 3]);
42
+ let qv = vec4<f32>(q[q0 + i], q[q0 + i + 1], q[q0 + i + 2], q[q0 + i + 3]);
43
+ let kv = vec4<f32>(k[k0 + i], k[k0 + i + 1], k[k0 + i + 2], k[k0 + i + 3]);
43
44
  sum = sum + dot(qv, kv);
44
45
  }
45
46
  let scaled = sum * uniforms.divisor;
@@ -49,17 +50,22 @@ class g {
49
50
  `;
50
51
  }
51
52
  }
52
- function q(o) {
53
- const { q: t, k: e } = o.inputs, { divisor: i, pastLen: r } = o.attrs, s = o.backend, a = t.shape[0], n = t.shape[2], u = e.shape[2], d = t.shape[1], h = t.shape[3], c = new g(a, d, n, u, h), p = [
54
- { type: "float32", data: [i] },
55
- { type: "int32", data: [r] },
53
+ function b(n) {
54
+ const { q: t, k: e } = n.inputs, { divisor: s, pastLen: o } = n.attrs, i = n.backend, r = t.shape[0], p = t.shape[2], a = e.shape[2], u = t.shape[1], h = t.shape[3];
55
+ if (m(e.shape, [r, u, a, h], "Error in AttentionMask: "), s === 0)
56
+ throw new Error("Divisor must be non-zero in AttentionMask");
57
+ if (o < 0)
58
+ throw new Error("pastLen must be non-negative in AttentionMask");
59
+ const c = new g(r, u, p, a, h), d = [
60
+ { type: "float32", data: [s] },
61
+ { type: "int32", data: [o] },
56
62
  { type: "float32", data: [Number.NEGATIVE_INFINITY] }
57
63
  ];
58
- return s.runWebGPUProgram(c, [t, e], "float32", p);
64
+ return i.runWebGPUProgram(c, [t, e], "float32", d);
59
65
  }
60
- const v = {
66
+ const q = {
61
67
  kernelName: "AttentionMask",
62
68
  backendName: "webgpu",
63
- kernelFunc: q
69
+ kernelFunc: b
64
70
  };
65
- f(v);
71
+ f(q);
@@ -1,6 +1,6 @@
1
- import { g as r } from "../../webgpu_program-WaoMq-WD.js";
2
- import { f as u, c as d } from "../../webgpu_util-DhSeP4b6.js";
3
- import { f as p } from "../../index-UdZhlibC.js";
1
+ import { g as u } from "../../webgpu_program-PFzf1hAQ.js";
2
+ import { f as h, c as p } from "../../webgpu_util-D____QpY.js";
3
+ import { f as c, a2 as r } from "../../index-BoWRt-10.js";
4
4
  class l {
5
5
  variableNames = ["labels", "logits", "values"];
6
6
  outputShape;
@@ -10,43 +10,30 @@ class l {
10
10
  workgroupSize = [64, 1, 1];
11
11
  size = !0;
12
12
  constructor(e) {
13
- this.outputShape = [e], this.dispatchLayout = u(this.outputShape), this.dispatch = d(this.dispatchLayout, this.outputShape, this.workgroupSize);
13
+ this.outputShape = [e], this.dispatchLayout = h(this.outputShape), this.dispatch = p(this.dispatchLayout, this.outputShape, this.workgroupSize);
14
14
  }
15
15
  getUserCode() {
16
16
  return `
17
- ${r("index")} {
17
+ ${u("index")} {
18
18
  if (index < uniforms.size) {
19
- let coords = getCoordsFromIndex(index);
20
- let idx = i32(getLabelsByOutputIndex(index));
21
- let val = getValuesByOutputIndex(index);
22
-
23
- if (isnan(val)) {
24
- setOutputAtIndex(index, 0.0);
25
- return;
26
- }
27
-
28
- if (idx < uniforms.logitsShape[1] && idx >= 0) {
29
- let logit = getLogits(coords, idx);
30
- if (isnan(logit)) {
31
- setOutputAtIndex(index, 0.0);
32
- return;
33
- }
34
- setOutputAtIndex(index, val - logit);
35
- } else {
36
- setOutputAtIndex(index, 0.0);
37
- }
19
+ let idx = i32(labels[index]);
20
+ let val = values[index];
21
+ let logit = logits[index * uniforms.logitsShape[1] + idx];
22
+ setOutputAtIndex(index, val - logit);
38
23
  }
39
24
  }
40
25
  `;
41
26
  }
42
27
  }
43
- function c(t) {
44
- const { logits: e, labels: i, values: s } = t.inputs, a = t.backend, n = i.shape[0], o = new l(n);
45
- return a.runWebGPUProgram(o, [i, e, s], "float32");
28
+ function d(t) {
29
+ const { logits: e, labels: a, values: s } = t.inputs, o = t.backend, i = a.shape[0];
30
+ r(s.shape, [i], "Error in EfficientGatherSub: "), r(a.shape, [i], "Error in EfficientGatherSub: ");
31
+ const n = new l(i);
32
+ return o.runWebGPUProgram(n, [a, e, s], "float32");
46
33
  }
47
- const h = {
34
+ const f = {
48
35
  kernelName: "EfficientGatherSub",
49
36
  backendName: "webgpu",
50
- kernelFunc: c
37
+ kernelFunc: d
51
38
  };
52
- p(h);
39
+ c(f);
@@ -1,6 +1,6 @@
1
- import { f as i } from "../../index-UdZhlibC.js";
2
- import { g as o } from "../../webgpu_program-WaoMq-WD.js";
3
- import { f as s, c as p } from "../../webgpu_util-DhSeP4b6.js";
1
+ import { f as i } from "../../index-BoWRt-10.js";
2
+ import { g as o } from "../../webgpu_program-PFzf1hAQ.js";
3
+ import { f as s, c as p } from "../../webgpu_util-D____QpY.js";
4
4
  const u = 0.7978845608028654, a = 0.044715;
5
5
  class c {
6
6
  outputShape;
@@ -1,5 +1,5 @@
1
- import { f as p } from "../../webgpu_util-DhSeP4b6.js";
2
- import { f as s } from "../../index-UdZhlibC.js";
1
+ import { f as n } from "../../webgpu_util-D____QpY.js";
2
+ import { f as p, a2 as h } from "../../index-BoWRt-10.js";
3
3
  import { createReduceInfo as u, reduce as c, createReductionShader as m } from "./utils/reductions.js";
4
4
  class d {
5
5
  outputShape;
@@ -12,7 +12,7 @@ class d {
12
12
  inputShape;
13
13
  size = !0;
14
14
  constructor(e) {
15
- this.inputShape = [e.batchSize, e.inSize], this.outputShape = this.inputShape, this.dispatchLayout = p(this.outputShape), this.dispatch = [e.batchSize, 1, 1];
15
+ this.inputShape = [e.batchSize, e.inSize], this.outputShape = this.inputShape, this.dispatchLayout = n(this.outputShape), this.dispatch = [e.batchSize, 1, 1];
16
16
  }
17
17
  getUserCode() {
18
18
  const e = this.workgroupSize[0];
@@ -29,13 +29,21 @@ class d {
29
29
  `);
30
30
  }
31
31
  }
32
- function S(t) {
33
- const { x: e, gamma: i } = t.inputs, n = t.backend, a = [e, i], o = u(a, -1), r = new d(o);
34
- return c(r, a, n);
32
+ function S(a) {
33
+ const { x: e, gamma: r } = a.inputs, o = a.backend, s = [e, r], t = u(s, -1), i = new d(t);
34
+ if (h(r.shape, [e.shape[e.shape.length - 1]], "Error in RMSNorm: "), e.shape.length !== 3)
35
+ throw new Error(`rmsNormGPU: input rank ${e.shape.length} not supported, only rank 3 is supported`);
36
+ if (t.inSize !== e.shape[2])
37
+ throw new Error(`rmsNormGPU: reduction size ${t.inSize} does not match expected size ${e.shape[2]}`);
38
+ if (t.batchSize !== e.shape[0] * e.shape[1])
39
+ throw new Error(
40
+ `rmsNormGPU: batch size ${t.batchSize} does not match expected size ${e.shape[0] * e.shape[1]}`
41
+ );
42
+ return c(i, s, o);
35
43
  }
36
- const h = {
44
+ const l = {
37
45
  kernelName: "RMSNorm",
38
46
  backendName: "webgpu",
39
47
  kernelFunc: S
40
48
  };
41
- s(h);
49
+ p(l);
@@ -1,10 +1,10 @@
1
- import { f as h, e as S } from "../../index-UdZhlibC.js";
2
- import { createReduceInfo as g } from "./utils/reductions.js";
3
- import { f as k } from "../../webgpu_util-DhSeP4b6.js";
4
- import { g as x } from "../../webgpu_program-WaoMq-WD.js";
5
- import { s as c } from "../../slice-BHbDHObE.js";
6
- import { s as z } from "../../sum-NLYbiDag.js";
7
- class w {
1
+ import { f, a2 as c, e as g } from "../../index-BoWRt-10.js";
2
+ import { createReduceInfo as k } from "./utils/reductions.js";
3
+ import { f as x } from "../../webgpu_util-D____QpY.js";
4
+ import { g as z } from "../../webgpu_program-PFzf1hAQ.js";
5
+ import { s as d } from "../../slice-BiOsknYS.js";
6
+ import { s as w } from "../../sum-66ew2byf.js";
7
+ class y {
8
8
  outputShape;
9
9
  shaderKey = "RMSNormGrad";
10
10
  dispatchLayout;
@@ -16,7 +16,7 @@ class w {
16
16
  size = !1;
17
17
  rowsPerWorkgroup;
18
18
  constructor(r, e = 4) {
19
- if (this.shaderKey = `RMSNormGrad_${e}`, this.rowsPerWorkgroup = e, this.inputShape = [r.batchSize, r.inSize], this.outputShape = [r.batchSize + r.batchSize / this.rowsPerWorkgroup, r.inSize], this.dispatchLayout = k(this.outputShape), this.dispatch = [r.batchSize / this.rowsPerWorkgroup, 1, 1], r.batchSize % this.rowsPerWorkgroup !== 0)
19
+ if (this.shaderKey = `RMSNormGrad_${e}`, this.rowsPerWorkgroup = e, this.inputShape = [r.batchSize, r.inSize], this.outputShape = [r.batchSize + r.batchSize / this.rowsPerWorkgroup, r.inSize], this.dispatchLayout = x(this.outputShape), this.dispatch = [r.batchSize / this.rowsPerWorkgroup, 1, 1], r.batchSize % this.rowsPerWorkgroup !== 0)
20
20
  throw new Error(
21
21
  `RMSNormGradProgram: batch size ${r.batchSize} must be divisible by rowsPerWorkgroup ${this.rowsPerWorkgroup}`
22
22
  );
@@ -35,7 +35,7 @@ class w {
35
35
  var<workgroup> accumulation: array<f32, 1024>;
36
36
  `}
37
37
 
38
- ${x("index")} {
38
+ ${z("index")} {
39
39
  // One workgroup per row (batch).
40
40
  let Length = uniforms.reduceSize;
41
41
  let BatchSize = uniforms.batchSize;
@@ -105,24 +105,29 @@ class w {
105
105
  `;
106
106
  }
107
107
  }
108
- function v(t) {
109
- const { dy: r, x: e, gamma: o } = t.inputs, i = 4, l = t.backend, a = g([e, o, r], -1), s = new w(a, i), d = [
108
+ function v(o) {
109
+ const { dy: r, x: e, gamma: t } = o.inputs, i = 4;
110
+ c(e.shape, r.shape, "Error in RMSNormGrad dy: "), c(t.shape, [e.shape[e.shape.length - 1]], "Error in RMSNormGrad gamma: ");
111
+ const l = o.backend, a = k([e, t, r], -1), s = new y(a, i), p = [
110
112
  { type: "int32", data: [s.inputShape[1]] },
111
113
  // Reduce size
112
114
  { type: "int32", data: [s.inputShape[0]] }
113
115
  // Batch size
114
- ], n = S().makeTensorFromTensorInfo(
115
- l.runWebGPUProgram(s, [e, o, r], "float32", d)
116
- ), u = c(n, [0, 0], [a.batchSize, a.inSize]), m = c(n, [a.batchSize, 0], [a.batchSize / i, a.inSize]);
116
+ ];
117
+ if (a.inSize > 1024)
118
+ throw new Error(`rmsNormGradGPU: inSize ${a.inSize} exceeds max of 1024`);
119
+ const n = g().makeTensorFromTensorInfo(
120
+ l.runWebGPUProgram(s, [e, t, r], "float32", p)
121
+ ), m = d(n, [0, 0], [a.batchSize, a.inSize]), u = d(n, [a.batchSize, 0], [a.batchSize / i, a.inSize]);
117
122
  n.dispose();
118
- const p = u.reshape(e.shape);
119
- u.dispose();
120
- const f = z(m, [0]);
121
- return m.dispose(), [p, f];
123
+ const h = m.reshape(e.shape);
124
+ m.dispose();
125
+ const S = w(u, [0]);
126
+ return u.dispose(), [h, S];
122
127
  }
123
- const y = {
128
+ const b = {
124
129
  kernelName: "RMSNormGrad",
125
130
  backendName: "webgpu",
126
131
  kernelFunc: v
127
132
  };
128
- h(y);
133
+ f(b);
@@ -1,7 +1,7 @@
1
- import { g as c } from "../../webgpu_program-WaoMq-WD.js";
2
- import { f as d, c as h } from "../../webgpu_util-DhSeP4b6.js";
3
- import { f as p } from "../../index-UdZhlibC.js";
4
- class m {
1
+ import { g as h } from "../../webgpu_program-PFzf1hAQ.js";
2
+ import { f as c, c as d } from "../../webgpu_util-D____QpY.js";
3
+ import { f as p, a2 as m } from "../../index-BoWRt-10.js";
4
+ class l {
5
5
  variableNames = ["x", "kernel"];
6
6
  outputShape;
7
7
  shaderKey = "QKV";
@@ -11,13 +11,13 @@ class m {
11
11
  workgroupSize = [64, 1, 1];
12
12
  size = !0;
13
13
  constructor(t, e, o, s) {
14
- const r = s / e;
15
- this.shaderKey = `QKV_${e}_${r}`, this.outputShape = [t, e, o, r], this.dispatchLayout = d(this.outputShape), this.dispatch = h(this.dispatchLayout, this.outputShape, this.workgroupSize);
14
+ const n = s / e;
15
+ this.shaderKey = `QKV_${e}_${n}`, this.outputShape = [t, e, o, n], this.dispatchLayout = c(this.outputShape), this.dispatch = d(this.dispatchLayout, this.outputShape, this.workgroupSize);
16
16
  }
17
17
  getUserCode() {
18
18
  const t = this.outputShape[1], e = this.outputShape[3], o = t * e;
19
19
  return `
20
- ${c("index")} {
20
+ ${h("index")} {
21
21
  if (index < uniforms.size) {
22
22
  let coords = getCoordsFromIndex(index); // [b, h, t, d]
23
23
  let b = coords[0];
@@ -26,13 +26,14 @@ class m {
26
26
  let d = coords[3];
27
27
 
28
28
  // Compute output channel index in fused kernel
29
- let out_offset = uniforms.mode * ${t} * ${e} + h * ${e} + d;
29
+ let out_offset = uniforms.mode * ${o} + h * ${e} + d;
30
30
 
31
31
  var sum = 0.0;
32
+ let baseX = b * uniforms.xShape[1] * uniforms.xShape[2] + t * uniforms.xShape[2];
32
33
  for (var c = 0; c < ${o}; c += 1) {
33
- let xval = getX(b, t, c); // fetch from x
34
- let kval = getKernel(c, out_offset); // fetch from kernel
35
- sum += xval * kval;
34
+ let xval = x[baseX + c];
35
+ let kval = getKernel(c, out_offset);
36
+ sum = fma(xval, kval, sum);
36
37
  }
37
38
 
38
39
  setOutputAtIndex(index, sum);
@@ -41,17 +42,20 @@ class m {
41
42
  `;
42
43
  }
43
44
  }
44
- function l(a) {
45
- const { x: t, kernel: e } = a.inputs, { heads: o } = a.attrs, s = a.backend, r = t.shape[0], i = t.shape[1], u = t.shape[2], n = new m(r, o, i, u);
45
+ function f(r) {
46
+ const { x: t, kernel: e } = r.inputs, { heads: o } = r.attrs, s = r.backend, n = t.shape[0], u = t.shape[1], a = t.shape[2];
47
+ if (m(e.shape, [a, 3 * a], "Error in QKV: "), a % o !== 0)
48
+ throw new Error(`Channel dimension ${a} must be divisible by number of heads ${o} in QKV.`);
49
+ const i = new l(n, o, u, a);
46
50
  return [
47
- s.runWebGPUProgram(n, [t, e], "float32", [{ type: "int32", data: [0] }]),
48
- s.runWebGPUProgram(n, [t, e], "float32", [{ type: "int32", data: [1] }]),
49
- s.runWebGPUProgram(n, [t, e], "float32", [{ type: "int32", data: [2] }])
51
+ s.runWebGPUProgram(i, [t, e], "float32", [{ type: "int32", data: [0] }]),
52
+ s.runWebGPUProgram(i, [t, e], "float32", [{ type: "int32", data: [1] }]),
53
+ s.runWebGPUProgram(i, [t, e], "float32", [{ type: "int32", data: [2] }])
50
54
  ];
51
55
  }
52
- const f = {
56
+ const b = {
53
57
  kernelName: "QKV",
54
58
  backendName: "webgpu",
55
- kernelFunc: l
59
+ kernelFunc: f
56
60
  };
57
- p(f);
61
+ p(b);
@@ -1,7 +1,7 @@
1
- import { g as h } from "../../webgpu_program-WaoMq-WD.js";
2
- import { f as l, c as m } from "../../webgpu_util-DhSeP4b6.js";
3
- import { f as g } from "../../index-UdZhlibC.js";
4
- class f {
1
+ import { g as c } from "../../webgpu_program-PFzf1hAQ.js";
2
+ import { f as m, c as l } from "../../webgpu_util-D____QpY.js";
3
+ import { f as x, a2 as f } from "../../index-BoWRt-10.js";
4
+ class S {
5
5
  variableNames = ["x", "sin", "cos"];
6
6
  outputShape;
7
7
  shaderKey = "Rope";
@@ -10,13 +10,13 @@ class f {
10
10
  workgroupSize = [64, 1, 1];
11
11
  size = !0;
12
12
  uniforms = "pastLen: i32";
13
- constructor(t, s, n, o) {
14
- this.shaderKey = `Rope_${o}`, this.outputShape = [t, s, n, o], this.dispatchLayout = l(this.outputShape), this.dispatch = m(this.dispatchLayout, this.outputShape, this.workgroupSize);
13
+ constructor(t, e, a, s) {
14
+ this.shaderKey = `Rope_${s}`, this.outputShape = [t, e, a, s], this.dispatchLayout = m(this.outputShape), this.dispatch = l(this.dispatchLayout, this.outputShape, this.workgroupSize);
15
15
  }
16
16
  getUserCode() {
17
17
  const t = this.outputShape[3];
18
18
  return `
19
- ${h("index")} {
19
+ ${c("index")} {
20
20
  if (index < uniforms.size) {
21
21
  let coords = getCoordsFromIndex(index); // [b, h, t, d]
22
22
  let b = coords[0];
@@ -28,27 +28,31 @@ class f {
28
28
 
29
29
  var outVal = 0.0;
30
30
 
31
+ let xIdx = b * uniforms.outShapeStrides[0] +
32
+ h * uniforms.outShapeStrides[1] +
33
+ t * uniforms.outShapeStrides[2] +
34
+ d;
35
+
31
36
  if (d < rotaryDim) {
32
- let pairIdx = d / 2;
33
- let cos = getCos(t + uniforms.pastLen, pairIdx, 0);
34
- let sin = getSin(t + uniforms.pastLen, pairIdx, 0);
37
+ let idx = (t + uniforms.pastLen) * uniforms.cosShape[1] + d / 2;
38
+ let cos = cos[idx];
39
+ let sin = sin[idx];
35
40
 
36
- let ownX = getX(b, h, t, d) * cos;
41
+ let ownX = x[xIdx] * cos;
42
+ var evenOdd = 0.0;
37
43
 
38
44
  if (d % 2 == 0) {
39
45
  // even index
40
- let even = ownX;
41
- let odd = getX(b, h, t, d + 1);
42
- outVal = even - odd * sin;
46
+ evenOdd = -x[xIdx + 1];
43
47
  } else {
44
48
  // odd index
45
- let even = getX(b, h, t, d - 1);
46
- let odd = ownX;
47
- outVal = even * sin + odd;
49
+ evenOdd = x[xIdx - 1];
48
50
  }
51
+
52
+ outVal = fma(evenOdd, sin, ownX);
49
53
  } else {
50
54
  // pass through for non-rotary dims
51
- outVal = getX(b, h, t, d);
55
+ outVal = x[xIdx];
52
56
  }
53
57
 
54
58
  setOutputAtIndex(index, outVal);
@@ -57,13 +61,22 @@ class f {
57
61
  `;
58
62
  }
59
63
  }
60
- function b(e) {
61
- const { x: t, sin: s, cos: n } = e.inputs, { pastLen: o } = e.attrs, a = e.backend, r = t.shape[0], i = t.shape[1], d = t.shape[2], p = t.shape[3], u = new f(r, i, d, p), c = [{ type: "int32", data: [o] }];
62
- return a.runWebGPUProgram(u, [t, s, n], "float32", c);
64
+ function g(o) {
65
+ const { x: t, sin: e, cos: a } = o.inputs, { pastLen: s } = o.attrs, i = o.backend, p = t.shape[0], d = t.shape[1], n = t.shape[2], r = t.shape[3];
66
+ if (f(e.shape, a.shape, "Error in Rope: "), e.shape[0] < n + s)
67
+ throw new Error(
68
+ `Sin tensor shape ${e.shape} is not compatible with seqLength ${n} and pastLen ${s}.`
69
+ );
70
+ if (e.shape[1] * 2 < r)
71
+ throw new Error(`Sin tensor shape ${e.shape} is not compatible with feature dimension ${r}.`);
72
+ if (e.shape.length !== 3)
73
+ throw new Error(`Sin tensor must be 3-dimensional, but got shape ${e.shape}.`);
74
+ const h = new S(p, d, n, r), u = [{ type: "int32", data: [s] }];
75
+ return i.runWebGPUProgram(h, [t, e, a], "float32", u);
63
76
  }
64
- const x = {
77
+ const b = {
65
78
  kernelName: "Rope",
66
79
  backendName: "webgpu",
67
- kernelFunc: b
80
+ kernelFunc: g
68
81
  };
69
- g(x);
82
+ x(b);
@@ -1,7 +1,7 @@
1
- import { g as c } from "../../webgpu_program-WaoMq-WD.js";
2
- import { f as p, c as u } from "../../webgpu_util-DhSeP4b6.js";
3
- import { f as d } from "../../index-UdZhlibC.js";
4
- class h {
1
+ import { g as p } from "../../webgpu_program-PFzf1hAQ.js";
2
+ import { f as u, c as d } from "../../webgpu_util-D____QpY.js";
3
+ import { f as h, a2 as o } from "../../index-BoWRt-10.js";
4
+ class b {
5
5
  variableNames = ["labels", "softmaxProbs", "dy"];
6
6
  outputShape;
7
7
  shaderKey = "ScatterSub";
@@ -10,29 +10,31 @@ class h {
10
10
  workgroupSize = [64, 1, 1];
11
11
  size = !0;
12
12
  constructor(t, e) {
13
- this.outputShape = [t, e], this.dispatchLayout = p(this.outputShape), this.dispatch = u(this.dispatchLayout, this.outputShape, this.workgroupSize);
13
+ this.outputShape = [t, e], this.dispatchLayout = u(this.outputShape), this.dispatch = d(this.dispatchLayout, this.outputShape, this.workgroupSize);
14
14
  }
15
15
  getUserCode() {
16
16
  return `
17
- ${c("index")} {
17
+ ${p("index")} {
18
18
  if (index < uniforms.size) {
19
19
  let coords = getCoordsFromIndex(index); // [batch, depth]
20
- let idx = i32(getLabels(coords[0]));
21
- let prob = getSoftmaxProbsByOutputIndex(index);
22
- let dy = getDy(coords[0]);
20
+ let idx = i32(labels[coords[0]]);
21
+ let prob = softmaxProbs[index];
22
+ let dy = dy[coords[0]];
23
23
  setOutputAtIndex(index, select(prob, prob - 1.0, idx == coords[1]) * dy);
24
24
  }
25
25
  }
26
26
  `;
27
27
  }
28
28
  }
29
- function b(o) {
30
- const { logits: t, labels: e, dy: s } = o.inputs, r = o.backend, a = e.shape[0], i = t.shape[1], n = new h(a, i);
31
- return r.runWebGPUProgram(n, [e, t, s], "float32");
29
+ function f(a) {
30
+ const { logits: t, labels: e, dy: s } = a.inputs, c = a.backend, r = e.shape[0], i = t.shape[1];
31
+ o(s.shape, [r], "Error in EfficientScatterSub dy: "), o(t.shape, [r, i], "Error in EfficientScatterSub logits: "), o(e.shape, [r], "Error in EfficientScatterSub labels: ");
32
+ const n = new b(r, i);
33
+ return c.runWebGPUProgram(n, [e, t, s], "float32");
32
34
  }
33
35
  const l = {
34
36
  kernelName: "EfficientScatterSub",
35
37
  backendName: "webgpu",
36
- kernelFunc: b
38
+ kernelFunc: f
37
39
  };
38
- d(l);
40
+ h(l);
@@ -1,7 +1,7 @@
1
- import { p as l, j as d } from "../../../index-UdZhlibC.js";
2
- import { g as p } from "../../../webgpu_program-WaoMq-WD.js";
3
- import { r as f } from "../../../Reshape-Do18N3gO.js";
4
- import { c as x } from "../../../axis_util-5DTW2tFV.js";
1
+ import { p as l, j as d } from "../../../index-BoWRt-10.js";
2
+ import { g as p } from "../../../webgpu_program-PFzf1hAQ.js";
3
+ import { r as f } from "../../../Reshape-DvudQDvJ.js";
4
+ import { c as x } from "../../../axis_util-BzbKo31C.js";
5
5
  function I(e, r, t, s, u) {
6
6
  return `
7
7
  fn DIV_CEIL(a : u32, b : u32) -> u32 {
@@ -1,19 +1,19 @@
1
- import { B as m, C as u, l, E as f, aP as gn, k as S, aQ as $n, aR as kn, aS as yn, p as En, aT as w, q as rn, x as _n, b as pn, aU as In, aV as Nn, N as An, al as Tn, I as v, aW as xn, aX as wn, aY as Sn, aZ as Mn, a_ as zn, a$ as qn, b0 as Bn, X as K, b1 as Gn, b2 as Kn, b3 as Rn, aG as Dn, $ as vn, Z as Vn, _ as Pn, b4 as jn, t as Fn, b5 as L, b6 as Wn, b7 as Yn, b8 as On, b9 as Cn, ba as Ln, bb as Xn, bc as Zn, bd as Jn, a as $, o as U, n as q, h as Qn, c as A, be as Hn, M as X, d as Un } from "./index-UdZhlibC.js";
1
+ import { B as m, C as u, l, E as f, aP as gn, k as S, aQ as $n, aR as kn, aS as yn, p as En, aT as w, q as rn, x as _n, b as pn, aU as In, aV as Nn, N as An, al as Tn, I as v, aW as xn, aX as wn, aY as Sn, aZ as Mn, a_ as zn, a$ as qn, b0 as Bn, X as K, b1 as Gn, b2 as Kn, b3 as Rn, aG as Dn, $ as vn, Z as Vn, _ as Pn, b4 as jn, t as Fn, b5 as L, b6 as Wn, b7 as Yn, b8 as On, b9 as Cn, ba as Ln, bb as Xn, bc as Zn, bd as Jn, a as $, o as U, n as q, h as Qn, c as A, be as Hn, M as X, d as Un } from "./index-BoWRt-10.js";
2
2
  import { n as ne, a as ee, b as se } from "./non_max_suppression_impl-CsEgBuMA.js";
3
- import { r as k } from "./reshape-BR0eoLYN.js";
4
- import { s as mn } from "./split-CRU0PjVV.js";
5
- import { s as E } from "./sum-NLYbiDag.js";
6
- import { b as Z } from "./broadcast_to-Ba9h_8DO.js";
7
- import { s as _ } from "./slice-BHbDHObE.js";
8
- import { r as W } from "./range-D9CZhVlR.js";
9
- import { t as te } from "./tensor-Do9PKbIE.js";
10
- import { s as Y } from "./stack-ikk2Y8_P.js";
11
- import { c as re, z as ae } from "./zeros-DnPT2nD4.js";
12
- import { e as oe } from "./axis_util-5DTW2tFV.js";
13
- import { m as J } from "./max-ByjEGoFx.js";
14
- import { c as Q } from "./concat-CbXTetof.js";
15
- import { m as N } from "./mat_mul-dwmZz69e.js";
16
- import { t as H } from "./tensor2d-CWHxHpLh.js";
3
+ import { r as k } from "./reshape-CdBq1WJ6.js";
4
+ import { s as mn } from "./split-B-dikLRw.js";
5
+ import { s as E } from "./sum-66ew2byf.js";
6
+ import { b as Z } from "./broadcast_to-CdbwV-Dj.js";
7
+ import { s as _ } from "./slice-BiOsknYS.js";
8
+ import { r as W } from "./range-CRuAh-gd.js";
9
+ import { t as te } from "./tensor-JwS7ZYY6.js";
10
+ import { s as Y } from "./stack-B17UN2nn.js";
11
+ import { c as re, z as ae } from "./zeros--BdLQ3oG.js";
12
+ import { e as oe } from "./axis_util-BzbKo31C.js";
13
+ import { m as J } from "./max-Ddnnb5xe.js";
14
+ import { c as Q } from "./concat-CsxrgovM.js";
15
+ import { m as N } from "./mat_mul-8m8pfdcx.js";
16
+ import { t as H } from "./tensor2d-wxPAnDQy.js";
17
17
  /**
18
18
  * @license
19
19
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,25 +1,25 @@
1
- import { B as T, C as I, E as O, bE as Oa, bF as Ma, bG as Ci, l as b, bH as Ii, X as L, bI as Di, bJ as $i, bK as Ti, bL as zi, h as Ei, bM as Li, bN as Fi, bO as Oi, bP as Mi, bQ as _a, bR as _i, bS as Ra, bT as Ri, bU as Ba, bV as Bi, I as Ge, k as kt, bq as Wa, bW as Wi, bX as Gi, bY as Pi, y as Pe, c as V, a as w, bZ as Ga, b_ as Ui, b$ as Vi, c0 as ji, p as ce, aU as pt, bv as Pa, c1 as Ki, c2 as Hi, c3 as qi, c4 as Ji, c5 as Zi, bx as Xi, c6 as Yi, c7 as Qi, F as Ua, al as Va, aq as ja, c8 as tr, c9 as Ka, o as z, ca as Ps, cb as Ha, cc as qa, j as pn, cd as Us, ce as Ja, cf as Za, cg as Xa, ch as Ya, ci as Qa, cj as tl, ck as el, bf as nl, cl as sl, q as he, b as et, n as U, cm as il, bm as rl, aw as ht, cn as ol, z as Q, co as al, cp as ll, cq as ul, cr as cl, cs as hl, ct as pl, cu as dl, cv as fl, J as ml, cw as gl, bj as bl, bp as yl, cx as wl, Q as kl, cy as xl, a8 as Nl, cz as vl, cA as Al, cB as Sl, as as Cl, cC as Il, ae as Dl, aV as $l, br as Tl, ak as zl, bs as El, G as Ll, aX as Fl, am as Ol, cD as Ml, cE as _l, cF as Rl, an as Bl, af as Wl, cG as Gl, cH as Pl, cI as Ul, U as Vl, bt as jl, cJ as Kl, cK as Hl, aS as ql, b1 as Jl, cL as Zl, cM as Xl, bu as Yl, a$ as Ql, P as tu, cN as eu, x as rs, ap as nu, bw as su, az as iu, V as ru, au as ou, at as au, K as lu, bc as uu, cO as cu, bd as hu, cP as pu, b3 as du, aQ as fu, ar as mu, cQ as gu, a9 as bu, W as yu, S as wu, L as ku, bz as xu, cR as Nu, bA as vu, av as Au, bC as Su, Y as Cu, cS as Iu, N as Du, b5 as $u, b4 as Tu, cT as Oe, cU as zu, i as Eu, aj as Vs, cV as Lu, t as x, aT as $e, cW as S, cX as He, cY as qe, ab as Vt, d as J, ac as Fu, cZ as js, w as Jt, M as Ou, T as Te, O as Mu, c_ as _u, m as Ks, c$ as Ru, d0 as Hs, d1 as Bu } from "./index-UdZhlibC.js";
2
- import { k as ke, c as Nt, o as ze, s as er, b as nr, d as Wu, m as sr, t as In, l as ir, v as os, a as Gu, S as Pu, p as Uu, w as as, x as rr, y as Je, z as Vu, A as ju } from "./selu_util-Ce6pu9IM.js";
3
- import { n as wt, w as ne, a as Ze, g as Xe, b as ls, t as K, c as Ce, d as Xt, e as Ku, u as dn, f as ye, h as fn, i as Hu, l as qu, s as us, m as or, j as qt, k as Ju } from "./ops-aRTXR2Sr.js";
4
- import { r as N } from "./reshape-BR0eoLYN.js";
5
- import { s as W } from "./sum-NLYbiDag.js";
6
- import { m as ct } from "./mat_mul-dwmZz69e.js";
7
- import { s as Qt } from "./split-CRU0PjVV.js";
8
- import { s as Zu, c as ar } from "./sin-CiBxrDqX.js";
9
- import { e as Hn, g as lr, h as cs, c as Xu } from "./axis_util-5DTW2tFV.js";
10
- import { a as se, e as ie, l as Yu } from "./log_sum_exp-BnmCkHWl.js";
11
- import { s as Dn } from "./stack-ikk2Y8_P.js";
12
- import { o as xe } from "./ones-C8Mfln6-.js";
13
- import { s as Dt } from "./slice-BHbDHObE.js";
14
- import { M as Qu, f as ur, r as tc, d as ec, a as $n } from "./dropout-DPfPgWWe.js";
15
- import { z as vt } from "./zeros-DnPT2nD4.js";
16
- import { c as pe } from "./concat-CbXTetof.js";
17
- import { g as cr } from "./gather-Bbh8DHhM.js";
18
- import { s as hr } from "./softmax-JMEIUo2J.js";
19
- import { m as Ee } from "./max-ByjEGoFx.js";
20
- import { t as nc } from "./tensor-Do9PKbIE.js";
21
- import { r as sc } from "./range-D9CZhVlR.js";
22
- import { v as ic } from "./variable-BTBkayv_.js";
1
+ import { B as T, C as I, E as O, bE as Oa, bF as Ma, bG as Ci, l as b, bH as Ii, X as L, bI as Di, bJ as $i, bK as Ti, bL as zi, h as Ei, bM as Li, bN as Fi, bO as Oi, bP as Mi, bQ as _a, bR as _i, bS as Ra, bT as Ri, bU as Ba, bV as Bi, I as Ge, k as kt, bq as Wa, bW as Wi, bX as Gi, bY as Pi, y as Pe, c as V, a as w, bZ as Ga, b_ as Ui, b$ as Vi, c0 as ji, p as ce, aU as pt, bv as Pa, c1 as Ki, c2 as Hi, c3 as qi, c4 as Ji, c5 as Zi, bx as Xi, c6 as Yi, c7 as Qi, F as Ua, al as Va, aq as ja, c8 as tr, c9 as Ka, o as z, ca as Ps, cb as Ha, cc as qa, j as pn, cd as Us, ce as Ja, cf as Za, cg as Xa, ch as Ya, ci as Qa, cj as tl, ck as el, bf as nl, cl as sl, q as he, b as et, n as U, cm as il, bm as rl, aw as ht, cn as ol, z as Q, co as al, cp as ll, cq as ul, cr as cl, cs as hl, ct as pl, cu as dl, cv as fl, J as ml, cw as gl, bj as bl, bp as yl, cx as wl, Q as kl, cy as xl, a8 as Nl, cz as vl, cA as Al, cB as Sl, as as Cl, cC as Il, ae as Dl, aV as $l, br as Tl, ak as zl, bs as El, G as Ll, aX as Fl, am as Ol, cD as Ml, cE as _l, cF as Rl, an as Bl, af as Wl, cG as Gl, cH as Pl, cI as Ul, U as Vl, bt as jl, cJ as Kl, cK as Hl, aS as ql, b1 as Jl, cL as Zl, cM as Xl, bu as Yl, a$ as Ql, P as tu, cN as eu, x as rs, ap as nu, bw as su, az as iu, V as ru, au as ou, at as au, K as lu, bc as uu, cO as cu, bd as hu, cP as pu, b3 as du, aQ as fu, ar as mu, cQ as gu, a9 as bu, W as yu, S as wu, L as ku, bz as xu, cR as Nu, bA as vu, av as Au, bC as Su, Y as Cu, cS as Iu, N as Du, b5 as $u, b4 as Tu, cT as Oe, cU as zu, i as Eu, aj as Vs, cV as Lu, t as x, aT as $e, cW as S, cX as He, cY as qe, ab as Vt, d as J, ac as Fu, cZ as js, w as Jt, M as Ou, T as Te, O as Mu, c_ as _u, m as Ks, c$ as Ru, d0 as Hs, d1 as Bu } from "./index-BoWRt-10.js";
2
+ import { k as ke, c as Nt, o as ze, s as er, b as nr, d as Wu, m as sr, t as In, l as ir, v as os, a as Gu, S as Pu, p as Uu, w as as, x as rr, y as Je, z as Vu, A as ju } from "./selu_util-BJEXVvjX.js";
3
+ import { n as wt, w as ne, a as Ze, g as Xe, b as ls, t as K, c as Ce, d as Xt, e as Ku, u as dn, f as ye, h as fn, i as Hu, l as qu, s as us, m as or, j as qt, k as Ju } from "./ops-BFGCx8Ri.js";
4
+ import { r as N } from "./reshape-CdBq1WJ6.js";
5
+ import { s as W } from "./sum-66ew2byf.js";
6
+ import { m as ct } from "./mat_mul-8m8pfdcx.js";
7
+ import { s as Qt } from "./split-B-dikLRw.js";
8
+ import { s as Zu, c as ar } from "./sin-BeA3tsEd.js";
9
+ import { e as Hn, g as lr, h as cs, c as Xu } from "./axis_util-BzbKo31C.js";
10
+ import { a as se, e as ie, l as Yu } from "./log_sum_exp-DbjkV734.js";
11
+ import { s as Dn } from "./stack-B17UN2nn.js";
12
+ import { o as xe } from "./ones-Dj0SDhHf.js";
13
+ import { s as Dt } from "./slice-BiOsknYS.js";
14
+ import { M as Qu, f as ur, r as tc, d as ec, a as $n } from "./dropout-DYs5QFGQ.js";
15
+ import { z as vt } from "./zeros--BdLQ3oG.js";
16
+ import { c as pe } from "./concat-CsxrgovM.js";
17
+ import { g as cr } from "./gather-CMMy2KEG.js";
18
+ import { s as hr } from "./softmax-Bv_6lyMX.js";
19
+ import { m as Ee } from "./max-Ddnnb5xe.js";
20
+ import { t as nc } from "./tensor-JwS7ZYY6.js";
21
+ import { r as sc } from "./range-CRuAh-gd.js";
22
+ import { v as ic } from "./variable-BuddVFLa.js";
23
23
  /**
24
24
  * @license
25
25
  * Copyright 2020 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { E as e, R as f } from "./index-UdZhlibC.js";
1
+ import { E as e, R as f } from "./index-BoWRt-10.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.
@@ -1,4 +1,4 @@
1
- import { B as c, C as n, E as e, V as s } from "./index-UdZhlibC.js";
1
+ import { B as c, C as n, E as e, V as s } from "./index-BoWRt-10.js";
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2018 Google LLC. All Rights Reserved.