# chinmaykamjith001/cugrad-v2- architecture

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

- Interactive diagram: https://gitdiagram.com/chinmaykamjith001/cugrad-v2-
- Repository: https://github.com/chinmaykamjith001/cugrad-v2-

## Overview

CuGrad is a from-scratch deep-learning engine, with a documented CUDA training workflow and older scalar and tensor implementations. The README describes the current engine’s tensor/autodiff, CUDA kernels, MLP, and SGD responsibilities, but the tree does not expose their internal modules or the README’s example engine filenames. Accordingly, those capabilities are represented at the available Main paths; detailed runtime links are limited to relationships documented in the README or visible in the sampled legacy code.

Main entry points: [`Main/CuGrad(GPU)`](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)) (CUDA training app), [`Main/CPU_Baseline`](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CPU_Baseline) (CPU baseline), [`Old_Scripts/scalar.cpp`](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Old_Scripts/scalar.cpp) (Scalar autodiff MLP), [`Old_Scripts/tensor.cpp`](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Old_Scripts/tensor.cpp) (Tensor autodiff MLP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Training workflow"]
  node_gpu_app["CUDA training app"]
  node_cpu_app["CPU baseline"]
  node_inputs["Training data"]
end

subgraph group_engine["Tensor engine"]
  node_mlp["MLP layers"]
  node_tensor["Tensor and autodiff"]
  node_cuda_ops["CUDA kernels"]
  node_sgd["SGD updates"]
end

subgraph group_legacy["Legacy implementations"]
  node_scalar["Scalar autodiff MLP<br/>[scalar.cpp]"]
  node_old_tensor["Tensor autodiff MLP<br/>[tensor.cpp]"]
  node_old_mytensor["Tensor experiment<br/>[mytensor.cpp]"]
end

node_user(("Training user"))

node_user -->|"runs training"| node_gpu_app
node_inputs -->|"supplies examples"| node_gpu_app
node_gpu_app -->|"trains network"| node_mlp
node_mlp -->|"composes operations"| node_tensor
node_tensor -->|"launches kernels"| node_cuda_ops
node_gpu_app -->|"updates parameters"| node_sgd
node_user -->|"runs comparison"| node_cpu_app
node_gpu_app -.->|"informed by"| node_scalar
node_gpu_app -.->|"earlier implementation"| node_old_tensor
node_gpu_app -.->|"earlier implementation"| node_old_mytensor

click node_gpu_app "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)"
click node_cpu_app "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CPU_Baseline"
click node_inputs "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)"
click node_mlp "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)"
click node_tensor "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)"
click node_cuda_ops "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)"
click node_sgd "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)"
click node_scalar "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Old_Scripts/scalar.cpp"
click node_old_tensor "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Old_Scripts/tensor.cpp"
click node_old_mytensor "https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Old_Scripts/mytensor.cpp"

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_gpu_app,node_cpu_app,node_inputs,node_user toneBlue
class node_mlp,node_tensor,node_cuda_ops,node_sgd toneAmber
class node_scalar,node_old_tensor,node_old_mytensor toneMint
```

## Components

### Training workflow

- [CUDA training app](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)): `Main/CuGrad(GPU)`
- [CPU baseline](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CPU_Baseline): `Main/CPU_Baseline`
- [Training data](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)): `Main/CuGrad(GPU)`

### Tensor engine

- [MLP layers](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)): `Main/CuGrad(GPU)`
- [Tensor and autodiff](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)): `Main/CuGrad(GPU)`
- [CUDA kernels](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)): `Main/CuGrad(GPU)`
- [SGD updates](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Main/CuGrad(GPU)): `Main/CuGrad(GPU)`

### Legacy implementations

- [Scalar autodiff MLP](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Old_Scripts/scalar.cpp): `Old_Scripts/scalar.cpp`
- [Tensor autodiff MLP](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Old_Scripts/tensor.cpp): `Old_Scripts/tensor.cpp`
- [Tensor experiment](https://github.com/chinmaykamjith001/cugrad-v2-/blob/main/Old_Scripts/mytensor.cpp): `Old_Scripts/mytensor.cpp`

### Other components

- **Training user**

## Connections

- Training user → CUDA training app: runs training (evidence: `README.md`)
- Training data → CUDA training app: supplies examples (evidence: `README.md`)
- CUDA training app → MLP layers: trains network (evidence: `README.md`)
- MLP layers → Tensor and autodiff: composes operations (evidence: `README.md`)
- Tensor and autodiff → CUDA kernels: launches kernels (evidence: `README.md`)
- CUDA training app → SGD updates: updates parameters (evidence: `README.md`)
- Training user → CPU baseline: runs comparison (evidence: `README.md`)
- CUDA training app → Scalar autodiff MLP: informed by
- CUDA training app → Tensor autodiff MLP: earlier implementation
- CUDA training app → Tensor experiment: earlier implementation
