@imaduddin/fastbrain 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/index.js +20 -0
  2. package/package.json +29 -6
  3. package/readme.md +959 -0
  4. package/src/Embedding/index.d.ts +21 -0
  5. package/src/Embedding/index.js +141 -0
  6. package/src/FFN/index.d.ts +23 -0
  7. package/src/FFN/index.js +45 -0
  8. package/src/Linear/index.d.ts +31 -0
  9. package/src/Linear/index.js +198 -0
  10. package/src/OperationManager.js +169 -0
  11. package/src/PositionEmbedding/index.d.ts +30 -0
  12. package/src/PositionEmbedding/index.js +65 -0
  13. package/src/RMSNorm/index.d.ts +30 -0
  14. package/src/RMSNorm/index.js +96 -0
  15. package/src/Relu/index.d.ts +25 -0
  16. package/src/Relu/index.js +110 -0
  17. package/src/SelfAttention/index.d.ts +28 -0
  18. package/src/SelfAttention/index.js +138 -0
  19. package/src/Softmax/index.d.ts +26 -0
  20. package/src/Softmax/index.js +225 -0
  21. package/src/Tokenizer/index.d.ts +12 -0
  22. package/src/Tokenizer/index.js +164 -0
  23. package/src/Tokenizer/vocabs.json +19618 -0
  24. package/src/TransformerBlock/index.d.ts +28 -0
  25. package/src/TransformerBlock/index.js +78 -0
  26. package/src/getVec.js +30 -0
  27. package/src/gpu.js +0 -0
  28. package/src/residualConnection/index.js +32 -0
  29. package/src/shaders/CalculateAcc.wgsl +50 -0
  30. package/src/shaders/CalculateLoss.wgsl +30 -0
  31. package/src/shaders/ComputeDInput.wgsl +32 -0
  32. package/src/shaders/EB.wgsl +33 -0
  33. package/src/shaders/EF.wgsl +25 -0
  34. package/src/shaders/LB.wgsl +75 -0
  35. package/src/shaders/LF.wgsl +60 -0
  36. package/src/shaders/Norm/rmsBackward.wgsl +65 -0
  37. package/src/shaders/Norm/rmsForward.wgsl +30 -0
  38. package/src/shaders/Norm/sumSquare.wgsl +38 -0
  39. package/src/shaders/Norm/updateGamma.wgsl +52 -0
  40. package/src/shaders/PB.wgsl +25 -0
  41. package/src/shaders/PF.wgsl +19 -0
  42. package/src/shaders/RB.wgsl +37 -0
  43. package/src/shaders/RF.wgsl +33 -0
  44. package/src/shaders/ReductionFunction.wgsl +28 -0
  45. package/src/shaders/SB.wgsl +36 -0
  46. package/src/shaders/SF.wgsl +75 -0
  47. package/src/shaders/SoftmaxBackward.wgsl +31 -0
  48. package/src/shaders/add.wgsl +30 -0
  49. package/src/shaders/attentionShader/CompueFinalForwardOutput.wgsl +29 -0
  50. package/src/shaders/attentionShader/ComputeDA.wgsl +30 -0
  51. package/src/shaders/attentionShader/ComputeDV.wgsl +37 -0
  52. package/src/shaders/attentionShader/ComputeK.wgsl +30 -0
  53. package/src/shaders/attentionShader/ComputedQ.wgsl +31 -0
  54. package/src/shaders/attentionShader/attentionSocres.wgsl +40 -0
  55. package/src/shaders/attentionShader/sumGradient.wgsl +24 -0
  56. package/src/shaders/calculateTotal.wgsl +26 -0
  57. package/README.md +0 -3
package/index.js ADDED
@@ -0,0 +1,20 @@
1
+ import { Embedding as E } from "./src/Embedding/index.js";
2
+ import { Linear as L } from "./src/Linear/index.js";
3
+ import { Softmax as S } from "./src/Softmax/index.js";
4
+ import { Relu as r } from "./src/Relu/index.js";
5
+ import { FFN as ffn } from "./src/FFN/index.js";
6
+ import { Tokenizer as to } from './src/Tokenizer/index.js'
7
+ import {SelfAttention as ST} from './src/SelfAttention/index.js'
8
+ import {TransformerBlock as TT} from './src/TransformerBlock/index.js'
9
+ import {PositionEmbedding as PM } from './src/PositionEmbedding/index.js'
10
+ import { RMSNorm as RM } from "./src/RMSNorm/index.js";
11
+ export const Embedding = E
12
+ export const Linear = L
13
+ export const Softmax = S;
14
+ export const RELU = r
15
+ export const FFN = ffn
16
+ export const Tokenizer = to;
17
+ export const SelfAttention = ST
18
+ export const TransformerBlock = TT;
19
+ export const PositionEmbedding = PM;
20
+ export const RMSNorm = RM
package/package.json CHANGED
@@ -1,6 +1,29 @@
1
- {
2
- "name": "@imaduddin/fastbrain",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@imaduddin/fastbrain",
3
+ "version": "1.0.0",
4
+ "description": "Raw-JAVASCRIPT Based Matirx and AI LLM Package called fastBrain.",
5
+ "keywords": [
6
+ "ai",
7
+ "llm",
8
+ "Large",
9
+ "Language",
10
+ "model",
11
+ "Small",
12
+ "Language",
13
+ "Model"
14
+ ],
15
+ "license": "MIT",
16
+ "author": "mineproness",
17
+ "type": "module",
18
+ "main": "index.js",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/imaduddin/fastBrain.git"
22
+ },
23
+ "dependencies": {
24
+ "webgpu": "^0.6.0"
25
+ },
26
+ "allowScripts": {
27
+ "webgpu@0.6.0": true
28
+ }
29
+ }