# nvidia/warp architecture

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

- Interactive diagram: https://gitdiagram.com/nvidia/warp
- Repository: https://github.com/nvidia/warp

## Overview

Warp is a Python framework that turns Python kernel functions into CPU- or GPU-executable code for simulation, robotics, geometry processing, and machine learning. A typical user defines kernels and data through the public Python API, launches them on a device, and receives updated arrays; the README also identifies differentiable kernels and framework integration as major capabilities. The graph includes compilation/runtime, autodiff, FEM, geometry, sparse operations, optimization, and rendering. Some subsystem links reflect documented capabilities and tree structure; their detailed internal call wiring was not sampled.

Main entry points: [`warp/__init__.py`](https://github.com/nvidia/warp/blob/main/warp/__init__.py) (Warp API), [`warp/_src/codegen.py`](https://github.com/nvidia/warp/blob/main/warp/_src/codegen.py) (JIT compiler), [`warp/native/warp.cpp`](https://github.com/nvidia/warp/blob/main/warp/native/warp.cpp) (Native runtime), [`warp/_src/context.py`](https://github.com/nvidia/warp/blob/main/warp/_src/context.py) (Device context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Python API"]
  node_public["Warp API<br/>[__init__.py]"]
  node_language["Kernel language<br/>[lang.py]"]
  node_types["Types and math<br/>[types.py]"]
end

subgraph group_execution["Kernel Execution"]
  node_compiler["JIT compiler<br/>[codegen.py]"]
  node_module["Module registry<br/>[module_registry.py]"]
  node_context["Device context<br/>[context.py]"]
  node_native["Native runtime<br/>[warp.cpp]"]
end

subgraph group_simulation["Simulation Numerics"]
  node_fem["Finite elements<br/>[integrate.py]"]
  node_geometry["Geometry processing<br/>[__init__.py]"]
  node_sparse["Sparse operations<br/>[sparse.py]"]
end

subgraph group_learning["Differentiation"]
  node_tape["Autodiff tape<br/>[tape.py]"]
  node_autograd["Autograd<br/>[autograd.py]"]
  node_optim["Optimizers<br/>[__init__.py]"]
end

subgraph group_interop["Interoperability"]
  node_torch["PyTorch bridge<br/>[torch.py]"]
  node_jax["JAX bridge<br/>[__init__.py]"]
  node_paddle["Paddle bridge<br/>[paddle.py]"]
  node_render["Rendering<br/>[__init__.py]"]
end

node_developer(("Python user"))
node_device(("CPU or GPU"))

node_developer -->|"uses"| node_public
node_public -->|"defines kernels"| node_language
node_public -->|"creates data"| node_types
node_public -->|"selects device"| node_context
node_public -->|"launches kernels"| node_compiler
node_compiler -->|"registers code"| node_module
node_compiler -->|"compiles for"| node_native
node_context -->|"dispatches execution"| node_native
node_native -->|"executes kernels"| node_device
node_public -->|"records launches"| node_tape
node_tape -->|"computes gradients"| node_autograd
node_autograd -->|"supports updates"| node_optim
node_public -->|"provides FEM"| node_fem
node_public -->|"provides geometry"| node_geometry
node_public -->|"provides sparse ops"| node_sparse
node_torch -.->|"integrates with"| node_public
node_jax -.->|"integrates with"| node_public
node_paddle -.->|"integrates with"| node_public
node_public -->|"provides rendering"| node_render

click node_public "https://github.com/nvidia/warp/blob/main/warp/__init__.py"
click node_language "https://github.com/nvidia/warp/blob/main/warp/_src/lang.py"
click node_types "https://github.com/nvidia/warp/blob/main/warp/_src/types.py"
click node_compiler "https://github.com/nvidia/warp/blob/main/warp/_src/codegen.py"
click node_module "https://github.com/nvidia/warp/blob/main/warp/_src/module_registry.py"
click node_context "https://github.com/nvidia/warp/blob/main/warp/_src/context.py"
click node_native "https://github.com/nvidia/warp/blob/main/warp/native/warp.cpp"
click node_tape "https://github.com/nvidia/warp/blob/main/warp/_src/tape.py"
click node_autograd "https://github.com/nvidia/warp/blob/main/warp/_src/autograd.py"
click node_fem "https://github.com/nvidia/warp/blob/main/warp/_src/fem/integrate.py"
click node_geometry "https://github.com/nvidia/warp/blob/main/warp/_src/geometry/__init__.py"
click node_sparse "https://github.com/nvidia/warp/blob/main/warp/_src/sparse.py"
click node_optim "https://github.com/nvidia/warp/blob/main/warp/_src/optim/__init__.py"
click node_torch "https://github.com/nvidia/warp/blob/main/warp/_src/torch.py"
click node_jax "https://github.com/nvidia/warp/blob/main/warp/_src/jax/__init__.py"
click node_paddle "https://github.com/nvidia/warp/blob/main/warp/_src/paddle.py"
click node_render "https://github.com/nvidia/warp/blob/main/warp/_src/render/__init__.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_public,node_language,node_types,node_developer toneBlue
class node_compiler,node_module,node_context,node_native toneAmber
class node_fem,node_geometry,node_sparse toneMint
class node_tape,node_autograd,node_optim toneRose
class node_torch,node_jax,node_paddle,node_render,node_device toneIndigo
```

## Components

### Python API

- [Warp API](https://github.com/nvidia/warp/blob/main/warp/__init__.py): `warp/__init__.py`
- [Kernel language](https://github.com/nvidia/warp/blob/main/warp/_src/lang.py): `warp/_src/lang.py`
- [Types and math](https://github.com/nvidia/warp/blob/main/warp/_src/types.py): `warp/_src/types.py`

### Kernel Execution

- [JIT compiler](https://github.com/nvidia/warp/blob/main/warp/_src/codegen.py): `warp/_src/codegen.py`
- [Module registry](https://github.com/nvidia/warp/blob/main/warp/_src/module_registry.py): `warp/_src/module_registry.py`
- [Device context](https://github.com/nvidia/warp/blob/main/warp/_src/context.py): `warp/_src/context.py`
- [Native runtime](https://github.com/nvidia/warp/blob/main/warp/native/warp.cpp): `warp/native/warp.cpp`

### Simulation Numerics

- [Finite elements](https://github.com/nvidia/warp/blob/main/warp/_src/fem/integrate.py): `warp/_src/fem/integrate.py`
- [Geometry processing](https://github.com/nvidia/warp/blob/main/warp/_src/geometry/__init__.py): `warp/_src/geometry/__init__.py`
- [Sparse operations](https://github.com/nvidia/warp/blob/main/warp/_src/sparse.py): `warp/_src/sparse.py`

### Differentiation

- [Autodiff tape](https://github.com/nvidia/warp/blob/main/warp/_src/tape.py): `warp/_src/tape.py`
- [Autograd](https://github.com/nvidia/warp/blob/main/warp/_src/autograd.py): `warp/_src/autograd.py`
- [Optimizers](https://github.com/nvidia/warp/blob/main/warp/_src/optim/__init__.py): `warp/_src/optim/__init__.py`

### Interoperability

- [PyTorch bridge](https://github.com/nvidia/warp/blob/main/warp/_src/torch.py): `warp/_src/torch.py`
- [JAX bridge](https://github.com/nvidia/warp/blob/main/warp/_src/jax/__init__.py): `warp/_src/jax/__init__.py`
- [Paddle bridge](https://github.com/nvidia/warp/blob/main/warp/_src/paddle.py): `warp/_src/paddle.py`
- [Rendering](https://github.com/nvidia/warp/blob/main/warp/_src/render/__init__.py): `warp/_src/render/__init__.py`

### Other components

- **Python user**
- **CPU or GPU**

## Connections

- Python user → Warp API: uses
- Warp API → Kernel language: defines kernels
- Warp API → Types and math: creates data
- Warp API → Device context: selects device
- Warp API → JIT compiler: launches kernels
- JIT compiler → Module registry: registers code
- JIT compiler → Native runtime: compiles for
- Device context → Native runtime: dispatches execution
- Native runtime → CPU or GPU: executes kernels
- Warp API → Autodiff tape: records launches
- Autodiff tape → Autograd: computes gradients
- Autograd → Optimizers: supports updates
- Warp API → Finite elements: provides FEM
- Warp API → Geometry processing: provides geometry
- Warp API → Sparse operations: provides sparse ops
- PyTorch bridge → Warp API: integrates with
- JAX bridge → Warp API: integrates with
- Paddle bridge → Warp API: integrates with
- Warp API → Rendering: provides rendering
