amv-forge 2.0.0__tar.gz → 2.0.2__tar.gz

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 (84) hide show
  1. {amv_forge-2.0.0 → amv_forge-2.0.2}/PKG-INFO +261 -260
  2. {amv_forge-2.0.0 → amv_forge-2.0.2}/README.md +226 -226
  3. {amv_forge-2.0.0 → amv_forge-2.0.2}/pyproject.toml +73 -72
  4. {amv_forge-2.0.0 → amv_forge-2.0.2}/setup.cfg +4 -4
  5. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/amv_forge.egg-info/PKG-INFO +261 -260
  6. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/amv_forge.egg-info/requires.txt +1 -0
  7. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/__init__.py +229 -229
  8. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/__init__.pyi +20 -20
  9. amv_forge-2.0.2/src/forge/autograd.py +306 -0
  10. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/bridge.py +266 -266
  11. amv_forge-2.0.2/src/forge/data.py +130 -0
  12. amv_forge-2.0.2/src/forge/device.py +127 -0
  13. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/distributions.py +220 -220
  14. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/errors.py +83 -83
  15. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/fft.py +137 -137
  16. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/functional.py +937 -937
  17. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/generated/__init__.py +3 -3
  18. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/generated/op_schema.py +13 -13
  19. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/graph.py +206 -206
  20. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/linalg.py +127 -127
  21. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/models/__init__.py +25 -25
  22. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/models/llama.py +249 -249
  23. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/models/nanogpt.py +182 -182
  24. amv_forge-2.0.2/src/forge/nn.py +1757 -0
  25. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/nn.pyi +34 -34
  26. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/ops.py +4271 -4271
  27. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/optim.py +911 -911
  28. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/optim.pyi +15 -15
  29. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/pipeline.py +159 -159
  30. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/rl/__init__.py +19 -19
  31. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/rl/cartpole.py +151 -151
  32. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/serialization.py +101 -101
  33. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/special.py +257 -257
  34. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/tensor.py +1768 -1768
  35. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/tensor.pyi +66 -66
  36. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_activation_functions.py +30 -30
  37. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_adversarial_fuzzer.py +1172 -1172
  38. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_arithmetic_ops.py +44 -44
  39. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_autograd.py +42 -42
  40. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_benchmark.py +75 -75
  41. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_broadcasting.py +39 -39
  42. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_compatibility.py +62 -62
  43. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_core.py +118 -118
  44. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_cpu_ops.py +196 -196
  45. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_dataloader.py +29 -29
  46. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_edge_cases.py +41 -41
  47. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_error_handling.py +31 -31
  48. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_exceptions.py +71 -71
  49. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_extreme.py +58 -58
  50. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_finite_difference.py +165 -165
  51. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_generated_schema.py +22 -22
  52. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_gpu_optimizers.py +116 -116
  53. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_gpu_sgd_contract.py +68 -68
  54. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_graph_monster.py +53 -53
  55. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_hub_models_and_rl.py +194 -194
  56. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_inplace_version_lock.py +259 -259
  57. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_loss_functions.py +32 -32
  58. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_machine_gun.py +64 -64
  59. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_massive_cpu.py +91 -89
  60. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_math_ops.py +30 -30
  61. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_matrix_ops.py +34 -34
  62. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_module_to_contract.py +105 -105
  63. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_nn_module.py +34 -34
  64. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_ops_slice.py +99 -99
  65. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_optimizer_versioning_contract.py +75 -75
  66. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_optimizers.py +126 -126
  67. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_reduction_ops.py +32 -32
  68. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_release2_llm_modules.py +148 -148
  69. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_security.py +127 -127
  70. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_shape_ops.py +31 -31
  71. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_stress.py +62 -62
  72. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_tensor_creation.py +54 -54
  73. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_unbroadcast.py +62 -62
  74. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_v3_features.py +567 -567
  75. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_v3_validation.py +148 -148
  76. {amv_forge-2.0.0 → amv_forge-2.0.2}/tests/test_vram_crusher.py +47 -47
  77. amv_forge-2.0.0/src/forge/autograd.py +0 -306
  78. amv_forge-2.0.0/src/forge/data.py +0 -130
  79. amv_forge-2.0.0/src/forge/device.py +0 -127
  80. amv_forge-2.0.0/src/forge/nn.py +0 -1757
  81. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/amv_forge.egg-info/SOURCES.txt +0 -0
  82. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/amv_forge.egg-info/dependency_links.txt +0 -0
  83. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/amv_forge.egg-info/top_level.txt +0 -0
  84. {amv_forge-2.0.0 → amv_forge-2.0.2}/src/forge/py.typed +0 -0
@@ -1,260 +1,261 @@
1
- Metadata-Version: 2.4
2
- Name: amv-forge
3
- Version: 2.0.0
4
- Summary: High-performance WebGPU-accelerated tensor computation engine with reverse-mode autograd for browser and edge deep learning.
5
- Author-email: AMEVA Foundation <contact@uno-km.com>
6
- Maintainer: AMEVA Engineering Team
7
- License: MIT
8
- Project-URL: Homepage, https://uno-km.github.io/amv-forge/
9
- Project-URL: Documentation, https://uno-km.github.io/amv-forge/
10
- Project-URL: Repository, https://github.com/uno-km/amv-forge
11
- Project-URL: Issues, https://github.com/uno-km/amv-forge/issues
12
- Project-URL: Changelog, https://github.com/uno-km/amv-forge/blob/main/RELEASE_NOTES.md
13
- Keywords: deep-learning,tensor,autograd,webgpu,pytorch,transformers,pyodide,wasm,machine-learning
14
- Classifier: Development Status :: 4 - Beta
15
- Classifier: Intended Audience :: Developers
16
- Classifier: Intended Audience :: Science/Research
17
- Classifier: License :: OSI Approved :: MIT License
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.9
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
- Classifier: Programming Language :: Python :: 3.13
24
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
- Classifier: Topic :: Scientific/Engineering :: Mathematics
26
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
- Classifier: Operating System :: OS Independent
28
- Requires-Python: >=3.9
29
- Description-Content-Type: text/markdown
30
- Requires-Dist: numpy>=1.20.0
31
- Provides-Extra: dev
32
- Requires-Dist: pytest>=7.0; extra == "dev"
33
- Requires-Dist: pytest-cov>=4.0; extra == "dev"
34
-
35
- # amv-forge (`amv-forge`)
36
-
37
- [![PyPI Version](https://img.shields.io/badge/pypi-v1.0.1-blue.svg)](https://pypi.org/project/amv-forge/)
38
- [![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://pypi.org/project/amv-forge/)
39
- [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/uno-km/amv-forge/blob/main/LICENSE)
40
- [![Test Suite](https://img.shields.io/badge/tests-279%2F279%20passed%20(100%25)-brightgreen.svg)](https://github.com/uno-km/amv-forge)
41
- [![WebGPU Acceleration](https://img.shields.io/badge/acceleration-WebGPU%20WGSL%20%2B%20CPU-orange.svg)](https://uno-km.github.io/amv-forge/)
42
-
43
- **High-Performance Client-Side Tensor Computation Engine & Reverse-Mode Autograd Framework Powered by WebGPU.**
44
-
45
- Developed and maintained by the **AMEVA Foundation** (?„ë©”ë°??¬ë‹¨), amv-forge is an industrial-grade, zero-server-cost deep learning library engineered to execute high-throughput tensor operations, automated differentiation, and end-to-end neural model training natively within client runtimes (WebGPU, WASM/Pyodide, and native Python environments).
46
-
47
- ---
48
-
49
- ## Architectural Pillars
50
-
51
- ```
52
- +-----------------------------------------------------------------------------------+
53
- | amv-forge User Space |
54
- | forge.nn | forge.optim | forge.linalg | forge.fft | forge.distributions |
55
- +-----------------------------------------------------------------------------------+
56
- | Reverse-Mode Autograd DAG Engine |
57
- | Vector-Jacobian Products (VJP) * In-Place Mutation Version Locks |
58
- +-----------------------------------------------------------------------------------+
59
- | Hardware Abstraction Layer |
60
- | CPU Backend (Vectorized C/NumPy) <---> WebGPU Backend (Async WGSL Kernels) |
61
- | Staging Buffer Recycling Pool <---> Zero-Leak Allocation Token Ring |
62
- +-----------------------------------------------------------------------------------+
63
- ```
64
-
65
- 1. **Deterministic Autograd & Topological Execution**
66
- Strict reverse-mode automatic differentiation graph with cycle detection, multi-output tuple bindings, in-place version invalidation, and scalar-tensor memory optimization.
67
- 2. **WebGPU Hardware Acceleration**
68
- Direct-to-silicon WGSL compute shaders featuring 8-dimensional non-contiguous stride dispatching, 2D workgroup partitioning ($65,535 \times 65,535$), and explicit buffer lifecycle tracking.
69
- 3. **PyTorch 1:1 API Parity**
70
- Seamless drop-in compatibility across neural layers (`nn.Module`, `nn.MultiheadAttention`, `nn.Conv2d`), mathematical primitives (`linalg`, `fft`, `special`), and probabilistic graphical models (`distributions`).
71
- 4. **Zero-Server Infrastructure (Edge & Browser)**
72
- Execute full model fine-tuning and inference directly inside the browser using Pyodide and WebGPU with zero cloud compute cost and total data privacy.
73
-
74
- ---
75
-
76
- ## Installation
77
-
78
- Install the official package from PyPI:
79
-
80
- ```bash
81
- pip install amv-forge
82
- ```
83
-
84
- Or install from source with development dependencies:
85
-
86
- ```bash
87
- git clone https://github.com/uno-km/amv-forge.git
88
- cd amv-forge/packages/forge-py
89
- pip install -e .
90
- ```
91
-
92
- ---
93
-
94
- ## Quick Start
95
-
96
- ### 1. Basic Tensor & Automated Differentiation
97
-
98
- ```python
99
- import forge as fg
100
-
101
- # Initialize tensors with gradient tracking
102
- x = fg.tensor([[1.0, 2.0], [3.0, 4.0]], requires_grad=True)
103
- w = fg.tensor([[0.5, -0.5], [1.0, 2.0]], requires_grad=True)
104
- b = fg.tensor([0.1, -0.1], requires_grad=True)
105
-
106
- # Forward pass: Linear projection + GELU activation
107
- y = fg.matmul(x, w) + b
108
- loss = fg.sum(fg.nn.functional.gelu(y))
109
-
110
- # Compute Vector-Jacobian Products (Autograd backward)
111
- loss.backward()
112
-
113
- print("Loss Value :", loss.numpy())
114
- print("Gradient dL/dw :\n", w.grad.numpy())
115
- ```
116
-
117
- ---
118
-
119
- ### 2. Character-Level Transformer (NanoGPT)
120
-
121
- Train a complete causal autoregressive transformer directly on your local device:
122
-
123
- ```python
124
- import forge as fg
125
- import forge.nn as nn
126
- from forge.models.nanogpt import GPT, GPTConfig
127
-
128
- # Define model configuration
129
- config = GPTConfig(
130
- block_size=32,
131
- vocab_size=64,
132
- n_layer=4,
133
- n_head=4,
134
- n_embd=64,
135
- bias=False
136
- )
137
- model = GPT(config)
138
- optimizer = fg.optim.AdamW(model.parameters(), lr=1e-3, weight_decay=1e-2)
139
- criterion = nn.CrossEntropyLoss()
140
-
141
- # Training step (Batch Size: 8, Sequence Length: 32)
142
- input_tokens = fg.tensor([[1, 5, 12, 3]], dtype="int32")
143
- target_tokens = fg.tensor([[5, 12, 3, 18]], dtype="int32")
144
-
145
- optimizer.zero_grad()
146
- logits = model(input_tokens)
147
- loss = criterion(logits, target_tokens)
148
- loss.backward()
149
- optimizer.step()
150
- ```
151
-
152
- ---
153
-
154
- ### 3. Speech-to-Text & Acoustic Signal Processing (`forge.fft` + `forge.nn`)
155
-
156
- Compute real Fourier Mel-spectrograms from raw acoustic waveforms:
157
-
158
- ```python
159
- import forge as fg
160
- import forge.nn as nn
161
-
162
- # 16kHz PCM audio waveform (Batch: 4, Samples: 8000)
163
- raw_audio = fg.tensor(audio_data, dtype="float32")
164
-
165
- # Fast Fourier Transform (Complex Spectrum)
166
- fft_complex = fg.fft.rfft(raw_audio, n=1024, dim=-1)
167
-
168
- # Power Spectrogram Energy
169
- power_spec = (fft_complex.real.pow(2.0) + fft_complex.imag.pow(2.0) + 1e-6).log()
170
-
171
- # 1D Convolutional Audio Feature Extractor
172
- conv = nn.Conv1d(in_channels=513, out_channels=64, kernel_size=3, padding=1)
173
- audio_features = conv(power_spec)
174
- ```
175
-
176
- ---
177
-
178
- ## Comprehensive Module Directory
179
-
180
- | Module | Core Functionality | Key Operators / Classes |
181
- | :--- | :--- | :--- |
182
- | **`forge`** | Core Tensor Engine & Factories | `tensor`, `zeros`, `ones`, `randn`, `matmul`, `einsum`, `reshape`, `permute`, `where` |
183
- | **`forge.nn`** | Deep Learning Layers & Containers | `Linear`, `Conv1d`, `Conv2d`, `MultiheadAttention`, `LayerNorm`, `RMSNorm`, `BatchNorm2d`, `Embedding`, `CrossEntropyLoss`, `MSELoss` |
184
- | **`forge.optim`** | Optimizers & Rate Schedulers | `SGD`, `Adam`, `AdamW`, `RMSprop`, `CosineAnnealingLR`, `StepLR` |
185
- | **`forge.linalg`** | Linear Algebra Decomposition | `norm`, `svd`, `qr`, `cholesky`, `inv`, `pinv`, `det`, `matrix_rank`, `solve`, `eigh` |
186
- | **`forge.fft`** | Discrete Fourier Transforms | `rfft`, `irfft`, `fft`, `ifft`, `fft2`, `ifft2`, `rfft2`, `irfft2`, `fftfreq`, `fftshift` |
187
- | **`forge.special`** | Transcendental & Error Functions | `erf`, `erfc`, `erfinv`, `gammaln`, `digamma`, `expm1`, `log1p`, `expit`, `logit`, `sinc`, `i0`, `xlogy` |
188
- | **`forge.distributions`**| Probability Distributions & KL | `Normal(rsample)`, `Uniform`, `Bernoulli`, `Categorical`, `kl_divergence` |
189
- | **`forge.models`** | Pre-architected Reference Models | `GPT`, `GPTConfig`, `LLaMA` |
190
-
191
- ---
192
-
193
- ## In-Browser Zero-Install Execution (WebGPU + Pyodide)
194
-
195
- amv-forge packages a single bundled JavaScript distribution (`forge-py-bundle.js`) that mounts into browser-native Pyodide runtimes:
196
-
197
- ```html
198
- <script src="https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js"></script>
199
- <script src="https://uno-km.github.io/amv-forge/dist/forge-py-bundle.js"></script>
200
- <script>
201
- async function runClientDeepLearning() {
202
- let pyodide = await loadPyodide();
203
- await window.loadAmevaForgeBundle(pyodide);
204
-
205
- await pyodide.runPythonAsync(`
206
- import forge as fg
207
- x = fg.randn((1024, 1024), device="gpu")
208
- y = fg.matmul(x, x)
209
- print("Computed 1024x1024 on WebGPU Hardware:", y.shape)
210
- `);
211
- }
212
- runClientDeepLearning();
213
- </script>
214
- ```
215
-
216
- ---
217
-
218
- ## ?Œ The AMEVA Foundation (?„ë©”ë°??¬ë‹¨)
219
-
220
- **amv-forge** is an open-source deep learning initiative created and governed by the **AMEVA Foundation** (?„ë©”ë°??¬ë‹¨).
221
-
222
- ### ?ޝ Our Mission & Zero-Server Paradigm
223
- The AMEVA Foundation is dedicated to the **democratisation of client-side artificial intelligence and edge computing**. We envision a decentralized web where deep learning training, fine-tuning, and neural inference occur directly on user devices (browsers, laptops, tablets, and smartphones)?”eliminating massive cloud server costs, safeguarding user data sovereignty with zero network leakage, and providing zero-latency neural intelligence everywhere.
224
-
225
- ### ?ŒŸ Core Foundation Initiatives
226
- - ?Œ **amv-forge Tensor Engine**: High-performance WebGPU tensor computation & reverse-mode autograd engine.
227
- - ?Ž™ï¸?**On-Device Whisper STT**: Real-time acoustic FFT signal processing & speech recognition running locally in browser.
228
- - ?¤– **Decentralized LLM Transformers**: Zero-install character and subword transformer models with zero cloud dependency.
229
- - ?”’ **Privacy-First AI Sovereignty**: Sovereign on-device machine learning where private data never leaves client silicon.
230
-
231
- * **Foundation Portal**: [https://uno-km.github.io/amv-forge/](https://uno-km.github.io/amv-forge/)
232
- * **Official Repository**: [https://github.com/uno-km/amv-forge](https://github.com/uno-km/amv-forge)
233
- * **Community & Governance**: [https://github.com/uno-km/amv-forge/issues](https://github.com/uno-km/amv-forge/issues)
234
- * **Sponsorship & Research Partnerships**: [https://github.com/uno-km](https://github.com/uno-km)
235
-
236
- ---
237
-
238
- ## Quality Assurance & Verification
239
-
240
- Every release of amv-forge undergoes rigorous multi-tier verification:
241
- * **292 Unit & Stress Tests**: 100% automated pass rate across CPU, GPU fallback, mathematical accuracy, and memory quota managers.
242
- * **Finite-Difference Gradcheck**: Numerical gradient validation against analytical Vector-Jacobian backward formulations.
243
- * **Memory Lifecycle Audit**: Zero-leak allocation token reclamation and buffer recycling verification across 10,000+ continuous execution cycles.
244
-
245
- ---
246
-
247
- ## License & Citation
248
-
249
- amv-forge is licensed under the [MIT License](https://github.com/uno-km/amv-forge/blob/main/LICENSE).
250
-
251
- ```bibtex
252
- @software{ameva_forge_2026,
253
- author = {AMEVA Foundation},
254
- title = {amv-forge: High-Performance WebGPU-Accelerated Tensor Computation Engine},
255
- year = {2026},
256
- publisher = {GitHub},
257
- url = {https://github.com/uno-km/amv-forge}
258
- }
259
- ```
260
-
1
+ Metadata-Version: 2.4
2
+ Name: amv-forge
3
+ Version: 2.0.2
4
+ Summary: High-performance WebGPU-accelerated tensor computation engine with reverse-mode autograd for browser and edge deep learning.
5
+ Author-email: AMEVA Foundation <contact@uno-km.com>
6
+ Maintainer: AMEVA Engineering Team
7
+ License: MIT
8
+ Project-URL: Homepage, https://uno-km.github.io/amv-forge/
9
+ Project-URL: Documentation, https://uno-km.github.io/amv-forge/
10
+ Project-URL: Repository, https://github.com/uno-km/amv-forge
11
+ Project-URL: Issues, https://github.com/uno-km/amv-forge/issues
12
+ Project-URL: Changelog, https://github.com/uno-km/amv-forge/blob/main/RELEASE_NOTES.md
13
+ Keywords: deep-learning,tensor,autograd,webgpu,pytorch,transformers,pyodide,wasm,machine-learning
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: License :: OSI Approved :: MIT License
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
26
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
+ Classifier: Operating System :: OS Independent
28
+ Requires-Python: >=3.9
29
+ Description-Content-Type: text/markdown
30
+ Requires-Dist: numpy>=1.20.0
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=7.0; extra == "dev"
33
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
34
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
35
+
36
+ # amv-forge (`amv-forge`)
37
+
38
+ [![PyPI Version](https://img.shields.io/badge/pypi-v1.0.1-blue.svg)](https://pypi.org/project/amv-forge/)
39
+ [![Python Version](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://pypi.org/project/amv-forge/)
40
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/uno-km/amv-forge/blob/main/LICENSE)
41
+ [![Test Suite](https://img.shields.io/badge/tests-279%2F279%20passed%20(100%25)-brightgreen.svg)](https://github.com/uno-km/amv-forge)
42
+ [![WebGPU Acceleration](https://img.shields.io/badge/acceleration-WebGPU%20WGSL%20%2B%20CPU-orange.svg)](https://uno-km.github.io/amv-forge/)
43
+
44
+ **High-Performance Client-Side Tensor Computation Engine & Reverse-Mode Autograd Framework Powered by WebGPU.**
45
+
46
+ Developed and maintained by the **AMEVA Foundation** (?„ë©”ë°??¬ë‹¨), amv-forge is an industrial-grade, zero-server-cost deep learning library engineered to execute high-throughput tensor operations, automated differentiation, and end-to-end neural model training natively within client runtimes (WebGPU, WASM/Pyodide, and native Python environments).
47
+
48
+ ---
49
+
50
+ ## Architectural Pillars
51
+
52
+ ```
53
+ +-----------------------------------------------------------------------------------+
54
+ | amv-forge User Space |
55
+ | forge.nn | forge.optim | forge.linalg | forge.fft | forge.distributions |
56
+ +-----------------------------------------------------------------------------------+
57
+ | Reverse-Mode Autograd DAG Engine |
58
+ | Vector-Jacobian Products (VJP) * In-Place Mutation Version Locks |
59
+ +-----------------------------------------------------------------------------------+
60
+ | Hardware Abstraction Layer |
61
+ | CPU Backend (Vectorized C/NumPy) <---> WebGPU Backend (Async WGSL Kernels) |
62
+ | Staging Buffer Recycling Pool <---> Zero-Leak Allocation Token Ring |
63
+ +-----------------------------------------------------------------------------------+
64
+ ```
65
+
66
+ 1. **Deterministic Autograd & Topological Execution**
67
+ Strict reverse-mode automatic differentiation graph with cycle detection, multi-output tuple bindings, in-place version invalidation, and scalar-tensor memory optimization.
68
+ 2. **WebGPU Hardware Acceleration**
69
+ Direct-to-silicon WGSL compute shaders featuring 8-dimensional non-contiguous stride dispatching, 2D workgroup partitioning ($65,535 \times 65,535$), and explicit buffer lifecycle tracking.
70
+ 3. **PyTorch 1:1 API Parity**
71
+ Seamless drop-in compatibility across neural layers (`nn.Module`, `nn.MultiheadAttention`, `nn.Conv2d`), mathematical primitives (`linalg`, `fft`, `special`), and probabilistic graphical models (`distributions`).
72
+ 4. **Zero-Server Infrastructure (Edge & Browser)**
73
+ Execute full model fine-tuning and inference directly inside the browser using Pyodide and WebGPU with zero cloud compute cost and total data privacy.
74
+
75
+ ---
76
+
77
+ ## Installation
78
+
79
+ Install the official package from PyPI:
80
+
81
+ ```bash
82
+ pip install amv-forge
83
+ ```
84
+
85
+ Or install from source with development dependencies:
86
+
87
+ ```bash
88
+ git clone https://github.com/uno-km/amv-forge.git
89
+ cd amv-forge/packages/forge-py
90
+ pip install -e .
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Quick Start
96
+
97
+ ### 1. Basic Tensor & Automated Differentiation
98
+
99
+ ```python
100
+ import forge as fg
101
+
102
+ # Initialize tensors with gradient tracking
103
+ x = fg.tensor([[1.0, 2.0], [3.0, 4.0]], requires_grad=True)
104
+ w = fg.tensor([[0.5, -0.5], [1.0, 2.0]], requires_grad=True)
105
+ b = fg.tensor([0.1, -0.1], requires_grad=True)
106
+
107
+ # Forward pass: Linear projection + GELU activation
108
+ y = fg.matmul(x, w) + b
109
+ loss = fg.sum(fg.nn.functional.gelu(y))
110
+
111
+ # Compute Vector-Jacobian Products (Autograd backward)
112
+ loss.backward()
113
+
114
+ print("Loss Value :", loss.numpy())
115
+ print("Gradient dL/dw :\n", w.grad.numpy())
116
+ ```
117
+
118
+ ---
119
+
120
+ ### 2. Character-Level Transformer (NanoGPT)
121
+
122
+ Train a complete causal autoregressive transformer directly on your local device:
123
+
124
+ ```python
125
+ import forge as fg
126
+ import forge.nn as nn
127
+ from forge.models.nanogpt import GPT, GPTConfig
128
+
129
+ # Define model configuration
130
+ config = GPTConfig(
131
+ block_size=32,
132
+ vocab_size=64,
133
+ n_layer=4,
134
+ n_head=4,
135
+ n_embd=64,
136
+ bias=False
137
+ )
138
+ model = GPT(config)
139
+ optimizer = fg.optim.AdamW(model.parameters(), lr=1e-3, weight_decay=1e-2)
140
+ criterion = nn.CrossEntropyLoss()
141
+
142
+ # Training step (Batch Size: 8, Sequence Length: 32)
143
+ input_tokens = fg.tensor([[1, 5, 12, 3]], dtype="int32")
144
+ target_tokens = fg.tensor([[5, 12, 3, 18]], dtype="int32")
145
+
146
+ optimizer.zero_grad()
147
+ logits = model(input_tokens)
148
+ loss = criterion(logits, target_tokens)
149
+ loss.backward()
150
+ optimizer.step()
151
+ ```
152
+
153
+ ---
154
+
155
+ ### 3. Speech-to-Text & Acoustic Signal Processing (`forge.fft` + `forge.nn`)
156
+
157
+ Compute real Fourier Mel-spectrograms from raw acoustic waveforms:
158
+
159
+ ```python
160
+ import forge as fg
161
+ import forge.nn as nn
162
+
163
+ # 16kHz PCM audio waveform (Batch: 4, Samples: 8000)
164
+ raw_audio = fg.tensor(audio_data, dtype="float32")
165
+
166
+ # Fast Fourier Transform (Complex Spectrum)
167
+ fft_complex = fg.fft.rfft(raw_audio, n=1024, dim=-1)
168
+
169
+ # Power Spectrogram Energy
170
+ power_spec = (fft_complex.real.pow(2.0) + fft_complex.imag.pow(2.0) + 1e-6).log()
171
+
172
+ # 1D Convolutional Audio Feature Extractor
173
+ conv = nn.Conv1d(in_channels=513, out_channels=64, kernel_size=3, padding=1)
174
+ audio_features = conv(power_spec)
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Comprehensive Module Directory
180
+
181
+ | Module | Core Functionality | Key Operators / Classes |
182
+ | :--- | :--- | :--- |
183
+ | **`forge`** | Core Tensor Engine & Factories | `tensor`, `zeros`, `ones`, `randn`, `matmul`, `einsum`, `reshape`, `permute`, `where` |
184
+ | **`forge.nn`** | Deep Learning Layers & Containers | `Linear`, `Conv1d`, `Conv2d`, `MultiheadAttention`, `LayerNorm`, `RMSNorm`, `BatchNorm2d`, `Embedding`, `CrossEntropyLoss`, `MSELoss` |
185
+ | **`forge.optim`** | Optimizers & Rate Schedulers | `SGD`, `Adam`, `AdamW`, `RMSprop`, `CosineAnnealingLR`, `StepLR` |
186
+ | **`forge.linalg`** | Linear Algebra Decomposition | `norm`, `svd`, `qr`, `cholesky`, `inv`, `pinv`, `det`, `matrix_rank`, `solve`, `eigh` |
187
+ | **`forge.fft`** | Discrete Fourier Transforms | `rfft`, `irfft`, `fft`, `ifft`, `fft2`, `ifft2`, `rfft2`, `irfft2`, `fftfreq`, `fftshift` |
188
+ | **`forge.special`** | Transcendental & Error Functions | `erf`, `erfc`, `erfinv`, `gammaln`, `digamma`, `expm1`, `log1p`, `expit`, `logit`, `sinc`, `i0`, `xlogy` |
189
+ | **`forge.distributions`**| Probability Distributions & KL | `Normal(rsample)`, `Uniform`, `Bernoulli`, `Categorical`, `kl_divergence` |
190
+ | **`forge.models`** | Pre-architected Reference Models | `GPT`, `GPTConfig`, `LLaMA` |
191
+
192
+ ---
193
+
194
+ ## In-Browser Zero-Install Execution (WebGPU + Pyodide)
195
+
196
+ amv-forge packages a single bundled JavaScript distribution (`forge-py-bundle.js`) that mounts into browser-native Pyodide runtimes:
197
+
198
+ ```html
199
+ <script src="https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js"></script>
200
+ <script src="https://uno-km.github.io/amv-forge/dist/forge-py-bundle.js"></script>
201
+ <script>
202
+ async function runClientDeepLearning() {
203
+ let pyodide = await loadPyodide();
204
+ await window.loadAmevaForgeBundle(pyodide);
205
+
206
+ await pyodide.runPythonAsync(`
207
+ import forge as fg
208
+ x = fg.randn((1024, 1024), device="gpu")
209
+ y = fg.matmul(x, x)
210
+ print("Computed 1024x1024 on WebGPU Hardware:", y.shape)
211
+ `);
212
+ }
213
+ runClientDeepLearning();
214
+ </script>
215
+ ```
216
+
217
+ ---
218
+
219
+ ## ?Œ The AMEVA Foundation (?„ë©”ë°??¬ë‹¨)
220
+
221
+ **amv-forge** is an open-source deep learning initiative created and governed by the **AMEVA Foundation** (?„ë©”ë°??¬ë‹¨).
222
+
223
+ ### ?ޝ Our Mission & Zero-Server Paradigm
224
+ The AMEVA Foundation is dedicated to the **democratisation of client-side artificial intelligence and edge computing**. We envision a decentralized web where deep learning training, fine-tuning, and neural inference occur directly on user devices (browsers, laptops, tablets, and smartphones)?”eliminating massive cloud server costs, safeguarding user data sovereignty with zero network leakage, and providing zero-latency neural intelligence everywhere.
225
+
226
+ ### ?ŒŸ Core Foundation Initiatives
227
+ - ?Œ **amv-forge Tensor Engine**: High-performance WebGPU tensor computation & reverse-mode autograd engine.
228
+ - ?Ž™ï¸?**On-Device Whisper STT**: Real-time acoustic FFT signal processing & speech recognition running locally in browser.
229
+ - ?¤– **Decentralized LLM Transformers**: Zero-install character and subword transformer models with zero cloud dependency.
230
+ - ?”’ **Privacy-First AI Sovereignty**: Sovereign on-device machine learning where private data never leaves client silicon.
231
+
232
+ * **Foundation Portal**: [https://uno-km.github.io/amv-forge/](https://uno-km.github.io/amv-forge/)
233
+ * **Official Repository**: [https://github.com/uno-km/amv-forge](https://github.com/uno-km/amv-forge)
234
+ * **Community & Governance**: [https://github.com/uno-km/amv-forge/issues](https://github.com/uno-km/amv-forge/issues)
235
+ * **Sponsorship & Research Partnerships**: [https://github.com/uno-km](https://github.com/uno-km)
236
+
237
+ ---
238
+
239
+ ## Quality Assurance & Verification
240
+
241
+ Every release of amv-forge undergoes rigorous multi-tier verification:
242
+ * **292 Unit & Stress Tests**: 100% automated pass rate across CPU, GPU fallback, mathematical accuracy, and memory quota managers.
243
+ * **Finite-Difference Gradcheck**: Numerical gradient validation against analytical Vector-Jacobian backward formulations.
244
+ * **Memory Lifecycle Audit**: Zero-leak allocation token reclamation and buffer recycling verification across 10,000+ continuous execution cycles.
245
+
246
+ ---
247
+
248
+ ## License & Citation
249
+
250
+ amv-forge is licensed under the [MIT License](https://github.com/uno-km/amv-forge/blob/main/LICENSE).
251
+
252
+ ```bibtex
253
+ @software{ameva_forge_2026,
254
+ author = {AMEVA Foundation},
255
+ title = {amv-forge: High-Performance WebGPU-Accelerated Tensor Computation Engine},
256
+ year = {2026},
257
+ publisher = {GitHub},
258
+ url = {https://github.com/uno-km/amv-forge}
259
+ }
260
+ ```
261
+