# rakeshvarma007/wowml architecture

> Architecture diagram of the GitHub repository rakeshvarma007/wowml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rakeshvarma007/wowml
- Repository: https://github.com/rakeshvarma007/wowml

## Overview

WowML is a work-in-progress Python ML library backed by a custom C tensor kernel. Its intended workflow is to create and operate on tensors, build neural-network computations, differentiate them, and update parameters with an optimizer; data loading and linear algebra are additional capabilities. The Python tensor and autograd engine are explicitly incomplete, and the bindings are only a loader, so several workflow links are documented or tentative rather than verified calls.

Main entry points: [`wowml/tensor.py`](https://github.com/rakeshvarma007/wowml/blob/main/wowml/tensor.py) (Python Tensor), [`csrc/src/memory.c`](https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/memory.c) (C memory allocator), [`wowml/nn`](https://github.com/rakeshvarma007/wowml/tree/main/wowml/nn) (Layers and losses), [`csrc/src/tensor.c`](https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/tensor.c) (C tensor lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tensor_kernel["Tensor kernel"]
  node_c_tensor["C tensor lifecycle<br/>[tensor.c]"]
  node_c_memory["C memory allocator<br/>[memory.c]"]
  node_c_dtype["Dtype definitions<br/>[dtype.c]"]
  node_c_ops["Tensor operations<br/>[ops.c]"]
  node_c_matmul["Matrix multiplication<br/>[matmul.c]"]
  node_c_linalg["C linear algebra<br/>[linalg.c]"]
end

subgraph group_python_core["Python core"]
  node_py_tensor["Python Tensor<br/>[tensor.py]"]
  node_bindings["C bindings loader<br/>[_bindings.py]"]
  node_autograd_function["Autograd functions<br/>[function.py]"]
  node_autograd_engine["Gradient engine<br/>[engine.py]"]
  node_serialization["Serialization<br/>[serialization.py]"]
end

subgraph group_ml_workflow["ML workflow"]
  node_nn_module["Module framework<br/>[module.py]"]
  node_nn_layers["Layers and losses"]
  node_parameter["Trainable parameters<br/>[parameter.py]"]
  node_optimizer["Optimizer base<br/>[optimizer.py]"]
  node_optim_impl["SGD and Adam"]
end

subgraph group_data_linalg["Data and linear algebra"]
  node_dataset["Dataset abstraction<br/>[dataset.py]"]
  node_dataloader["DataLoader<br/>[dataloader.py]"]
  node_py_linalg["Linear algebra API"]
end

node_user(("Library user"))

node_user -->|"iterates"| node_dataloader
node_dataloader -->|"fetches samples"| node_dataset
node_user -.->|"creates tensors"| node_py_tensor
node_py_tensor -.->|"uses kernel"| node_bindings
node_bindings -.->|"loads library"| node_c_tensor
node_c_tensor -->|"allocates storage"| node_c_memory
node_c_ops -->|"allocates storage"| node_c_memory
node_c_matmul -->|"allocates storage"| node_c_memory
node_c_linalg -->|"allocates storage"| node_c_memory
node_c_tensor -->|"sizes elements"| node_c_dtype
node_user -->|"builds model"| node_nn_module
node_nn_module -->|"registers parameters"| node_parameter
node_nn_layers -->|"extends modules"| node_nn_module
node_nn_layers -->|"uses parameters"| node_parameter
node_nn_layers -->|"computes with"| node_py_tensor
node_user -.->|"requests gradients"| node_autograd_engine
node_autograd_engine -.->|"runs backward"| node_autograd_function
node_py_tensor -.->|"delegates backward"| node_autograd_engine
node_user -->|"updates model"| node_optim_impl
node_optim_impl -->|"extends base"| node_optimizer
node_optimizer -.->|"zeros gradients"| node_parameter
node_user -->|"uses solvers"| node_py_linalg
node_user -.->|"saves objects"| node_serialization

click node_py_tensor "https://github.com/rakeshvarma007/wowml/blob/main/wowml/tensor.py"
click node_bindings "https://github.com/rakeshvarma007/wowml/blob/main/wowml/_C/_bindings.py"
click node_c_tensor "https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/tensor.c"
click node_c_memory "https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/memory.c"
click node_c_dtype "https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/dtype.c"
click node_c_ops "https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/ops.c"
click node_c_matmul "https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/matmul.c"
click node_c_linalg "https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/linalg.c"
click node_autograd_function "https://github.com/rakeshvarma007/wowml/blob/main/wowml/autograd/function.py"
click node_autograd_engine "https://github.com/rakeshvarma007/wowml/blob/main/wowml/autograd/engine.py"
click node_nn_module "https://github.com/rakeshvarma007/wowml/blob/main/wowml/nn/module.py"
click node_nn_layers "https://github.com/rakeshvarma007/wowml/tree/main/wowml/nn"
click node_parameter "https://github.com/rakeshvarma007/wowml/blob/main/wowml/nn/parameter.py"
click node_optimizer "https://github.com/rakeshvarma007/wowml/blob/main/wowml/optim/optimizer.py"
click node_optim_impl "https://github.com/rakeshvarma007/wowml/tree/main/wowml/optim"
click node_dataset "https://github.com/rakeshvarma007/wowml/blob/main/wowml/data/dataset.py"
click node_dataloader "https://github.com/rakeshvarma007/wowml/blob/main/wowml/data/dataloader.py"
click node_py_linalg "https://github.com/rakeshvarma007/wowml/tree/main/wowml/linalg"
click node_serialization "https://github.com/rakeshvarma007/wowml/blob/main/wowml/utils/serialization.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_c_tensor,node_c_memory,node_c_dtype,node_c_ops,node_c_matmul,node_c_linalg,node_user toneBlue
class node_py_tensor,node_bindings,node_autograd_function,node_autograd_engine,node_serialization toneAmber
class node_nn_module,node_nn_layers,node_parameter,node_optimizer,node_optim_impl toneMint
class node_dataset,node_dataloader,node_py_linalg toneRose
```

## Components

### Tensor kernel

- [C tensor lifecycle](https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/tensor.c): `csrc/src/tensor.c`
- [C memory allocator](https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/memory.c): `csrc/src/memory.c`
- [Dtype definitions](https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/dtype.c): `csrc/src/dtype.c`
- [Tensor operations](https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/ops.c): `csrc/src/ops.c`
- [Matrix multiplication](https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/matmul.c): `csrc/src/matmul.c`
- [C linear algebra](https://github.com/rakeshvarma007/wowml/blob/main/csrc/src/linalg.c): `csrc/src/linalg.c`

### Python core

- [Python Tensor](https://github.com/rakeshvarma007/wowml/blob/main/wowml/tensor.py): `wowml/tensor.py`
- [C bindings loader](https://github.com/rakeshvarma007/wowml/blob/main/wowml/_C/_bindings.py): `wowml/_C/_bindings.py`
- [Autograd functions](https://github.com/rakeshvarma007/wowml/blob/main/wowml/autograd/function.py): `wowml/autograd/function.py`
- [Gradient engine](https://github.com/rakeshvarma007/wowml/blob/main/wowml/autograd/engine.py): `wowml/autograd/engine.py`
- [Serialization](https://github.com/rakeshvarma007/wowml/blob/main/wowml/utils/serialization.py): `wowml/utils/serialization.py`

### ML workflow

- [Module framework](https://github.com/rakeshvarma007/wowml/blob/main/wowml/nn/module.py): `wowml/nn/module.py`
- [Layers and losses](https://github.com/rakeshvarma007/wowml/tree/main/wowml/nn): `wowml/nn`
- [Trainable parameters](https://github.com/rakeshvarma007/wowml/blob/main/wowml/nn/parameter.py): `wowml/nn/parameter.py`
- [Optimizer base](https://github.com/rakeshvarma007/wowml/blob/main/wowml/optim/optimizer.py): `wowml/optim/optimizer.py`
- [SGD and Adam](https://github.com/rakeshvarma007/wowml/tree/main/wowml/optim): `wowml/optim`

### Data and linear algebra

- [Dataset abstraction](https://github.com/rakeshvarma007/wowml/blob/main/wowml/data/dataset.py): `wowml/data/dataset.py`
- [DataLoader](https://github.com/rakeshvarma007/wowml/blob/main/wowml/data/dataloader.py): `wowml/data/dataloader.py`
- [Linear algebra API](https://github.com/rakeshvarma007/wowml/tree/main/wowml/linalg): `wowml/linalg`

### Other components

- **Library user**

## Connections

- Library user → DataLoader: iterates (evidence: `README.md`)
- DataLoader → Dataset abstraction: fetches samples (evidence: `wowml/data/dataloader.py`)
- Library user → Python Tensor: creates tensors (evidence: `README.md`)
- Python Tensor → C bindings loader: uses kernel (evidence: `wowml/tensor.py`)
- C bindings loader → C tensor lifecycle: loads library (evidence: `README.md`)
- C tensor lifecycle → C memory allocator: allocates storage (evidence: `csrc/src/tensor.c`)
- Tensor operations → C memory allocator: allocates storage (evidence: `csrc/src/ops.c`)
- Matrix multiplication → C memory allocator: allocates storage (evidence: `csrc/src/matmul.c`)
- C linear algebra → C memory allocator: allocates storage (evidence: `csrc/src/linalg.c`)
- C tensor lifecycle → Dtype definitions: sizes elements (evidence: `csrc/src/tensor.c`)
- Library user → Module framework: builds model (evidence: `README.md`)
- Module framework → Trainable parameters: registers parameters (evidence: `wowml/nn/module.py`)
- Layers and losses → Module framework: extends modules (evidence: `wowml/nn/linear.py`)
- Layers and losses → Trainable parameters: uses parameters (evidence: `wowml/nn/linear.py`)
- Layers and losses → Python Tensor: computes with (evidence: `wowml/nn/linear.py`)
- Library user → Gradient engine: requests gradients (evidence: `README.md`)
- Gradient engine → Autograd functions: runs backward (evidence: `wowml/autograd/engine.py`)
- Python Tensor → Gradient engine: delegates backward (evidence: `wowml/tensor.py`)
- Library user → SGD and Adam: updates model (evidence: `README.md`)
- SGD and Adam → Optimizer base: extends base (evidence: `wowml/optim/sgd.py`)
- Optimizer base → Trainable parameters: zeros gradients (evidence: `wowml/optim/optimizer.py`)
- Library user → Linear algebra API: uses solvers (evidence: `README.md`)
- Library user → Serialization: saves objects (evidence: `wowml/utils/serialization.py`)
