amv-forge 2.0.0__py3-none-any.whl
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.
- amv_forge-2.0.0.dist-info/METADATA +260 -0
- amv_forge-2.0.0.dist-info/RECORD +34 -0
- amv_forge-2.0.0.dist-info/WHEEL +5 -0
- amv_forge-2.0.0.dist-info/top_level.txt +1 -0
- forge/__init__.py +229 -0
- forge/__init__.pyi +20 -0
- forge/autograd.py +306 -0
- forge/bridge.py +266 -0
- forge/data.py +130 -0
- forge/device.py +127 -0
- forge/distributions.py +221 -0
- forge/errors.py +83 -0
- forge/fft.py +138 -0
- forge/functional.py +937 -0
- forge/generated/__init__.py +3 -0
- forge/generated/op_schema.py +13 -0
- forge/graph.py +206 -0
- forge/linalg.py +128 -0
- forge/models/__init__.py +25 -0
- forge/models/llama.py +249 -0
- forge/models/nanogpt.py +182 -0
- forge/nn.py +1757 -0
- forge/nn.pyi +34 -0
- forge/ops.py +4271 -0
- forge/optim.py +911 -0
- forge/optim.pyi +15 -0
- forge/pipeline.py +159 -0
- forge/py.typed +1 -0
- forge/rl/__init__.py +19 -0
- forge/rl/cartpole.py +151 -0
- forge/serialization.py +101 -0
- forge/special.py +258 -0
- forge/tensor.py +1768 -0
- forge/tensor.pyi +66 -0
|
@@ -0,0 +1,260 @@
|
|
|
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
|
+
[](https://pypi.org/project/amv-forge/)
|
|
38
|
+
[](https://pypi.org/project/amv-forge/)
|
|
39
|
+
[](https://github.com/uno-km/amv-forge/blob/main/LICENSE)
|
|
40
|
+
[-brightgreen.svg)](https://github.com/uno-km/amv-forge)
|
|
41
|
+
[](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
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
forge/__init__.py,sha256=dK2zXcm5fy41T2XXy99jdwS-AgpD-PlGNRNaaROlPU4,8264
|
|
2
|
+
forge/__init__.pyi,sha256=ENmGiFdP3rqUMLTIZn63BVFqP4oK2braS4oNT0pHmLM,421
|
|
3
|
+
forge/autograd.py,sha256=MMrwebcHruSUU_xfOzTYWCK3hzSbVtK_2307rkvyCCo,13825
|
|
4
|
+
forge/bridge.py,sha256=CpnoSyKUB24tn4KZ7Z5sYLAE_5huSZPQyFN9FMcxCZU,10834
|
|
5
|
+
forge/data.py,sha256=05bymKhhCCdV4l0jY2ulPY-I0Z1H9U1WfwSnW0CNeEo,7183
|
|
6
|
+
forge/device.py,sha256=1fZV030cV08qtnFvoA4NJxrhvlVzJFvc-fBhOFRw_dE,6495
|
|
7
|
+
forge/distributions.py,sha256=rU6esE_WmALj-y0Q1RjKW2ZhPpwcAHHkoAcNYU-QJgk,8855
|
|
8
|
+
forge/errors.py,sha256=uMgyXnNRGmz_QlOifMjx0tOR1iipC-OUywNQMIoLZJE,2305
|
|
9
|
+
forge/fft.py,sha256=9kTt1C8W4iMYWd-rkGa_6rmqK6VIQc-3WSAqdYsDXlU,6477
|
|
10
|
+
forge/functional.py,sha256=c9cAK6UvGRaw2EEHESk5pLcbp0VzsMut_1BUh7g_RmA,43413
|
|
11
|
+
forge/graph.py,sha256=7HkHuetOF9NEAR1U8_rwyW2hGvX1IVgXjvhIdooKpXg,10271
|
|
12
|
+
forge/linalg.py,sha256=ZDc3ZeOuzOGpXBkuuErY3fUgEUf8wYI9LMwhcHedOKo,5708
|
|
13
|
+
forge/nn.py,sha256=r4Vm2n9qXA8lhqkt69Pw35rrpnIG1KM86wqsz5awYzQ,88706
|
|
14
|
+
forge/nn.pyi,sha256=p1epAZGOokCZo7EQ8N0KIiJWBHyF1M5vgJZBRiq88-A,1159
|
|
15
|
+
forge/ops.py,sha256=tKWTeFTOAfZF8jyXOkZNDhdrIhyEP54KeRg2MXYaz88,210408
|
|
16
|
+
forge/optim.py,sha256=Y-qnWygPPKuzbz4WCd-4oOk2tWXCKKTuISkXxU7EXD4,43765
|
|
17
|
+
forge/optim.pyi,sha256=0DDDNQXpdn_giivT8UzTJguvyJ534M1pnD3_G_UNEWs,487
|
|
18
|
+
forge/pipeline.py,sha256=ZZbvxfJedyGMU297mV3aCv1ZASrB4xOlEv-gLXPjePw,6322
|
|
19
|
+
forge/py.typed,sha256=ZSegze1ahS5tlaVlEVAF0HG-jTkkScOwTjUnglYQOS8,22
|
|
20
|
+
forge/serialization.py,sha256=XgHEixELxAbcMNHqv1BY93at5t8LzvSZsQw5eDm59eo,5114
|
|
21
|
+
forge/special.py,sha256=_IjKwmVU05f8Dy0oQLWiCdF35CXCFYwzHw9x-W13vuM,10178
|
|
22
|
+
forge/tensor.py,sha256=JJDugRK8U85lhIQ3WsZNXojBn_5tPO5pTVGkuAnNSCA,79457
|
|
23
|
+
forge/tensor.pyi,sha256=a73RhYYShb5HjlsIJvnGwdI_d3prMWJtreus0kto8vc,2205
|
|
24
|
+
forge/generated/__init__.py,sha256=aWydFp3Yrw_rjO3C1ZSbDLf4Hp0yJrlfVm8XipDxjhw,168
|
|
25
|
+
forge/generated/op_schema.py,sha256=UJCvW2QHNcsaRw00hhXfN-Y-Eb3OoHr99RfvrmS4oE8,2077
|
|
26
|
+
forge/models/__init__.py,sha256=IXGE6k1aq-19XcTGcup6445I9Ahic6YbwgwfP4IMF30,798
|
|
27
|
+
forge/models/llama.py,sha256=XcxZFwtS31adqgg2CxojMGqZLWPwdMSq9VETk8KjIlY,10437
|
|
28
|
+
forge/models/nanogpt.py,sha256=iUU4ZVb8XP6L47dEstA-rbBHOAxoVIkf_ljRhqZvyn4,6677
|
|
29
|
+
forge/rl/__init__.py,sha256=DA-t-2B4AEYz9DRjxkeJaBtJuuqXimOEhSjRj1KsCAY,652
|
|
30
|
+
forge/rl/cartpole.py,sha256=8Ana2x4eIeAFbp4okGOhaj33y0ypLNmJkasKRB7MnTs,5513
|
|
31
|
+
amv_forge-2.0.0.dist-info/METADATA,sha256=MLXStBm9N65hocQbIlYTcS_blbpsVTi4wqpLFNkbnsA,11902
|
|
32
|
+
amv_forge-2.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
33
|
+
amv_forge-2.0.0.dist-info/top_level.txt,sha256=sDbe4KjRUBYyB4IABQOjHzoomNKH_4KwOv5fPPrv4ME,6
|
|
34
|
+
amv_forge-2.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
forge
|
forge/__init__.py
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# Copyright (c) 2026 Uno Kim / AMEVA Foundation. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0 OR Commercial-License
|
|
3
|
+
"""
|
|
4
|
+
__init__.py ??forge ?�키지 공개 API
|
|
5
|
+
|
|
6
|
+
M-07 Fix: wildcard import ?�거 ??명시??__all__ ?�의.
|
|
7
|
+
NL-05 Fix: ones_like�?공개 API??추�?.
|
|
8
|
+
NL-07 Fix: Quota ?��?.
|
|
9
|
+
|
|
10
|
+
================================================================================
|
|
11
|
+
?�일 ?�력 (Historical Metadata)
|
|
12
|
+
Created: 2026-08-12 12:14:52 +0900 (�?커밋 기�?)
|
|
13
|
+
Modified:
|
|
14
|
+
- 2026-08-12 12:59:35 +0900: Feat: Introduce v3.0 features (CNN, Pooling, Dropout, Serialization)
|
|
15
|
+
- 2026-08-12 12:23:09 +0900: Docs: Build Apache-style docs and unify tests
|
|
16
|
+
- 2026-08-12 12:14:52 +0900: Refactor: Rename AMEVA-Tensor to amv-forge and reorganize directories
|
|
17
|
+
================================================================================
|
|
18
|
+
WHAT: amv-forge ?�키지??주요 컴포?�트?�을 ??곳에 모아 ?��????�출?�는 진입???�일?�니??
|
|
19
|
+
WHY: ?�용?��? ?�키지 ?��? 구조�????�요 ?�이 최상??모듈?�서 ?�리?�게 ?�요??기능?�을 가?�다 ?????�도�??�기 ?�함?�니??
|
|
20
|
+
HOW: ?��???�??�브모듈(ops, tensor, nn, optim ???�서 ?�요???�래?�나 ?�수�?명시?�으�??�포?�하??__all__ 리스?��? ?�해 ?�출?�니??
|
|
21
|
+
"""
|
|
22
|
+
# ?�드?�어 ?�바?�스 초기??�??�태 관�?관??모듈 ?�포??
|
|
23
|
+
from .device import init, is_available, current_device
|
|
24
|
+
# 기본 ?�서 ?�산 �??�학/배열 조작 ?�수?�을 ops 모듈?�서 ?�포??
|
|
25
|
+
from .ops import (
|
|
26
|
+
tensor, random, randn, matmul, relu, add, sub, mul, div, neg, transpose,
|
|
27
|
+
ones_like, zeros_like, zeros, ones, full, # NL-05: 공개 API??추�?
|
|
28
|
+
to_numpy, to_numpy_async, dispose,
|
|
29
|
+
unsqueeze, squeeze, flatten, permute, max_op, max_axis, var, std, sqrt,
|
|
30
|
+
cat, where, pad, gather, scatter, dropout, conv2d, max_pool2d, avg_pool2d, bmm,
|
|
31
|
+
maximum, minimum, clamp,
|
|
32
|
+
arange, eye, linspace, triu, tril,
|
|
33
|
+
adaptive_avg_pool2d, adaptive_max_pool2d,
|
|
34
|
+
binary_cross_entropy_with_logits, smooth_l1_loss, kl_div, l1_loss,
|
|
35
|
+
topk, sort, argsort, TopKResult, SortResult,
|
|
36
|
+
isnan, isinf, isfinite, isclose, allclose, any_op, all_op,
|
|
37
|
+
conv1d, pixel_shuffle, pixel_unshuffle, interpolate,
|
|
38
|
+
stack, chunk, split, unbind,
|
|
39
|
+
multinomial, randint, bernoulli, normal,
|
|
40
|
+
roll, repeat_interleave, meshgrid, diag, diagonal, trace, outer,
|
|
41
|
+
masked_fill, index_select, masked_select, nonzero, take_along_dim,
|
|
42
|
+
cumprod, unflatten, cdist, norm, atleast_1d, atleast_2d, atleast_3d,
|
|
43
|
+
einsum, kron, tensordot, nan_to_num,
|
|
44
|
+
conv_transpose2d, affine_grid, grid_sample
|
|
45
|
+
)
|
|
46
|
+
any = any_op
|
|
47
|
+
all = all_op
|
|
48
|
+
# ?�서 객체 ?�체�??�의?�는 ?�래??�?GC ?�수 ?�포??
|
|
49
|
+
from .tensor import Tensor, Parameter, flush_gc
|
|
50
|
+
# ?�동 미분 기능 관??모듈 ?�포??
|
|
51
|
+
from .autograd import no_grad, enable_grad, is_grad_enabled, set_grad_enabled, set_max_graph_nodes
|
|
52
|
+
# ?�버�?모드�??�정?�고 가?�오???�틸리티 ?�수 ?�포??
|
|
53
|
+
from .ops import set_debug_mode, get_debug_mode
|
|
54
|
+
# ?�키지 ?�에??발생?????�는 ?�러 커스?� ?�러 ?�래??모음 ?�포??
|
|
55
|
+
from .errors import (
|
|
56
|
+
AMEVAForgeError,
|
|
57
|
+
AMEVAForgeShapeError,
|
|
58
|
+
AMEVAForgeDTypeError,
|
|
59
|
+
AMEVAForgeDeviceError,
|
|
60
|
+
AMEVAForgeDisposedError,
|
|
61
|
+
AMEVAForgeWebGPUUnavailableError,
|
|
62
|
+
AMEVAForgeQuotaExceededError, # NL-07: TypeScript?� ?��?
|
|
63
|
+
AMEVAForgeSecurityError, # NL-07: TypeScript?� ?��?
|
|
64
|
+
AMEVAForgeValidationError,
|
|
65
|
+
AMEVAForgeOutOfMemoryError,
|
|
66
|
+
AMEVAForgeInternalGPUError,
|
|
67
|
+
AMEVAForgeDeviceLostError,
|
|
68
|
+
AMEVAForgeStaleHandleError,
|
|
69
|
+
AMEVAForgeUnsupportedOperationError,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
# WHAT: ?�키지 버전???�의?�는 변?�입?�다.
|
|
73
|
+
# WHY: ?�키지 ?�용?�나 ?�른 ?�구가 ?�재 ?�치???�키지??버전???�인?????�게 ?�니??
|
|
74
|
+
# HOW: 문자???�태�?버전???�?�하???��??�서 ?�근 가?�하�??�니??
|
|
75
|
+
__version__ = "1.0.1"
|
|
76
|
+
|
|
77
|
+
# 기본 ?�계 �??�학 ?�산 ?�수?�을 ?�의???�른 ?�름?�로 매핑?�여 ?�포??
|
|
78
|
+
from .ops import sum_op as sum, mean_op as mean, exp_op as exp, log_op as log
|
|
79
|
+
from .ops import sigmoid, tanh_op as tanh, reshape, sum_axis, gelu, silu, leaky_relu, elu
|
|
80
|
+
# ?�경�?구성 ?�소가 ?�는 nn ?�브모듈�?관???�이???�포??
|
|
81
|
+
from . import nn
|
|
82
|
+
from .nn import (
|
|
83
|
+
BatchNorm2d, Dropout, LayerNorm, MultiheadAttention, TransformerEncoderLayer,
|
|
84
|
+
PositionalEncoding, RNNCell, LSTMCell, RNN, LSTM, RMSNorm, RotaryEmbedding, SwiGLU,
|
|
85
|
+
Sequential, ModuleList, ModuleDict, ParameterList, ParameterDict, Parameter,
|
|
86
|
+
GELU, SiLU, LeakyReLU, ELU, CosineSimilarity,
|
|
87
|
+
Identity, ConstantPad2d, ZeroPad2d, ReflectionPad2d, ReplicationPad2d,
|
|
88
|
+
AdaptiveAvgPool2d, AdaptiveMaxPool2d,
|
|
89
|
+
CrossEntropyLoss, MSELoss, L1Loss, BCEWithLogitsLoss, SmoothL1Loss, KLDivLoss,
|
|
90
|
+
TripletMarginLoss, CosineEmbeddingLoss, MarginRankingLoss,
|
|
91
|
+
Conv1d, ConvTranspose2d, PixelShuffle, PixelUnshuffle, Upsample
|
|
92
|
+
)
|
|
93
|
+
# 최적???�고리즘???�는 optim ?�브모듈�??�습�??��?줄러 ?�포??
|
|
94
|
+
from . import optim
|
|
95
|
+
from .optim import clip_grad_norm, clip_grad_norm_, clip_grad_value, clip_grad_value_, StepLR, CosineAnnealingLR, ReduceLROnPlateau
|
|
96
|
+
# 모델 ?�??�?로드 ?�틸리티 ?�포??
|
|
97
|
+
from .serialization import save_model, load_model
|
|
98
|
+
# ?�수??API 묶음 ?�포??
|
|
99
|
+
from . import functional as F
|
|
100
|
+
from .functional import batch_norm2d, scaled_dot_product_attention, rms_norm, swiglu, rope
|
|
101
|
+
# ?�이??로드 ?�틸리티 ?�포??
|
|
102
|
+
from .data import DataLoader
|
|
103
|
+
# 고수준 AI 모델, 강화?�습, ?�이?�라??모듈 ?�포??
|
|
104
|
+
from . import models
|
|
105
|
+
from . import rl
|
|
106
|
+
from . import linalg
|
|
107
|
+
from . import fft
|
|
108
|
+
from . import special
|
|
109
|
+
from .special import erf, erfc, erfinv, expm1, log1p, sinc
|
|
110
|
+
from . import distributions
|
|
111
|
+
from .pipeline import pipeline
|
|
112
|
+
|
|
113
|
+
# WHAT: ?��??�서 `from forge import *`�??�출?????�출???�름?�의 리스?�입?�다.
|
|
114
|
+
# WHY: ?�키지 ?��??�서�??�이???�겨�?private) 모듈?�나 변?��? ?�수�??�출?��? ?�도�??�어?�기 ?�해 ?�용?�니??
|
|
115
|
+
# HOW: ?��???공개?�야 ???�수, ?�래?? ?�브모듈?�의 ?�름??문자??리스?�로 모아???�의?�니??
|
|
116
|
+
__all__ = [
|
|
117
|
+
"linalg",
|
|
118
|
+
"fft",
|
|
119
|
+
"special",
|
|
120
|
+
"distributions",
|
|
121
|
+
"erf",
|
|
122
|
+
"erfc",
|
|
123
|
+
"erfinv",
|
|
124
|
+
"expm1",
|
|
125
|
+
"log1p",
|
|
126
|
+
"sinc",
|
|
127
|
+
# 초기??
|
|
128
|
+
"init",
|
|
129
|
+
"is_available",
|
|
130
|
+
"current_device",
|
|
131
|
+
# ?�서 ?�성
|
|
132
|
+
"tensor",
|
|
133
|
+
"random",
|
|
134
|
+
"randn",
|
|
135
|
+
"ones_like",
|
|
136
|
+
"zeros_like",
|
|
137
|
+
"zeros",
|
|
138
|
+
"sum",
|
|
139
|
+
"mean",
|
|
140
|
+
"exp",
|
|
141
|
+
"log",
|
|
142
|
+
"sigmoid",
|
|
143
|
+
"tanh",
|
|
144
|
+
"reshape",
|
|
145
|
+
"sum_axis",
|
|
146
|
+
"nn",
|
|
147
|
+
"optim",
|
|
148
|
+
"models",
|
|
149
|
+
"rl",
|
|
150
|
+
"pipeline",
|
|
151
|
+
"F",
|
|
152
|
+
"DataLoader",
|
|
153
|
+
"ones",
|
|
154
|
+
"full",
|
|
155
|
+
"Tensor",
|
|
156
|
+
"flush_gc",
|
|
157
|
+
"no_grad",
|
|
158
|
+
"BatchNorm2d",
|
|
159
|
+
"Dropout",
|
|
160
|
+
"LayerNorm",
|
|
161
|
+
"RMSNorm",
|
|
162
|
+
"RotaryEmbedding",
|
|
163
|
+
"SwiGLU",
|
|
164
|
+
"MultiheadAttention",
|
|
165
|
+
"TransformerEncoderLayer",
|
|
166
|
+
"PositionalEncoding",
|
|
167
|
+
"RNNCell",
|
|
168
|
+
"LSTMCell",
|
|
169
|
+
"RNN",
|
|
170
|
+
"LSTM",
|
|
171
|
+
"batch_norm2d",
|
|
172
|
+
"scaled_dot_product_attention",
|
|
173
|
+
"rms_norm",
|
|
174
|
+
"swiglu",
|
|
175
|
+
"rope",
|
|
176
|
+
"dropout",
|
|
177
|
+
"bmm",
|
|
178
|
+
# ?�산
|
|
179
|
+
"matmul",
|
|
180
|
+
"relu",
|
|
181
|
+
"add",
|
|
182
|
+
"sub",
|
|
183
|
+
"mul",
|
|
184
|
+
"div",
|
|
185
|
+
"neg",
|
|
186
|
+
"transpose",
|
|
187
|
+
"cat",
|
|
188
|
+
"where",
|
|
189
|
+
"pad",
|
|
190
|
+
"gather",
|
|
191
|
+
"scatter",
|
|
192
|
+
"conv2d",
|
|
193
|
+
"max_pool2d",
|
|
194
|
+
"avg_pool2d",
|
|
195
|
+
# ?�틸
|
|
196
|
+
"to_numpy",
|
|
197
|
+
"to_numpy_async",
|
|
198
|
+
"dispose",
|
|
199
|
+
# ?�러
|
|
200
|
+
"AMEVAForgeError",
|
|
201
|
+
"AMEVAForgeShapeError",
|
|
202
|
+
"AMEVAForgeDTypeError",
|
|
203
|
+
"AMEVAForgeDeviceError",
|
|
204
|
+
"AMEVAForgeDisposedError",
|
|
205
|
+
"AMEVAForgeWebGPUUnavailableError",
|
|
206
|
+
"AMEVAForgeQuotaExceededError",
|
|
207
|
+
"AMEVAForgeSecurityError",
|
|
208
|
+
"AMEVAForgeValidationError",
|
|
209
|
+
"AMEVAForgeOutOfMemoryError",
|
|
210
|
+
"AMEVAForgeInternalGPUError",
|
|
211
|
+
"AMEVAForgeDeviceLostError",
|
|
212
|
+
"AMEVAForgeStaleHandleError",
|
|
213
|
+
"AMEVAForgeUnsupportedOperationError",
|
|
214
|
+
# ?�버�??�정/Autograd
|
|
215
|
+
"no_grad",
|
|
216
|
+
"enable_grad",
|
|
217
|
+
"is_grad_enabled",
|
|
218
|
+
"set_grad_enabled",
|
|
219
|
+
"set_debug_mode",
|
|
220
|
+
"get_debug_mode",
|
|
221
|
+
"set_max_graph_nodes",
|
|
222
|
+
# 메�?
|
|
223
|
+
"__version__",
|
|
224
|
+
"unsqueeze", "squeeze", "flatten", "permute",
|
|
225
|
+
"max_op", "max_axis", "var", "std", "sqrt",
|
|
226
|
+
"clip_grad_norm", "clip_grad_value",
|
|
227
|
+
"StepLR", "CosineAnnealingLR", "ReduceLROnPlateau",
|
|
228
|
+
"save_model", "load_model"
|
|
229
|
+
]
|
forge/__init__.pyi
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from typing import Any, Sequence, Union, Optional
|
|
2
|
+
import numpy as np
|
|
3
|
+
from .tensor import Tensor, tensor
|
|
4
|
+
from . import nn as nn
|
|
5
|
+
from . import optim as optim
|
|
6
|
+
from . import functional as functional
|
|
7
|
+
from .device import is_available, init_webgpu
|
|
8
|
+
|
|
9
|
+
__version__: str
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"Tensor",
|
|
13
|
+
"tensor",
|
|
14
|
+
"nn",
|
|
15
|
+
"optim",
|
|
16
|
+
"functional",
|
|
17
|
+
"is_available",
|
|
18
|
+
"init_webgpu",
|
|
19
|
+
"__version__",
|
|
20
|
+
]
|