@openfluke/welvet 0.74.0 → 0.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -14
- package/dist/coverage_check.html +298 -0
- package/dist/example.html +283 -0
- package/dist/index.d.ts +81 -26
- package/dist/index.js +51 -12
- package/dist/main.wasm +0 -0
- package/dist/src/index.d.ts +69 -22
- package/dist/src/index.js +34 -8
- package/dist/src/types.d.ts +55 -0
- package/dist/tests/coverage.ts +113 -0
- package/dist/types.d.ts +60 -1
- package/dist/types.js +1 -1
- package/package.json +43 -13
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* welvet — Type Definitions for the M-POLY-VTD AI Engine
|
|
3
3
|
*
|
|
4
|
-
* Wraps the Loom v0.
|
|
4
|
+
* Wraps the Loom v0.75.0 WASM module which supports 21 numerical types,
|
|
5
5
|
* systolic grid propagation, target propagation, and WebGPU acceleration.
|
|
6
6
|
*/
|
|
7
7
|
export declare const DType: {
|
|
@@ -172,6 +172,34 @@ export interface TargetPropState {
|
|
|
172
172
|
/** Release resources (no-op in WASM). */
|
|
173
173
|
free(): void;
|
|
174
174
|
}
|
|
175
|
+
export interface Transformer {
|
|
176
|
+
/** Internal handle ID. */
|
|
177
|
+
_id: number;
|
|
178
|
+
/**
|
|
179
|
+
* Run a full prefill/inference pass.
|
|
180
|
+
* @param tokens Array of token IDs
|
|
181
|
+
* @returns Predicted logit tensor as Float32Array
|
|
182
|
+
*/
|
|
183
|
+
forwardFull(tokens: number[] | Uint32Array): Float32Array;
|
|
184
|
+
/**
|
|
185
|
+
* Run inference using WebGPU acceleration.
|
|
186
|
+
* @param tokens Array of token IDs
|
|
187
|
+
* @returns Predicted logit tensor as Float32Array
|
|
188
|
+
*/
|
|
189
|
+
forwardTokenIDsWGPU(tokens: number[] | Uint32Array): Promise<Float32Array>;
|
|
190
|
+
/**
|
|
191
|
+
* High-level prefill on GPU.
|
|
192
|
+
* @param tokens Array of token IDs
|
|
193
|
+
*/
|
|
194
|
+
forwardWGPU(tokens: number[] | Uint32Array): Promise<void>;
|
|
195
|
+
/**
|
|
196
|
+
* Convert tokens to a tensor representation using the embedding layer.
|
|
197
|
+
* @param tokens Array of token IDs
|
|
198
|
+
*/
|
|
199
|
+
tokensToTensor(tokens: number[] | Uint32Array): Float32Array;
|
|
200
|
+
/** Release resources. */
|
|
201
|
+
free(): void;
|
|
202
|
+
}
|
|
175
203
|
export interface NEATPopulation {
|
|
176
204
|
/** Internal handle ID. */
|
|
177
205
|
_id: number;
|
|
@@ -211,6 +239,8 @@ export interface Network {
|
|
|
211
239
|
* Extract the network's full blueprint as a JSON string.
|
|
212
240
|
* @param modelID Optional model identifier
|
|
213
241
|
*/
|
|
242
|
+
extractNetworkBlueprint(modelID?: string): string;
|
|
243
|
+
/** Alias for extractNetworkBlueprint */
|
|
214
244
|
extractBlueprint(modelID?: string): string;
|
|
215
245
|
/** Total number of layers in the network. */
|
|
216
246
|
getLayerCount(): number;
|
|
@@ -271,6 +301,29 @@ export interface Network {
|
|
|
271
301
|
_id: number;
|
|
272
302
|
/** Release resources (no-op in WASM, included for API parity). */
|
|
273
303
|
free(): void;
|
|
304
|
+
/**
|
|
305
|
+
* Low-level polymorphic forward pass.
|
|
306
|
+
* @param input Input tensor data
|
|
307
|
+
*/
|
|
308
|
+
forwardPolymorphic(input: Float32Array | number[]): Float32Array;
|
|
309
|
+
/**
|
|
310
|
+
* Get an individual layer wrapper.
|
|
311
|
+
* @param index 0-based layer index
|
|
312
|
+
*/
|
|
313
|
+
getLayer(index: number): Layer;
|
|
314
|
+
}
|
|
315
|
+
export interface Layer {
|
|
316
|
+
/** Internal handle ID. */
|
|
317
|
+
_id: number;
|
|
318
|
+
/**
|
|
319
|
+
* Dispatch a forward pass through this layer only.
|
|
320
|
+
* @param input Input tensor
|
|
321
|
+
*/
|
|
322
|
+
dispatch(input: Float32Array | number[]): Float32Array;
|
|
323
|
+
/** Sync weights to GPU. */
|
|
324
|
+
syncToGPU(): Promise<void>;
|
|
325
|
+
/** Release resources. */
|
|
326
|
+
free(): void;
|
|
274
327
|
}
|
|
275
328
|
export interface DNACompareResult {
|
|
276
329
|
similarity: number;
|
|
@@ -296,4 +349,10 @@ declare global {
|
|
|
296
349
|
function defaultNEATConfig(dModel: number): string;
|
|
297
350
|
/** Create a NEAT population from a seed network. */
|
|
298
351
|
function createLoomNEATPopulation(seedID: number, size: number, cfgJSON: string): NEATPopulation;
|
|
352
|
+
/** Create a Transformer from a network and weights. */
|
|
353
|
+
function createLoomTransformer(networkID: number, embeddings: Float32Array | number[], lmHead: Float32Array | number[], finalNorm: Float32Array | number[]): Transformer;
|
|
354
|
+
/** Get the internal parity symbol list from Go. */
|
|
355
|
+
function getLoomInternalParity(): string[];
|
|
356
|
+
/** Build a network from a JSON string. */
|
|
357
|
+
function BuildNetworkFromJSON(json: string): Network;
|
|
299
358
|
}
|
package/dist/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* welvet — Type Definitions for the M-POLY-VTD AI Engine
|
|
3
3
|
*
|
|
4
|
-
* Wraps the Loom v0.
|
|
4
|
+
* Wraps the Loom v0.75.0 WASM module which supports 21 numerical types,
|
|
5
5
|
* systolic grid propagation, target propagation, and WebGPU acceleration.
|
|
6
6
|
*/
|
|
7
7
|
// ──────────────────────────────────────────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfluke/welvet",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "M-POLY-VTD AI Engine (Loom v0.
|
|
3
|
+
"version": "0.75.0",
|
|
4
|
+
"description": "M-POLY-VTD AI Engine (Loom v0.75.0) — 21 Numerical Types, WebGPU, DNA Evolution, NEAT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -12,14 +12,43 @@
|
|
|
12
12
|
"README.md"
|
|
13
13
|
],
|
|
14
14
|
"keywords": [
|
|
15
|
-
"loom",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
15
|
+
"loom",
|
|
16
|
+
"welvet",
|
|
17
|
+
"neural-network",
|
|
18
|
+
"machine-learning",
|
|
19
|
+
"deep-learning",
|
|
20
|
+
"webassembly",
|
|
21
|
+
"wasm",
|
|
22
|
+
"webgpu",
|
|
23
|
+
"gpu",
|
|
24
|
+
"typescript",
|
|
25
|
+
"javascript",
|
|
26
|
+
"transformer",
|
|
27
|
+
"safetensors",
|
|
28
|
+
"polymorphic",
|
|
29
|
+
"quantization",
|
|
30
|
+
"fp4",
|
|
31
|
+
"int4",
|
|
32
|
+
"binary",
|
|
33
|
+
"ternary",
|
|
34
|
+
"multi-precision",
|
|
35
|
+
"systolic",
|
|
36
|
+
"target-propagation",
|
|
37
|
+
"gradient-free",
|
|
38
|
+
"swiglu",
|
|
39
|
+
"moe",
|
|
40
|
+
"embedding",
|
|
41
|
+
"rnn",
|
|
42
|
+
"lstm",
|
|
43
|
+
"cnn",
|
|
44
|
+
"llm",
|
|
45
|
+
"tokenizer",
|
|
46
|
+
"bpe",
|
|
47
|
+
"inference",
|
|
48
|
+
"training",
|
|
49
|
+
"browser",
|
|
50
|
+
"nodejs",
|
|
51
|
+
"isomorphic"
|
|
23
52
|
],
|
|
24
53
|
"license": "Apache-2.0",
|
|
25
54
|
"repository": {
|
|
@@ -44,9 +73,10 @@
|
|
|
44
73
|
"prepare": "npm run build",
|
|
45
74
|
"serve": "python3 serve.py",
|
|
46
75
|
"dev": "npm run build && npm run serve",
|
|
47
|
-
"test": "tsx tests/cabi_verify.ts && tsx tests/benchmark.ts",
|
|
76
|
+
"test": "tsx tests/cabi_verify.ts && tsx tests/benchmark.ts && tsx tests/coverage.ts",
|
|
48
77
|
"test:cabi": "tsx tests/cabi_verify.ts",
|
|
49
|
-
"test:bench": "tsx tests/benchmark.ts"
|
|
78
|
+
"test:bench": "tsx tests/benchmark.ts",
|
|
79
|
+
"test:coverage": "tsx tests/coverage.ts"
|
|
50
80
|
},
|
|
51
81
|
"devDependencies": {
|
|
52
82
|
"@types/node": "^22.7.5",
|
|
@@ -55,4 +85,4 @@
|
|
|
55
85
|
"rimraf": "^6.0.1",
|
|
56
86
|
"shx": "^0.3.4"
|
|
57
87
|
}
|
|
58
|
-
}
|
|
88
|
+
}
|