# namanmakkar/ece5545-ml-hardware-systems architecture

> Architecture diagram of the GitHub repository namanmakkar/ece5545-ml-hardware-systems, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/namanmakkar/ece5545-ml-hardware-systems
- Repository: https://github.com/namanmakkar/ece5545-ml-hardware-systems

## Overview

##### Main Components
- Core Architectural Elements Within Each Module:
– Notebooks: Each assignment contains one or more Jupyter notebooks (e.g., a0.ipynb, various numbered notebooks in a2, a3, a4) that drive the experiments and tests.
– Source Code (src): Each assignment has a src folder containing scripts (for example, model.py, train_utils.py in a0; various Python files in a2, a3, and a4) that implement core algorithms, processing pipelines, or specialized operations.
– Tests: Each assignment includes a tests directory with unit tests ensuring correctness.
– Supplementary Resources: PDFs (e.g., a1_submission.pdf, a2_submission.pdf, etc.), images, and additional documentation add context to the work.
- Cross-Assignment or External Resources: The repository-level README provides the high-level context for the assignments. The term paper represents an independent document summarizing research on communication compression.

##### Relationships and Interactions
- Data and Artifacts: Notebooks may process data (inputs in assignments like audio pre-processing in a2 or MNIST files in a4) that is then passed to the src code for model training, processing, or optimization. The output (results, plots, logs) is analyzed and validated using the tests.
- External Dependencies: Make sure to denote libraries/frameworks used in each assignment (for example, TVM in a3, the Arduino toolchain in a2, and any deep learning frameworks).

##### Incorporate Key Architectural Patterns and Design Principles
- Separation of Concerns: Break down within each module the different responsibilities: interactive exploratory work (notebooks), core logic and processing (src), and quality verification (tests).

##### Essential Elements
- Each major module label (e.g., “Assignment 1: Roofline Benchmarking” for a0, “Assignment 2: Keyword Spotting and Compression” for a2, “Assignment 3: DNN Compiling with TVM” for a3, “Assignment 4: DNN Primitives Approximation” for a4, and “Term Paper: Gradient Compression”).
- Inside each module, every sub-folder (Notebooks, src, tests, extra docs) should be mapped out as nodes.
– Data flow from inputs (raw data, hardware benchmarks) to processing (src logic) to outputs (visualizations, PDF reports).
- Annotations or legends to explain architectural patterns (e.g., “Microcontroller Deployment Flow” for a2, “Compiler Optimizations” for a3).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Repository Level
    R["Repository README"]:::repo

    %% Assignment 0 Subgraph
    subgraph "Assignment 0"
        A0_N["Notebooks: a0.ipynb"]:::notebook
        A0_S["Source (src)"]:::src
        A0_T["Tests"]:::tests
        A0_D["Documentation (README.md)"]:::docs
    end
    R --> A0_D

    %% Data flow within Assignment 0
    A0_N --> A0_S
    A0_S --> A0_T

    %% Assignment 1 Subgraph
    subgraph "Assignment 1"
        A1_N["Notebooks: A1.ipynb"]:::notebook
        A1_Sub["Submission: a1_submission.pdf"]:::supp
        A1_D["Documentation (README.md)"]:::docs
        A1_R["Additional Resources (images)"]:::supp
    end
    A0_D --> A1_D

    %% Data flow within Assignment 1
    A1_N --> A1_Sub

    %% Assignment 2 Subgraph
    subgraph "Assignment 2"
        A2_N["Notebooks (6 notebooks)"]:::notebook
        A2_S["Source (src)"]:::src
        A2_T["Tests (test_quant, test_size)"]:::tests
        A2_Sup["Supplementary Materials (submission, Arduino tutorial, images)"]:::supp
        A2_D["Documentation (README.md)"]:::docs
        A2_Int["Interface: Arduino Nano"]:::ext
    end
    A1_D --> A2_D

    %% Data flow within Assignment 2
    A2_N --> A2_S
    A2_S --> A2_T
    A2_S -->|"deployment"| A2_Int

    %% Assignment 3 Subgraph
    subgraph "Assignment 3"
        A3_N["Notebooks (6 notebooks)"]:::notebook
        A3_S["Source (src)"]:::src
        A3_T["Tests (multiple tests)"]:::tests
        A3_Sup["Supplementary Materials (submission, leaderboard)"]:::supp
        A3_D["Documentation (README.md)"]:::docs
        A3_Ext["Dependency: TVM"]:::ext
    end
    A2_D --> A3_D

    %% Data flow within Assignment 3
    A3_N --> A3_S
    A3_S --> A3_T
    A3_S --> A3_Ext

    %% Assignment 4 Subgraph
    subgraph "Assignment 4"
        A4_N["Notebooks (3 notebooks)"]:::notebook
        A4_S["Source (src)"]:::src
        A4_Dt["Data & Artifacts"]:::supp
        A4_T["Tests"]:::tests
        A4_Sup["Supplementary Materials (submission)"]:::supp
        A4_D["Documentation (README.md)"]:::docs
    end
    A3_D --> A4_D

    %% Data flow within Assignment 4
    A4_N --> A4_S
    A4_S --> A4_T
    A4_S --> A4_Dt

    %% Term Paper Subgraph
    subgraph "Term Paper"
        TP_D["Term Paper Document"]:::docs
        TP_P["Presentation: Gradient Compression"]:::supp
    end
    A4_D --> TP_D

    %% Styles
    classDef notebook fill:#FFF68F,stroke:#333,stroke-width:2px;
    classDef src fill:#C1E1C1,stroke:#333,stroke-width:2px;
    classDef tests fill:#F4A0A0,stroke:#333,stroke-width:2px;
    classDef docs fill:#D3D3D3,stroke:#333,stroke-width:2px;
    classDef supp fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef repo fill:#E6E6FA,stroke:#333,stroke-width:2px;
    classDef ext fill:#FFE4B5,stroke:#333,stroke-width:2px;

    %% Click Events for Assignment 0
    click A0_N "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a0/a0.ipynb"
    click A0_S "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a0/src"
    click A0_T "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a0/tests"
    click A0_D "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a0/README.md"

    %% Click Events for Assignment 1
    click A1_N "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a1/A1.ipynb"
    click A1_Sub "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a1/a1_submission.pdf"
    click A1_D "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a1/README.md"
    click A1_R "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a1/images"

    %% Click Events for Assignment 2
    click A2_N "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a2/1_audio_preprocessing.ipynb"
    click A2_S "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a2/src"
    click A2_T "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a2/tests"
    click A2_Sup "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a2/a2_submission.pdf"
    click A2_D "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a2/README.md"
    click A2_Int "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a2/arduino_nano_33_ble_tutorial.md"

    %% Click Events for Assignment 3
    click A3_N "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a3/1-conv1d_cpu.ipynb"
    click A3_S "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a3/src"
    click A3_T "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a3/tests"
    click A3_Sup "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a3/a3_submission.pdf"
    click A3_D "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a3/README.md"

    %% Click Events for Assignment 4
    click A4_N "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a4/1-numerical_precision.ipynb"
    click A4_S "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a4/src"
    click A4_Dt "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a4/data"
    click A4_T "https://github.com/namanmakkar/ece5545-ml-hardware-systems/tree/main/a4/tests"
    click A4_Sup "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a4/a4_submission.pdf"
    click A4_D "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/a4/README.md"

    %% Click Events for Term Paper
    click TP_D "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/term_paper/ML_Hardware_Term_Paper.pdf"
    click TP_P "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/term_paper/Term Paper Presentation - Gradient Compression for Distributed Training.pdf"
    
    %% Click Event for Repository README
    click R "https://github.com/namanmakkar/ece5545-ml-hardware-systems/blob/main/README.md"
```
