Skip to main content

amv-forge (amv-forge)

PyPI Version Python Version License Test Suite WebGPU Acceleration

High-Performance Client-Side Tensor Computation Engine & Reverse-Mode Autograd Framework Powered by WebGPU.

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).


Architectural Pillars

+-----------------------------------------------------------------------------------+
|                            amv-forge User Space                                 |
|   forge.nn  |  forge.optim  |  forge.linalg  |  forge.fft  |  forge.distributions |
+-----------------------------------------------------------------------------------+
|                      Reverse-Mode Autograd DAG Engine                             |
|       Vector-Jacobian Products (VJP)  *  In-Place Mutation Version Locks          |
+-----------------------------------------------------------------------------------+
|                         Hardware Abstraction Layer                                |
|   CPU Backend (Vectorized C/NumPy)  <--->  WebGPU Backend (Async WGSL Kernels)    |
|   Staging Buffer Recycling Pool     <--->  Zero-Leak Allocation Token Ring        |
+-----------------------------------------------------------------------------------+
  1. Deterministic Autograd & Topological Execution
    Strict reverse-mode automatic differentiation graph with cycle detection, multi-output tuple bindings, in-place version invalidation, and scalar-tensor memory optimization.
  2. WebGPU Hardware Acceleration
    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.
  3. PyTorch 1:1 API Parity
    Seamless drop-in compatibility across neural layers (nn.Module, nn.MultiheadAttention, nn.Conv2d), mathematical primitives (linalg, fft, special), and probabilistic graphical models (distributions).
  4. Zero-Server Infrastructure (Edge & Browser)
    Execute full model fine-tuning and inference directly inside the browser using Pyodide and WebGPU with zero cloud compute cost and total data privacy.

Installation

Install the official package from PyPI:

pip install amv-forge

Or install from source with development dependencies:

git clone https://github.com/uno-km/amv-forge.git
cd amv-forge/packages/forge-py
pip install -e .

Quick Start

1. Basic Tensor & Automated Differentiation

import forge as fg

# Initialize tensors with gradient tracking
x = fg.tensor([[1.0, 2.0], [3.0, 4.0]], requires_grad=True)
w = fg.tensor([[0.5, -0.5], [1.0, 2.0]], requires_grad=True)
b = fg.tensor([0.1, -0.1], requires_grad=True)

# Forward pass: Linear projection + GELU activation
y = fg.matmul(x, w) + b
loss = fg.sum(fg.nn.functional.gelu(y))

# Compute Vector-Jacobian Products (Autograd backward)
loss.backward()

print("Loss Value :", loss.numpy())
print("Gradient dL/dw :\n", w.grad.numpy())

2. Character-Level Transformer (NanoGPT)

Train a complete causal autoregressive transformer directly on your local device:

import forge as fg
import forge.nn as nn
from forge.models.nanogpt import GPT, GPTConfig

# Define model configuration
config = GPTConfig(
    block_size=32,
    vocab_size=64,
    n_layer=4,
    n_head=4,
    n_embd=64,
    bias=False
)
model = GPT(config)
optimizer = fg.optim.AdamW(model.parameters(), lr=1e-3, weight_decay=1e-2)
criterion = nn.CrossEntropyLoss()

# Training step (Batch Size: 8, Sequence Length: 32)
input_tokens = fg.tensor([[1, 5, 12, 3]], dtype="int32")
target_tokens = fg.tensor([[5, 12, 3, 18]], dtype="int32")

optimizer.zero_grad()
logits = model(input_tokens)
loss = criterion(logits, target_tokens)
loss.backward()
optimizer.step()

3. Speech-to-Text & Acoustic Signal Processing (forge.fft + forge.nn)

Compute real Fourier Mel-spectrograms from raw acoustic waveforms:

import forge as fg
import forge.nn as nn

# 16kHz PCM audio waveform (Batch: 4, Samples: 8000)
raw_audio = fg.tensor(audio_data, dtype="float32")

# Fast Fourier Transform (Complex Spectrum)
fft_complex = fg.fft.rfft(raw_audio, n=1024, dim=-1)

# Power Spectrogram Energy
power_spec = (fft_complex.real.pow(2.0) + fft_complex.imag.pow(2.0) + 1e-6).log()

# 1D Convolutional Audio Feature Extractor
conv = nn.Conv1d(in_channels=513, out_channels=64, kernel_size=3, padding=1)
audio_features = conv(power_spec)

Comprehensive Module Directory

Module Core Functionality Key Operators / Classes
forge Core Tensor Engine & Factories tensor, zeros, ones, randn, matmul, einsum, reshape, permute, where
forge.nn Deep Learning Layers & Containers Linear, Conv1d, Conv2d, MultiheadAttention, LayerNorm, RMSNorm, BatchNorm2d, Embedding, CrossEntropyLoss, MSELoss
forge.optim Optimizers & Rate Schedulers SGD, Adam, AdamW, RMSprop, CosineAnnealingLR, StepLR
forge.linalg Linear Algebra Decomposition norm, svd, qr, cholesky, inv, pinv, det, matrix_rank, solve, eigh
forge.fft Discrete Fourier Transforms rfft, irfft, fft, ifft, fft2, ifft2, rfft2, irfft2, fftfreq, fftshift
forge.special Transcendental & Error Functions erf, erfc, erfinv, gammaln, digamma, expm1, log1p, expit, logit, sinc, i0, xlogy
forge.distributions Probability Distributions & KL Normal(rsample), Uniform, Bernoulli, Categorical, kl_divergence
forge.models Pre-architected Reference Models GPT, GPTConfig, LLaMA

In-Browser Zero-Install Execution (WebGPU + Pyodide)

amv-forge packages a single bundled JavaScript distribution (forge-py-bundle.js) that mounts into browser-native Pyodide runtimes:

<script src="https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js"></script>
<script src="https://uno-km.github.io/amv-forge/dist/forge-py-bundle.js"></script>
<script>
  async function runClientDeepLearning() {
    let pyodide = await loadPyodide();
    await window.loadAmevaForgeBundle(pyodide);
    
    await pyodide.runPythonAsync(`
      import forge as fg
      x = fg.randn((1024, 1024), device="gpu")
      y = fg.matmul(x, x)
      print("Computed 1024x1024 on WebGPU Hardware:", y.shape)
    `);
  }
  runClientDeepLearning();
</script>

?Œ The AMEVA Foundation (?„ë©”ë°??¬ë‹¨)

amv-forge is an open-source deep learning initiative created and governed by the AMEVA Foundation (?„ë©”ë°??¬ë‹¨).

?ޝ Our Mission & Zero-Server Paradigm

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.

?ŒŸ Core Foundation Initiatives

  • ?Œ amv-forge Tensor Engine: High-performance WebGPU tensor computation & reverse-mode autograd engine.
  • ?Ž™ï¸?On-Device Whisper STT: Real-time acoustic FFT signal processing & speech recognition running locally in browser.
  • ?¤– Decentralized LLM Transformers: Zero-install character and subword transformer models with zero cloud dependency.
  • ?”’ Privacy-First AI Sovereignty: Sovereign on-device machine learning where private data never leaves client silicon.

Quality Assurance & Verification

Every release of amv-forge undergoes rigorous multi-tier verification:

  • 292 Unit & Stress Tests: 100% automated pass rate across CPU, GPU fallback, mathematical accuracy, and memory quota managers.
  • Finite-Difference Gradcheck: Numerical gradient validation against analytical Vector-Jacobian backward formulations.
  • Memory Lifecycle Audit: Zero-leak allocation token reclamation and buffer recycling verification across 10,000+ continuous execution cycles.

License & Citation

amv-forge is licensed under the MIT License.

@software{ameva_forge_2026,
  author = {AMEVA Foundation},
  title = {amv-forge: High-Performance WebGPU-Accelerated Tensor Computation Engine},
  year = {2026},
  publisher = {GitHub},
  url = {https://github.com/uno-km/amv-forge}
}

Metadata

Release files for amv-forge 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amv-forge 2.0.0
File Size Uploaded Provenance Actions
amv_forge-2.0.0.tar.gz 190.1 kB Without provenance Details for amv_forge-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amv-forge 2.0.0
File Interpreter ABI Platform Actions
amv_forge-2.0.0-py3-none-any.whl Python 3 none any Details for amv_forge-2.0.0-py3-none-any.whl

Total release size: 348.4 kB

Release files / amv_forge-2.0.0.tar.gz

Download URL amv_forge-2.0.0.tar.gz
Size 190.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a2a2f359d95a834c7890cc87fe55b843ca25632866a48e3fa9e581299b77912e
BLAKE2b-256 checksum
How to use checksums
de535cd9f76d7894390fa1d3317f6374c3128903b32fa99fd886613daf939b54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Release files / amv_forge-2.0.0-py3-none-any.whl

Download URL amv_forge-2.0.0-py3-none-any.whl
Size 158.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7505c8117f01e2d9f164939d3f33d03559a5e3eeb9eb1f0a9ec3db577be25ff6
BLAKE2b-256 checksum
How to use checksums
176703801d21b6f5858f27eb948457bcaa5a02a822486da223654302ecb55da6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Security for amv-forge 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page