@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.
- package/dist/Generator.js +5 -5
- package/dist/NanoGPTModel.d.ts +2 -0
- package/dist/NanoGPTModel.js +8 -8
- package/dist/{Reshape-Bt_t7RNz.js → Reshape-Biok_3X1.js} +6 -6
- package/dist/TeachableLLM.d.ts +6 -0
- package/dist/TeachableLLM.js +6 -2
- package/dist/{TiedEmbedding-DORsPlNL.js → TiedEmbedding-8S8xn8e6.js} +5 -5
- package/dist/Trainer.d.ts +1 -0
- package/dist/Trainer.js +8 -7
- package/dist/{axis_util-CVbf1vmL.js → axis_util-BczFISHz.js} +1 -1
- package/dist/{broadcast_to-BBoMQXbL.js → broadcast_to-B7NGsBSh.js} +2 -2
- package/dist/{concat-BRRtq4S2.js → concat-DdKPyAtw.js} +1 -1
- package/dist/{dataset-ZHEPJmED.js → dataset-iqT4Otvb.js} +7 -7
- package/dist/{dropout-lQm_YyX3.js → dropout-B09InSJS.js} +1 -1
- package/dist/{gather-BWyutxwi.js → gather-D6MsdXqc.js} +1 -1
- package/dist/{gpgpu_math-Df7gzJWH.js → gpgpu_math-BFbOyvk4.js} +1 -1
- package/dist/{index-CnHyhpKc.js → index-Du-bmOP8.js} +98 -98
- package/dist/{kernel_funcs_utils-Dqo82NH4.js → kernel_funcs_utils-DShm7-0k.js} +33 -33
- package/dist/layers/BaseLayer.js +2 -2
- package/dist/layers/CausalSelfAttention.js +6 -6
- package/dist/layers/MLP.js +5 -5
- package/dist/layers/RMSNorm.js +3 -3
- package/dist/layers/RoPECache.js +3 -3
- package/dist/layers/TiedEmbedding.js +6 -6
- package/dist/layers/TransformerBlock.js +1 -1
- package/dist/{log_sum_exp-CRH7Np9v.js → log_sum_exp-CxfBtUaG.js} +5 -5
- package/dist/main.js +1 -1
- package/dist/{mat_mul-DeGU1U_C.js → mat_mul-CbiqIe2d.js} +1 -1
- package/dist/{max-CcnEArWK.js → max-0Xnlpv8k.js} +1 -1
- package/dist/{norm-BpWsOapl.js → norm-01kY9I2B.js} +5 -5
- package/dist/{ones-CDWGzVnm.js → ones-CrutWGas.js} +2 -2
- package/dist/ops/appendCache.js +3 -3
- package/dist/ops/attentionMask.js +1 -1
- package/dist/ops/cpu/appendCache.js +2 -2
- package/dist/ops/cpu/attentionMask.js +5 -5
- package/dist/ops/cpu/fusedSoftmax.js +2 -2
- package/dist/ops/cpu/gatherSub.js +3 -3
- package/dist/ops/cpu/gelu.js +1 -1
- package/dist/ops/cpu/matMulGelu.js +1 -1
- package/dist/ops/cpu/matMulMul.js +1 -1
- package/dist/ops/cpu/mulDropout.js +1 -1
- package/dist/ops/cpu/normRMS.js +1 -1
- package/dist/ops/cpu/qkv.js +3 -3
- package/dist/ops/cpu/rope.js +5 -5
- package/dist/ops/cpu/scatterSub.js +4 -4
- package/dist/ops/fusedSoftmax.js +1 -1
- package/dist/ops/gatherSub.js +1 -1
- package/dist/ops/gelu.js +1 -1
- package/dist/ops/grads/attentionMask.js +1 -1
- package/dist/ops/grads/fusedSoftmax.js +2 -2
- package/dist/ops/grads/gelu.js +1 -1
- package/dist/ops/grads/matMulGelu.js +1 -1
- package/dist/ops/grads/normRMS.js +1 -1
- package/dist/ops/grads/qkv.js +1 -1
- package/dist/ops/grads/rope.js +1 -1
- package/dist/ops/matMulGelu.js +1 -1
- package/dist/ops/matMulMul.js +1 -1
- package/dist/ops/mulDrop.js +1 -1
- package/dist/ops/node/sparseCrossEntropy.js +1 -1
- package/dist/ops/normRMS.js +1 -1
- package/dist/ops/qkv.js +1 -1
- package/dist/ops/scatterSub.js +1 -1
- package/dist/ops/webgl/appendCache.js +1 -1
- package/dist/ops/webgl/attentionMask.js +1 -1
- package/dist/ops/webgl/fusedSoftmax.js +96 -96
- package/dist/ops/webgl/gatherSub.js +1 -1
- package/dist/ops/webgl/gelu.js +2 -2
- package/dist/ops/webgl/matMulGelu.js +4 -4
- package/dist/ops/webgl/matMulMul.js +1 -1
- package/dist/ops/webgl/mulDropout.js +1 -1
- package/dist/ops/webgl/normRMS.js +2 -2
- package/dist/ops/webgl/qkv.js +1 -1
- package/dist/ops/webgl/rope.js +1 -1
- package/dist/ops/webgl/scatterSub.js +1 -1
- package/dist/{ops-DzQTmLIl.js → ops-CJNniCAV.js} +13 -13
- package/dist/{random_width-DI2h9CMs.js → random_width-C-v-35bY.js} +1324 -1279
- package/dist/{range-CkOJ7090.js → range-Bvs1hidm.js} +1 -1
- package/dist/{reshape-CTIbqjwm.js → reshape-BH7eBpwq.js} +1 -1
- package/dist/{sin-HzioENy_.js → sin-CPAZXNjH.js} +1 -1
- package/dist/{slice_util-n4wHKmex.js → slice_util-DskXqRZa.js} +1 -1
- package/dist/{softmax-DX6qXAbm.js → softmax-DhWoBa7r.js} +1 -1
- package/dist/{split-CVwhL8Oe.js → split-BCUhuU7B.js} +1 -1
- package/dist/{stack-S2-D2JAQ.js → stack-BV1v7l3S.js} +1 -1
- package/dist/{sum-UdfvaNhB.js → sum-Cvq06317.js} +1 -1
- package/dist/{tensor-IZex6Bwp.js → tensor-DgTOPY6h.js} +1 -1
- package/dist/{tensor2d-CqtBzOKq.js → tensor2d-CRWjDyUe.js} +1 -1
- package/dist/{tfjs_backend-DX9yVvwk.js → tfjs_backend-D9Ytje0G.js} +39 -39
- package/dist/training/AdamExt.js +1 -1
- package/dist/training/DatasetBuilder.js +2 -2
- package/dist/training/FullTrainer.js +36 -32
- package/dist/training/Trainer.d.ts +7 -4
- package/dist/training/Trainer.js +58 -50
- package/dist/training/sparseCrossEntropy.js +4 -4
- package/dist/utilities/dummy.js +2 -2
- package/dist/utilities/generate.js +3 -3
- package/dist/utilities/load.js +1 -1
- package/dist/utilities/profile.d.ts +1 -0
- package/dist/utilities/profile.js +6 -3
- package/dist/utilities/weights.js +2 -2
- package/dist/{variable-BGvK-VN3.js → variable-DZ3fF0R2.js} +1 -1
- package/dist/{zeros-CYMicyqz.js → zeros-BaHhQTWf.js} +1 -1
- package/package.json +1 -1
- package/dist/moments-DLTE6-1p.js +0 -53
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as g } from "./gpgpu_math-
|
|
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((
|
|
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,
|
|
100
|
-
this.variableNames = ["A", "B"], this.outputShape = w(
|
|
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,
|
|
131
|
-
this.variableNames = ["A", "B"], this.supportsBroadcasting = !0, this.packedInputs = !0, this.packedOutput = !0, this.outputShape = w(
|
|
132
|
-
const
|
|
133
|
-
this.enableShapeUniforms = g(
|
|
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 (
|
|
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(
|
|
144
|
-
`,
|
|
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",
|
|
155
|
+
const s = z("coords", o);
|
|
156
156
|
this.enableShapeUniforms ? n += `
|
|
157
157
|
bool nextRowOutOfBounds =
|
|
158
|
-
(${s[
|
|
158
|
+
(${s[o - 2]} + 1) >= outShape[${o} - 2];
|
|
159
159
|
bool nextColOutOfBounds =
|
|
160
|
-
(${s[
|
|
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[
|
|
166
|
+
(${s[o - 2]} + 1) >= ${this.outputShape[o - 2]};
|
|
167
167
|
bool nextColOutOfBounds =
|
|
168
|
-
(${s[
|
|
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:
|
|
209
|
-
return
|
|
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:
|
|
229
|
-
return n.complexTensorInfos = { real: l, imag: s },
|
|
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,
|
|
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
|
-
${
|
|
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,
|
|
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
|
-
${
|
|
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:
|
|
313
|
-
return ({ inputs: d, backend:
|
|
314
|
-
const { x: n } = d, l =
|
|
315
|
-
if (l.shouldExecuteOnCPU([n]) &&
|
|
316
|
-
const c = l.texData.get(n.dataId), x =
|
|
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:
|
|
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 =
|
|
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,
|
|
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 {
|
package/dist/layers/BaseLayer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as g, c as p, e as o, i as v } from "../index-
|
|
2
|
-
import { v as _ } from "../variable-
|
|
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-
|
|
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-
|
|
9
|
-
import { v as b } from "../variable-
|
|
10
|
-
import { r as k, d as L } from "../dropout-
|
|
11
|
-
import { r as N } from "../reshape-
|
|
12
|
-
import { m as R } from "../mat_mul-
|
|
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;
|
package/dist/layers/MLP.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as l } from "../index-
|
|
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-
|
|
5
|
-
import { r as h, d as f } from "../dropout-
|
|
6
|
-
import { r as d } from "../reshape-
|
|
7
|
-
import { m as c } from "../mat_mul-
|
|
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;
|
package/dist/layers/RMSNorm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as s } from "../index-
|
|
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-
|
|
5
|
-
import { o as m } from "../ones-
|
|
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) {
|
package/dist/layers/RoPECache.js
CHANGED
|
@@ -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-
|
|
2
|
-
import { c as d, s as C } from "../sin-
|
|
3
|
-
import { r as h } from "../range-
|
|
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-
|
|
2
|
-
import "../index-
|
|
3
|
-
import { T as f } from "../TiedEmbedding-
|
|
4
|
-
import "../tfjs_backend-
|
|
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-
|
|
7
|
-
import "../gather-
|
|
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-
|
|
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,
|
|
2
|
-
import { e as K } from "./axis_util-
|
|
3
|
-
import { m as T } from "./max-
|
|
4
|
-
import { r as m } from "./reshape-
|
|
5
|
-
import { s as _ } from "./sum-
|
|
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-
|
|
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,8 +1,8 @@
|
|
|
1
|
-
import { o as l, j as c, E as y,
|
|
2
|
-
import { e as $ } from "./axis_util-
|
|
3
|
-
import { m as f } from "./max-
|
|
4
|
-
import { r as h } from "./reshape-
|
|
5
|
-
import { s as t } from "./sum-
|
|
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-
|
|
2
|
-
import { z as c, c as f } from "./zeros-
|
|
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.
|
package/dist/ops/appendCache.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { e as a } from "../index-
|
|
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-
|
|
5
|
-
import { z as c } from "../zeros-
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { r as d } from "../../index-
|
|
2
|
-
import { c as h } from "../../concat-
|
|
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-
|
|
2
|
-
import { l as N, w as b } from "../../ops-
|
|
3
|
-
import { o as g } from "../../ones-
|
|
4
|
-
import { z as A } from "../../zeros-
|
|
5
|
-
import { m as I } from "../../mat_mul-
|
|
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-
|
|
2
|
-
import { s as f } from "../../softmax-
|
|
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-
|
|
2
|
-
import { r as l } from "../../range-
|
|
3
|
-
import { s as N } from "../../stack-
|
|
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.
|
package/dist/ops/cpu/gelu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as n, t as M } from "../../index-
|
|
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-
|
|
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);
|
package/dist/ops/cpu/normRMS.js
CHANGED
package/dist/ops/cpu/qkv.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as q } from "../../index-
|
|
2
|
-
import { r as o } from "../../reshape-
|
|
3
|
-
import { s as x } from "../../split-
|
|
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();
|
package/dist/ops/cpu/rope.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as S } from "../../index-
|
|
2
|
-
import { r as F } from "../../range-
|
|
3
|
-
import { g as I } from "../../gather-
|
|
4
|
-
import { s as E } from "../../stack-
|
|
5
|
-
import { c as T } from "../../concat-
|
|
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,
|
|
2
|
-
import { r as b } from "../../range-
|
|
3
|
-
import { s as E } from "../../stack-
|
|
4
|
-
import { o as D } from "../../ones-
|
|
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)
|
package/dist/ops/fusedSoftmax.js
CHANGED
package/dist/ops/gatherSub.js
CHANGED
package/dist/ops/gelu.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h as d, b as u, s as f } from "../../index-
|
|
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-
|
|
3
|
+
import { s as g } from "../../sum-Cvq06317.js";
|
|
4
4
|
const T = {
|
|
5
5
|
kernelName: "FusedSoftmax",
|
|
6
6
|
outputsToSave: [!0],
|
package/dist/ops/grads/gelu.js
CHANGED
package/dist/ops/grads/qkv.js
CHANGED
package/dist/ops/grads/rope.js
CHANGED
package/dist/ops/matMulGelu.js
CHANGED
package/dist/ops/matMulMul.js
CHANGED
package/dist/ops/mulDrop.js
CHANGED
package/dist/ops/normRMS.js
CHANGED
package/dist/ops/qkv.js
CHANGED
package/dist/ops/scatterSub.js
CHANGED