# accel-sim/accel-sim-framework architecture

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

- Interactive diagram: https://gitdiagram.com/accel-sim/accel-sim-framework
- Repository: https://github.com/accel-sim/accel-sim-framework

## Overview

Accel-Sim captures real GPU execution as traces, parses and replays those traces in a cycle-level GPU model, and provides tools to compare simulated results with hardware measurements. The graph preserves the documented tracer, Hopper-aware simulation, compressed-trace support, PyTorch/vLLM hooks, GPUVision profiling, correlation, tuning, and power-model capabilities. The simulator’s entry and trace-processing links are supported by sampled source; several broader capability links rely on the README because their implementations were not sampled.

Main entry points: [`gpu-simulator`](https://github.com/accel-sim/accel-sim-framework/tree/dev/gpu-simulator) (GPU performance model), [`util/tracer_nvbit`](https://github.com/accel-sim/accel-sim-framework/tree/dev/util/tracer_nvbit) (NVBit tracer), [`gpu-simulator/accel-sim.cc`](https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/accel-sim.cc) (Simulation framework), [`gpu-simulator/trace-driven/trace_driven.cc`](https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/trace-driven/trace_driven.cc) (Trace-driven frontend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tracing["Trace capture"]
  node_torchhooks["PyTorch/vLLM hooks"]
  node_nvbit["NVBit tracer"]
  node_traceprocess["Trace processing"]
  node_tracez["Compressed trace format<br/>[tracez_format.h]"]
  node_tracedsm["Trace disassembler<br/>[traceDsm.cpp]"]
end

subgraph group_simulation["GPU simulation"]
  node_simentry["Simulator entry<br/>[main.cc]"]
  node_framework["Simulation framework<br/>[accel-sim.cc]"]
  node_parser["Trace parser<br/>[trace_parser.cc]"]
  node_warpstream["Warp trace reader"]
  node_frontend["Trace-driven frontend<br/>[trace_driven.cc]"]
  node_opcodes["SASS opcode models<br/>[trace_opcode.h]"]
  node_hardwaremodel["GPU performance model"]
  node_power["AccelWattch power model"]
end

subgraph group_validation["Validation and profiling"]
  node_gpvision["GPUVision profiling"]
  node_hwstats["Hardware statistics<br/>[gen_hw_perf_csv.py]"]
end

subgraph group_analysis["Analysis and tuning"]
  node_correlator["Hardware correlator"]
  node_mapping["Metric mappings<br/>[correl_mappings.py]"]
  node_tuner["Configuration tuner<br/>[tuner.py]"]
  node_jobs["Simulation job runner<br/>[run_simulations.py]"]
end

node_user(("Workload user"))
node_gpu["NVIDIA GPU"]

node_user -.->|"traces model layers"| node_torchhooks
node_torchhooks -.->|"hooks NVBit"| node_nvbit
node_user -.->|"traces workload"| node_nvbit
node_gpu -.->|"executes instrumented workload"| node_nvbit
node_nvbit -.->|"produces traces"| node_traceprocess
node_traceprocess -->|"writes compressed traces"| node_tracez
node_tracez -->|"disassembles"| node_tracedsm
node_user -->|"starts simulation"| node_simentry
node_simentry -->|"runs simulation loop"| node_framework
node_framework -->|"parses trace inputs"| node_parser
node_parser -->|"reads compressed warps"| node_warpstream
node_framework -->|"replays traces"| node_frontend
node_frontend -->|"maps SASS instructions"| node_opcodes
node_frontend -.->|"drives cycle model"| node_hardwaremodel
node_hardwaremodel -.->|"models power"| node_power
node_gpu -.->|"provides cycle-level profiling"| node_gpvision
node_gpu -.->|"provides hardware metrics"| node_hwstats
node_hardwaremodel -.->|"supplies simulation results"| node_correlator
node_hwstats -.->|"supplies measured metrics"| node_correlator
node_correlator -->|"uses metric mappings"| node_mapping
node_user -.->|"launches experiments"| node_jobs
node_jobs -.->|"runs configured simulations"| node_hardwaremodel
node_user -.->|"tunes configuration"| node_tuner

click node_torchhooks "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tracer_nvbit/others/torch_hook/pytorch_profiler.py"
click node_nvbit "https://github.com/accel-sim/accel-sim-framework/tree/dev/util/tracer_nvbit"
click node_traceprocess "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tracer_nvbit/tracer_tool/traces-processing/post-traces-processing.cpp"
click node_tracez "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tracer_nvbit/tracer_tool/tracez_format.h"
click node_tracedsm "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tracer_nvbit/others/traceDsm_tool/traceDsm.cpp"
click node_simentry "https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/main.cc"
click node_framework "https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/accel-sim.cc"
click node_parser "https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/trace-parser/trace_parser.cc"
click node_warpstream "https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/trace-parser/warp_trace_stream.h"
click node_frontend "https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/trace-driven/trace_driven.cc"
click node_opcodes "https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/ISA_Def/trace_opcode.h"
click node_hardwaremodel "https://github.com/accel-sim/accel-sim-framework/tree/dev/gpu-simulator"
click node_power "https://github.com/accel-sim/accel-sim-framework/tree/dev/util/accelwattch"
click node_gpvision "https://github.com/accel-sim/accel-sim-framework/tree/dev/util/hw_stats"
click node_hwstats "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/accelwattch/accelwattch_hw_profiler/gen_hw_perf_csv.py"
click node_correlator "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/plotting/plot-correlation.py"
click node_mapping "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/plotting/correl_mappings.py"
click node_tuner "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tuner/tuner.py"
click node_jobs "https://github.com/accel-sim/accel-sim-framework/blob/dev/util/job_launching/run_simulations.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_torchhooks,node_nvbit,node_traceprocess,node_tracez,node_tracedsm,node_user toneBlue
class node_simentry,node_framework,node_parser,node_warpstream,node_frontend,node_opcodes,node_hardwaremodel,node_power toneAmber
class node_gpvision,node_hwstats toneMint
class node_correlator,node_mapping,node_tuner,node_jobs toneRose
class node_gpu toneIndigo
```

## Components

### Trace capture

- [PyTorch/vLLM hooks](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tracer_nvbit/others/torch_hook/pytorch_profiler.py): `util/tracer_nvbit/others/torch_hook/pytorch_profiler.py`
- [NVBit tracer](https://github.com/accel-sim/accel-sim-framework/tree/dev/util/tracer_nvbit): `util/tracer_nvbit`
- [Trace processing](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tracer_nvbit/tracer_tool/traces-processing/post-traces-processing.cpp): `util/tracer_nvbit/tracer_tool/traces-processing/post-traces-processing.cpp`
- [Compressed trace format](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tracer_nvbit/tracer_tool/tracez_format.h): `util/tracer_nvbit/tracer_tool/tracez_format.h`
- [Trace disassembler](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tracer_nvbit/others/traceDsm_tool/traceDsm.cpp): `util/tracer_nvbit/others/traceDsm_tool/traceDsm.cpp`

### GPU simulation

- [Simulator entry](https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/main.cc): `gpu-simulator/main.cc`
- [Simulation framework](https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/accel-sim.cc): `gpu-simulator/accel-sim.cc`
- [Trace parser](https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/trace-parser/trace_parser.cc): `gpu-simulator/trace-parser/trace_parser.cc`
- [Warp trace reader](https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/trace-parser/warp_trace_stream.h): `gpu-simulator/trace-parser/warp_trace_stream.h`
- [Trace-driven frontend](https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/trace-driven/trace_driven.cc): `gpu-simulator/trace-driven/trace_driven.cc`
- [SASS opcode models](https://github.com/accel-sim/accel-sim-framework/blob/dev/gpu-simulator/ISA_Def/trace_opcode.h): `gpu-simulator/ISA_Def/trace_opcode.h`
- [GPU performance model](https://github.com/accel-sim/accel-sim-framework/tree/dev/gpu-simulator): `gpu-simulator`
- [AccelWattch power model](https://github.com/accel-sim/accel-sim-framework/tree/dev/util/accelwattch): `util/accelwattch`

### Validation and profiling

- [GPUVision profiling](https://github.com/accel-sim/accel-sim-framework/tree/dev/util/hw_stats): `util/hw_stats`
- [Hardware statistics](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/accelwattch/accelwattch_hw_profiler/gen_hw_perf_csv.py): `util/accelwattch/accelwattch_hw_profiler/gen_hw_perf_csv.py`

### Analysis and tuning

- [Hardware correlator](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/plotting/plot-correlation.py): `util/plotting/plot-correlation.py`
- [Metric mappings](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/plotting/correl_mappings.py): `util/plotting/correl_mappings.py`
- [Configuration tuner](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/tuner/tuner.py): `util/tuner/tuner.py`
- [Simulation job runner](https://github.com/accel-sim/accel-sim-framework/blob/dev/util/job_launching/run_simulations.py): `util/job_launching/run_simulations.py`

### Other components

- **Workload user**
- **NVIDIA GPU**

## Connections

- Workload user → PyTorch/vLLM hooks: traces model layers
- PyTorch/vLLM hooks → NVBit tracer: hooks NVBit (evidence: `util/tracer_nvbit/others/torch_hook/__init__.py`)
- Workload user → NVBit tracer: traces workload
- NVIDIA GPU → NVBit tracer: executes instrumented workload
- NVBit tracer → Trace processing: produces traces (evidence: `util/tracer_nvbit/tracer_tool/traces-processing/post-traces-processing.cpp`)
- Trace processing → Compressed trace format: writes compressed traces (evidence: `util/tracer_nvbit/tracer_tool/tracez_format.h`)
- Compressed trace format → Trace disassembler: disassembles (evidence: `util/tracer_nvbit/tracer_tool/tracez_format.h`)
- Workload user → Simulator entry: starts simulation (evidence: `gpu-simulator/main.cc`)
- Simulator entry → Simulation framework: runs simulation loop (evidence: `gpu-simulator/main.cc`)
- Simulation framework → Trace parser: parses trace inputs
- Trace parser → Warp trace reader: reads compressed warps (evidence: `gpu-simulator/trace-parser/warp_trace_stream.h`)
- Simulation framework → Trace-driven frontend: replays traces
- Trace-driven frontend → SASS opcode models: maps SASS instructions (evidence: `gpu-simulator/trace-driven/trace_driven.cc`)
- Trace-driven frontend → GPU performance model: drives cycle model (evidence: `gpu-simulator/trace-driven/trace_driven.cc`)
- GPU performance model → AccelWattch power model: models power
- NVIDIA GPU → GPUVision profiling: provides cycle-level profiling
- NVIDIA GPU → Hardware statistics: provides hardware metrics
- GPU performance model → Hardware correlator: supplies simulation results
- Hardware statistics → Hardware correlator: supplies measured metrics
- Hardware correlator → Metric mappings: uses metric mappings (evidence: `util/plotting/plot-correlation.py`)
- Workload user → Simulation job runner: launches experiments
- Simulation job runner → GPU performance model: runs configured simulations
- Workload user → Configuration tuner: tunes configuration
