# ai-unife/edge-dnntuner architecture

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

- Interactive diagram: https://gitdiagram.com/ai-unife/edge-dnntuner
- Repository: https://github.com/ai-unife/edge-dnntuner

## Overview

EDGE-DNN Tuner is a hardware-aware neural architecture search framework: users configure a dataset, backend, search strategy, and constraints, then the tuner proposes and evaluates candidate networks. The controller coordinates search, model building, training, and constraint checks; optional loss modules add FLOPs or hardware costs. The repository also includes NVDLA model replacement, profiling, and quantization capabilities. Relationships involving unread entry points and subsystems are omitted or left unverified; the graph relies on the README and cited source-index references and excerpts.

Main entry points: [`components/controller.py`](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/controller.py) (Search controller), [`components/neural_network.py`](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/neural_network.py) (Network builder), [`modules/loss/hardware_module.py`](https://github.com/ai-unife/edge-dnntuner/blob/master_show/modules/loss/hardware_module.py) (Hardware costs), [`pytorch_implementation/neural_network.py`](https://github.com/ai-unife/edge-dnntuner/blob/master_show/pytorch_implementation/neural_network.py) (PyTorch backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_search["Search and orchestration"]
  node_controller["Search controller<br/>[controller.py]"]
  node_search_space["Search space<br/>[search_space.py]"]
  node_bo["Bayesian search<br/>[optimizer.py]"]
  node_random["Random search<br/>[random_search.py]"]
  node_rules["Symbolic rules"]
  node_symbolic["Symbolic tuner<br/>[symbolic_tuner.py]"]
  node_experience[("Search experience")]
end

subgraph group_training["Data and training"]
  node_dataset["Dataset handling<br/>[dataset.py]"]
  node_gesture_data["Gesture datasets<br/>[gesture_dataset.py]"]
  node_network["Network builder<br/>[neural_network.py]"]
  node_tf_backend["TensorFlow backend<br/>[neural_network.py]"]
  node_torch_backend["PyTorch backend<br/>[neural_network.py]"]
  node_torch_model["PyTorch models<br/>[model.py]"]
  node_model_zoo["Model zoo<br/>[zoo.py]"]
end

subgraph group_constraints["Evaluation constraints"]
  node_modules["Loss modules<br/>[module.py]"]
  node_flops["FLOPs constraints<br/>[flops_module.py]"]
  node_hardware["Hardware costs<br/>[hardware_module.py]"]
end

subgraph group_nvdla["NVDLA deployment"]
  node_profiler["NVDLA profiler<br/>[profiler.py]"]
  node_parser["Torch replacer<br/>[torch.py]"]
  node_wrapper["NVDLA wrapper<br/>[wrapper.py]"]
  node_quant["Quantization routines<br/>[numpy.py]"]
  node_quantizers["Quantizer implementations<br/>[quantizer_POTQ.py]"]
end

node_user(("Tuner user"))

node_user -.->|"configures and starts"| node_controller
node_controller -->|"uses"| node_search_space
node_controller -->|"uses"| node_rules
node_controller -->|"integrates"| node_symbolic
node_controller -->|"uses"| node_experience
node_controller -->|"loads"| node_modules
node_controller -->|"builds network"| node_network
node_controller -->|"reads dataset"| node_dataset
node_network -->|"uses dimensions"| node_search_space
node_network -->|"uses data"| node_dataset
node_dataset -->|"imports"| node_gesture_data
node_network -.->|"backend implementation"| node_tf_backend
node_network -.->|"backend implementation"| node_torch_backend
node_torch_backend -->|"uses model"| node_torch_model
node_torch_backend -->|"uses constraints"| node_hardware
node_modules -->|"loads by name"| node_flops
node_modules -->|"loads by name"| node_hardware
node_hardware -->|"profiles layers"| node_profiler
node_hardware -->|"reads layer specs"| node_torch_model
node_model_zoo -->|"imports"| node_parser
node_parser -->|"constructs wrapper"| node_wrapper
node_wrapper -->|"uses quantization"| node_quant
node_quantizers -->|"imports routines"| node_quant
node_bo -->|"references"| node_quant

click node_controller "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/controller.py"
click node_search_space "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/search_space.py"
click node_bo "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/bo/optimizer.py"
click node_random "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/random_search.py"
click node_rules "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/tuning_rules_symbolic.py"
click node_symbolic "https://github.com/ai-unife/edge-dnntuner/blob/master_show/symbolic_tuner.py"
click node_experience "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/storing_experience.py"
click node_dataset "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/dataset.py"
click node_gesture_data "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/gesture_dataset.py"
click node_network "https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/neural_network.py"
click node_tf_backend "https://github.com/ai-unife/edge-dnntuner/blob/master_show/tensorflow_implementation/neural_network.py"
click node_torch_backend "https://github.com/ai-unife/edge-dnntuner/blob/master_show/pytorch_implementation/neural_network.py"
click node_torch_model "https://github.com/ai-unife/edge-dnntuner/blob/master_show/pytorch_implementation/model.py"
click node_model_zoo "https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/models/zoo.py"
click node_modules "https://github.com/ai-unife/edge-dnntuner/blob/master_show/modules/module.py"
click node_flops "https://github.com/ai-unife/edge-dnntuner/blob/master_show/modules/loss/flops_module.py"
click node_hardware "https://github.com/ai-unife/edge-dnntuner/blob/master_show/modules/loss/hardware_module.py"
click node_profiler "https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/profiler.py"
click node_parser "https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/wrapper/parser/torch.py"
click node_wrapper "https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/wrapper/wrapper.py"
click node_quant "https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/models/quantize/qlib/numpy.py"
click node_quantizers "https://github.com/ai-unife/edge-dnntuner/blob/master_show/quantizer/quantizer_POTQ.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_controller,node_search_space,node_bo,node_random,node_rules,node_symbolic,node_experience,node_user toneBlue
class node_dataset,node_gesture_data,node_network,node_tf_backend,node_torch_backend,node_torch_model,node_model_zoo toneAmber
class node_modules,node_flops,node_hardware toneMint
class node_profiler,node_parser,node_wrapper,node_quant,node_quantizers toneRose
```

## Components

### Search and orchestration

- [Search controller](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/controller.py): `components/controller.py`
- [Search space](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/search_space.py): `components/search_space.py`
- [Bayesian search](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/bo/optimizer.py): `components/bo/optimizer.py`
- [Random search](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/random_search.py): `components/random_search.py`
- [Symbolic rules](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/tuning_rules_symbolic.py): `components/tuning_rules_symbolic.py`
- [Symbolic tuner](https://github.com/ai-unife/edge-dnntuner/blob/master_show/symbolic_tuner.py): `symbolic_tuner.py`
- [Search experience](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/storing_experience.py): `components/storing_experience.py`

### Data and training

- [Dataset handling](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/dataset.py): `components/dataset.py`
- [Gesture datasets](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/gesture_dataset.py): `components/gesture_dataset.py`
- [Network builder](https://github.com/ai-unife/edge-dnntuner/blob/master_show/components/neural_network.py): `components/neural_network.py`
- [TensorFlow backend](https://github.com/ai-unife/edge-dnntuner/blob/master_show/tensorflow_implementation/neural_network.py): `tensorflow_implementation/neural_network.py`
- [PyTorch backend](https://github.com/ai-unife/edge-dnntuner/blob/master_show/pytorch_implementation/neural_network.py): `pytorch_implementation/neural_network.py`
- [PyTorch models](https://github.com/ai-unife/edge-dnntuner/blob/master_show/pytorch_implementation/model.py): `pytorch_implementation/model.py`
- [Model zoo](https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/models/zoo.py): `nvdla/models/zoo.py`

### Evaluation constraints

- [Loss modules](https://github.com/ai-unife/edge-dnntuner/blob/master_show/modules/module.py): `modules/module.py`
- [FLOPs constraints](https://github.com/ai-unife/edge-dnntuner/blob/master_show/modules/loss/flops_module.py): `modules/loss/flops_module.py`
- [Hardware costs](https://github.com/ai-unife/edge-dnntuner/blob/master_show/modules/loss/hardware_module.py): `modules/loss/hardware_module.py`

### NVDLA deployment

- [NVDLA profiler](https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/profiler.py): `nvdla/profiler.py`
- [Torch replacer](https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/wrapper/parser/torch.py): `nvdla/wrapper/parser/torch.py`
- [NVDLA wrapper](https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/wrapper/wrapper.py): `nvdla/wrapper/wrapper.py`
- [Quantization routines](https://github.com/ai-unife/edge-dnntuner/blob/master_show/nvdla/models/quantize/qlib/numpy.py): `nvdla/models/quantize/qlib/numpy.py`
- [Quantizer implementations](https://github.com/ai-unife/edge-dnntuner/blob/master_show/quantizer/quantizer_POTQ.py): `quantizer/quantizer_POTQ.py`

### Other components

- **Tuner user**

## Connections

- Tuner user → Search controller: configures and starts
- Search controller → Search space: uses (evidence: `components/controller.py`)
- Search controller → Symbolic rules: uses (evidence: `components/controller.py`)
- Search controller → Symbolic tuner: integrates (evidence: `components/controller.py`)
- Search controller → Search experience: uses (evidence: `components/controller.py`)
- Search controller → Loss modules: loads (evidence: `components/controller.py`)
- Search controller → Network builder: builds network (evidence: `components/controller.py`)
- Search controller → Dataset handling: reads dataset
- Network builder → Search space: uses dimensions (evidence: `components/neural_network.py`)
- Network builder → Dataset handling: uses data (evidence: `components/neural_network.py`)
- Dataset handling → Gesture datasets: imports (evidence: `components/dataset.py`)
- Network builder → TensorFlow backend: backend implementation (evidence: `tensorflow_implementation/neural_network.py`)
- Network builder → PyTorch backend: backend implementation (evidence: `pytorch_implementation/neural_network.py`)
- PyTorch backend → PyTorch models: uses model (evidence: `pytorch_implementation/neural_network.py`)
- PyTorch backend → Hardware costs: uses constraints (evidence: `pytorch_implementation/neural_network.py`)
- Loss modules → FLOPs constraints: loads by name (evidence: `modules/module.py`)
- Loss modules → Hardware costs: loads by name (evidence: `modules/module.py`)
- Hardware costs → NVDLA profiler: profiles layers (evidence: `modules/loss/hardware_module.py`)
- Hardware costs → PyTorch models: reads layer specs (evidence: `modules/loss/hardware_module.py`)
- Model zoo → Torch replacer: imports (evidence: `nvdla/models/zoo.py`)
- Torch replacer → NVDLA wrapper: constructs wrapper (evidence: `nvdla/wrapper/parser/torch.py`)
- NVDLA wrapper → Quantization routines: uses quantization (evidence: `nvdla/wrapper/wrapper.py`)
- Quantizer implementations → Quantization routines: imports routines (evidence: `quantizer/quantizer_POTQ.py`)
- Bayesian search → Quantization routines: references (evidence: `components/bo/optimizer.py`)
