# imageomics/hpc-inference architecture

> Architecture diagram of the GitHub repository imageomics/hpc-inference, 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/imageomics/hpc-inference
- Repository: https://github.com/imageomics/hpc-inference

## Overview

HPC-Inference provides distributed image-dataset loading and batch inference for large image collections, with OpenCLIP embedding as the documented and sampled end-to-end workflow. The embed runner selects a dataset from configuration, batches it, performs model inference, writes embeddings, and records resource and timing metrics. Dataset loaders and shared utilities provide the internal data and parallelization layers. README capabilities such as classification and grid-search profiling are represented where source paths exist; detection is documented but has no implementation path in the supplied tree. Some subsystem links rely on README or SOURCE INDEX references because source excerpts are partial.

Main entry points: [`src/hpc_inference/inference/embed/open_clip_embed.py`](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/inference/embed/open_clip_embed.py) (Embedding runner), [`src/hpc_inference/utils/distributed.py`](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/utils/distributed.py) (Rank distribution), [`src/hpc_inference/utils/common.py`](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/utils/common.py) (Shared utilities), [`src/hpc_inference/datasets/image_folder_dataset.py`](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/image_folder_dataset.py) (Image folder loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Inference workflows"]
  node_embed_runner["Embedding runner<br/>[open_clip_embed.py]"]
  node_openclip["OpenCLIP models"]
  node_classifier["Classification<br/>[classify.py]"]
  node_similarity["Similarity analysis<br/>[similarity.py]"]
end

subgraph group_datasets["Dataset input"]
  node_image_folder["Image folder loader"]
  node_parquet_images["Parquet image loader<br/>[parquet_dataset.py]"]
  node_hdf5_images["HDF5 image loader<br/>[hdf5_dataset.py]"]
  node_parquet_embeddings["Parquet embedding reader<br/>[parquet_dataset.py]"]
end

subgraph group_runtime["Runtime support"]
  node_distributed["Rank distribution<br/>[distributed.py]"]
  node_common["Shared utilities<br/>[common.py]"]
  node_profiling["Resource profiling<br/>[profiling.py]"]
end

subgraph group_analysis["Analysis and outputs"]
  node_grid_analysis["Grid search analysis"]
  node_embedding_files["Embedding files"]
  node_profile_reports["Profile reports"]
end

node_user(("HPC user"))

node_user -->|"configures and runs"| node_embed_runner
node_embed_runner -->|"selects input"| node_image_folder
node_embed_runner -->|"selects input"| node_parquet_images
node_embed_runner -->|"selects input"| node_hdf5_images
node_embed_runner -->|"runs inference"| node_openclip
node_embed_runner -->|"uses rank support"| node_distributed
node_image_folder -->|"partitions files"| node_distributed
node_parquet_images -->|"partitions files"| node_distributed
node_hdf5_images -->|"partitions files"| node_distributed
node_embed_runner -->|"loads configuration"| node_common
node_embed_runner -->|"writes embeddings"| node_common
node_embed_runner -->|"records metrics"| node_profiling
node_common -->|"writes Parquet"| node_embedding_files
node_profiling -->|"writes reports"| node_profile_reports
node_user -.->|"runs classification"| node_classifier
node_user -.->|"analyzes grid search"| node_grid_analysis
node_user -.->|"reads embeddings"| node_parquet_embeddings

click node_embed_runner "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/inference/embed/open_clip_embed.py"
click node_classifier "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/inference/classify/classify.py"
click node_similarity "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/inference/classify/similarity.py"
click node_image_folder "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/image_folder_dataset.py"
click node_parquet_images "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/parquet_dataset.py"
click node_hdf5_images "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/hdf5_dataset.py"
click node_parquet_embeddings "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/parquet_dataset.py"
click node_distributed "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/utils/distributed.py"
click node_common "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/utils/common.py"
click node_profiling "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/utils/profiling.py"
click node_grid_analysis "https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/analyze_grid_search.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_embed_runner,node_openclip,node_classifier,node_similarity,node_user toneBlue
class node_image_folder,node_parquet_images,node_hdf5_images,node_parquet_embeddings toneAmber
class node_distributed,node_common,node_profiling toneMint
class node_grid_analysis,node_embedding_files,node_profile_reports toneRose
```

## Components

### Inference workflows

- [Embedding runner](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/inference/embed/open_clip_embed.py): `src/hpc_inference/inference/embed/open_clip_embed.py`
- **OpenCLIP models**
- [Classification](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/inference/classify/classify.py): `src/hpc_inference/inference/classify/classify.py`
- [Similarity analysis](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/inference/classify/similarity.py): `src/hpc_inference/inference/classify/similarity.py`

### Dataset input

- [Image folder loader](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/image_folder_dataset.py): `src/hpc_inference/datasets/image_folder_dataset.py`
- [Parquet image loader](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/parquet_dataset.py): `src/hpc_inference/datasets/parquet_dataset.py`
- [HDF5 image loader](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/hdf5_dataset.py): `src/hpc_inference/datasets/hdf5_dataset.py`
- [Parquet embedding reader](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/datasets/parquet_dataset.py): `src/hpc_inference/datasets/parquet_dataset.py`

### Runtime support

- [Rank distribution](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/utils/distributed.py): `src/hpc_inference/utils/distributed.py`
- [Shared utilities](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/utils/common.py): `src/hpc_inference/utils/common.py`
- [Resource profiling](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/utils/profiling.py): `src/hpc_inference/utils/profiling.py`

### Analysis and outputs

- [Grid search analysis](https://github.com/imageomics/hpc-inference/blob/main/src/hpc_inference/analyze_grid_search.py): `src/hpc_inference/analyze_grid_search.py`
- **Embedding files**
- **Profile reports**

### Other components

- **HPC user**

## Connections

- HPC user → Embedding runner: configures and runs (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Embedding runner → Image folder loader: selects input (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Embedding runner → Parquet image loader: selects input (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Embedding runner → HDF5 image loader: selects input (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Embedding runner → OpenCLIP models: runs inference (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Embedding runner → Rank distribution: uses rank support (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Image folder loader → Rank distribution: partitions files (evidence: `src/hpc_inference/datasets/image_folder_dataset.py`)
- Parquet image loader → Rank distribution: partitions files (evidence: `src/hpc_inference/datasets/parquet_dataset.py`)
- HDF5 image loader → Rank distribution: partitions files (evidence: `src/hpc_inference/datasets/hdf5_dataset.py`)
- Embedding runner → Shared utilities: loads configuration (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Embedding runner → Shared utilities: writes embeddings (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Embedding runner → Resource profiling: records metrics (evidence: `src/hpc_inference/inference/embed/open_clip_embed.py`)
- Shared utilities → Embedding files: writes Parquet (evidence: `src/hpc_inference/utils/common.py`)
- Resource profiling → Profile reports: writes reports (evidence: `src/hpc_inference/utils/profiling.py`)
- HPC user → Classification: runs classification (evidence: `README.md`)
- HPC user → Grid search analysis: analyzes grid search (evidence: `README.md`)
- HPC user → Parquet embedding reader: reads embeddings (evidence: `src/hpc_inference/datasets/parquet_dataset.py`)
