# edraithenni/gc_lab_local architecture

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

- Interactive diagram: https://gitdiagram.com/edraithenni/gc_lab_local
- Repository: https://github.com/edraithenni/gc_lab_local

## Overview

This repository implements distributed, straggler-tolerant CIFAR-10 training using gradient-coding schemes on Ray. The workflow starts a parameter server, which configures training, dispatches model weights to workers, collects enough coded gradients, decodes and applies updates, then evaluates and saves results. Separate coding algorithms provide classic, communication-efficient, and pipelined variants. The graph follows shown calls and SOURCE INDEX references; the CCE-FR implementation and Ray entry point were not excerpted, so their internals are not expanded.

Main entry points: [`app/parameter_server.py`](https://github.com/edraithenni/gc_lab_local/blob/main/app/parameter_server.py) (Parameter server), [`app/coding/__init__.py`](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/__init__.py) (Scheme factory), [`app/worker.py`](https://github.com/edraithenni/gc_lab_local/blob/main/app/worker.py) (Ray worker), [`app/coding/base.py`](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/base.py) (Scheme interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Training Runtime"]
  node_entry["Ray entry point<br/>[train_ray.py]"]
  node_config["Training config<br/>[config.py]"]
  node_server["Parameter server"]
  node_collector["Response collector<br/>[coordinator.py]"]
  node_worker["Ray worker<br/>[worker.py]"]
end

subgraph group_coding["Gradient Coding"]
  node_scheme_factory["Scheme factory<br/>[__init__.py]"]
  node_scheme_base["Scheme interface<br/>[base.py]"]
  node_classic["Classic GC<br/>[classic.py]"]
  node_cce_cr["CCE-GC-CR<br/>[cce_cr.py]"]
  node_cce_fr["CCE-GC-FR<br/>[cce_fr.py]"]
  node_pgc_cr["Pipelined GC-CR<br/>[pipelined.py]"]
  node_pgc_fr["Pipelined GC-FR<br/>[pipelined_fr.py]"]
end

subgraph group_ml["Model and Data"]
  node_model["Model and tensors<br/>[model.py]"]
  node_training_data["Training batches<br/>[data.py]"]
end

subgraph group_outputs["Evaluation and Results"]
  node_evaluation["Evaluation"]
  node_results["Run artifacts"]
end

node_user(("Training operator"))
node_cifar[("CIFAR-10 files")]

node_user -->|"starts"| node_entry
node_entry -->|"loads settings"| node_config
node_entry -->|"starts training"| node_server
node_server -->|"loads settings"| node_config
node_server -->|"creates scheme"| node_scheme_factory
node_server -->|"builds and updates"| node_model
node_server -->|"submits and collects"| node_collector
node_server -->|"evaluates models"| node_evaluation
node_server -->|"writes metrics and model"| node_results
node_collector -->|"dispatches steps"| node_worker
node_worker -->|"creates scheme"| node_scheme_factory
node_worker -->|"gets batches"| node_training_data
node_worker -->|"computes gradients"| node_model
node_training_data -->|"reads"| node_cifar
node_scheme_factory -->|"constructs"| node_classic
node_scheme_factory -->|"constructs"| node_cce_cr
node_scheme_factory -->|"constructs"| node_cce_fr
node_scheme_factory -->|"constructs"| node_pgc_cr
node_scheme_factory -->|"constructs"| node_pgc_fr
node_classic -->|"implements"| node_scheme_base
node_cce_cr -->|"implements"| node_scheme_base
node_cce_fr -->|"implements"| node_scheme_base
node_scheme_factory -->|"returns interface"| node_scheme_base
node_server -->|"loads evaluation data"| node_cifar

click node_entry "https://github.com/edraithenni/gc_lab_local/blob/main/app/train_ray.py"
click node_config "https://github.com/edraithenni/gc_lab_local/blob/main/app/config.py"
click node_server "https://github.com/edraithenni/gc_lab_local/blob/main/app/parameter_server.py"
click node_collector "https://github.com/edraithenni/gc_lab_local/blob/main/app/coordinator.py"
click node_worker "https://github.com/edraithenni/gc_lab_local/blob/main/app/worker.py"
click node_scheme_factory "https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/__init__.py"
click node_scheme_base "https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/base.py"
click node_classic "https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/classic.py"
click node_cce_cr "https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/cce_cr.py"
click node_cce_fr "https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/cce_fr.py"
click node_pgc_cr "https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/pipelined.py"
click node_pgc_fr "https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/pipelined_fr.py"
click node_model "https://github.com/edraithenni/gc_lab_local/blob/main/app/model.py"
click node_training_data "https://github.com/edraithenni/gc_lab_local/blob/main/app/data.py"
click node_evaluation "https://github.com/edraithenni/gc_lab_local/blob/main/app/parameter_server.py"
click node_results "https://github.com/edraithenni/gc_lab_local/blob/main/app/parameter_server.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_entry,node_config,node_server,node_collector,node_worker toneBlue
class node_scheme_factory,node_scheme_base,node_classic,node_cce_cr,node_cce_fr,node_pgc_cr,node_pgc_fr,node_cifar toneAmber
class node_model,node_training_data toneMint
class node_evaluation,node_results toneRose
class node_user toneIndigo
```

## Components

### Training Runtime

- [Ray entry point](https://github.com/edraithenni/gc_lab_local/blob/main/app/train_ray.py): `app/train_ray.py`
- [Training config](https://github.com/edraithenni/gc_lab_local/blob/main/app/config.py): `app/config.py`
- [Parameter server](https://github.com/edraithenni/gc_lab_local/blob/main/app/parameter_server.py): `app/parameter_server.py`
- [Response collector](https://github.com/edraithenni/gc_lab_local/blob/main/app/coordinator.py): `app/coordinator.py`
- [Ray worker](https://github.com/edraithenni/gc_lab_local/blob/main/app/worker.py): `app/worker.py`

### Gradient Coding

- [Scheme factory](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/__init__.py): `app/coding/__init__.py`
- [Scheme interface](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/base.py): `app/coding/base.py`
- [Classic GC](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/classic.py): `app/coding/classic.py`
- [CCE-GC-CR](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/cce_cr.py): `app/coding/cce_cr.py`
- [CCE-GC-FR](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/cce_fr.py): `app/coding/cce_fr.py`
- [Pipelined GC-CR](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/pipelined.py): `app/coding/pipelined.py`
- [Pipelined GC-FR](https://github.com/edraithenni/gc_lab_local/blob/main/app/coding/pipelined_fr.py): `app/coding/pipelined_fr.py`

### Model and Data

- [Model and tensors](https://github.com/edraithenni/gc_lab_local/blob/main/app/model.py): `app/model.py`
- [Training batches](https://github.com/edraithenni/gc_lab_local/blob/main/app/data.py): `app/data.py`

### Evaluation and Results

- [Evaluation](https://github.com/edraithenni/gc_lab_local/blob/main/app/parameter_server.py): `app/parameter_server.py`
- [Run artifacts](https://github.com/edraithenni/gc_lab_local/blob/main/app/parameter_server.py): `app/parameter_server.py`

### Other components

- **Training operator**
- **CIFAR-10 files**

## Connections

- Training operator → Ray entry point: starts
- Ray entry point → Training config: loads settings (evidence: `app/train_ray.py`)
- Ray entry point → Parameter server: starts training (evidence: `app/train_ray.py`)
- Parameter server → Training config: loads settings (evidence: `app/parameter_server.py`)
- Parameter server → Scheme factory: creates scheme (evidence: `app/parameter_server.py`)
- Parameter server → Model and tensors: builds and updates (evidence: `app/parameter_server.py`)
- Parameter server → Response collector: submits and collects (evidence: `app/parameter_server.py`)
- Parameter server → Evaluation: evaluates models (evidence: `app/parameter_server.py`)
- Parameter server → Run artifacts: writes metrics and model (evidence: `app/parameter_server.py`)
- Response collector → Ray worker: dispatches steps (evidence: `app/coordinator.py`)
- Ray worker → Scheme factory: creates scheme (evidence: `app/worker.py`)
- Ray worker → Training batches: gets batches (evidence: `app/worker.py`)
- Ray worker → Model and tensors: computes gradients (evidence: `app/worker.py`)
- Training batches → CIFAR-10 files: reads (evidence: `app/data.py`)
- Scheme factory → Classic GC: constructs (evidence: `app/coding/__init__.py`)
- Scheme factory → CCE-GC-CR: constructs (evidence: `app/coding/__init__.py`)
- Scheme factory → CCE-GC-FR: constructs (evidence: `app/coding/__init__.py`)
- Scheme factory → Pipelined GC-CR: constructs (evidence: `app/coding/__init__.py`)
- Scheme factory → Pipelined GC-FR: constructs (evidence: `app/coding/__init__.py`)
- Classic GC → Scheme interface: implements (evidence: `app/coding/classic.py`)
- CCE-GC-CR → Scheme interface: implements (evidence: `app/coding/cce_cr.py`)
- CCE-GC-FR → Scheme interface: implements (evidence: `app/coding/cce_fr.py`)
- Scheme factory → Scheme interface: returns interface (evidence: `app/coding/__init__.py`)
- Parameter server → CIFAR-10 files: loads evaluation data (evidence: `app/parameter_server.py`)
