# granted07/des_adaptivegammatheory architecture

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

- Interactive diagram: https://gitdiagram.com/granted07/des_adaptivegammatheory
- Repository: https://github.com/granted07/des_adaptivegammatheory

## Overview

BatOpt is currently a C library of foundational models for GPU batch inference, not a running batching service. Its implemented pieces calculate batch profiles, Poisson probabilities, and queue batch state. The README describes a future workflow: profile a GPU, generate arrivals, serve batches, predict waiting time, and adapt γ to memory pressure. Those planned capabilities are shown separately; their implementation and connections are not established by the sampled source, so no runtime flow between them is asserted.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_models["Implemented models"]
  node_profile["GPU profiles<br/>[profile.c]"]
  node_poisson["Poisson probabilities<br/>[poisson.c]"]
  node_queue["Queue batching<br/>[queue_model.c]"]
end

subgraph group_planned["Planned capabilities"]
  node_gpu_profile["GPU profiling"]
  node_arrival_gen["Arrival generation"]
  node_batch_server["GPU batch server"]
  node_wait_predictor["Wait prediction"]
  node_adaptive_gamma["Adaptive γ"]
end

subgraph group_integrations["Runtime environment"]
  node_gpu(("GPU"))
end

click node_profile "https://github.com/granted07/des_adaptivegammatheory/blob/main/src/profile.c"
click node_poisson "https://github.com/granted07/des_adaptivegammatheory/blob/main/src/poisson.c"
click node_queue "https://github.com/granted07/des_adaptivegammatheory/blob/main/src/queue_model.c"

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_profile,node_poisson,node_queue toneBlue
class node_gpu_profile,node_arrival_gen,node_batch_server,node_wait_predictor,node_adaptive_gamma toneAmber
class node_gpu toneMint
```

## Components

### Implemented models

- [GPU profiles](https://github.com/granted07/des_adaptivegammatheory/blob/main/src/profile.c): `src/profile.c`
- [Poisson probabilities](https://github.com/granted07/des_adaptivegammatheory/blob/main/src/poisson.c): `src/poisson.c`
- [Queue batching](https://github.com/granted07/des_adaptivegammatheory/blob/main/src/queue_model.c): `src/queue_model.c`

### Planned capabilities

- **GPU profiling**
- **Arrival generation**
- **GPU batch server**
- **Wait prediction**
- **Adaptive γ**

### Runtime environment

- **GPU**
