Loading repository data…
Loading repository data…
timoa / repository
This project is an experimentation of building training AI models using CI including building the Docker images for training and inference
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A production-ready template for AI research teams featuring optimized CI/CD pipelines, GPU-accelerated training infrastructure, and reproducible experiment workflows. Built with Bazel, PyTorch, and Kubernetes.
# Clone the repository
git clone https://github.com/your-org/ai-model-pipelines-example.git
cd ai-model-pipelines-example
# Install dependencies with Bazel
bazel build //...
# Or use pip for local development
pip install -r requirements.txt
# Run smoke test
python src/train.py --config configs/smoke-test.yaml
# Run with Bazel
bazel run //src:train -- --config configs/smoke-test.yaml
# Build base image
docker build -f docker/base/Dockerfile -t ai-research-platform-base:latest .
# Build training image
docker build -f docker/training/Dockerfile -t ai-research-platform-training:latest .
# Run training in container
docker run --gpus all -v $(pwd):/workspace \
ai-research-platform-training:latest \
python src/train.py --config configs/train-small.yaml
ai-model-pipelines-example/
├── .github/workflows/ # CI/CD pipelines
│ ├── ci-training.yml # Training & evaluation CI
│ ├── build-containers.yml # Docker image builds
│ └── data-pipeline.yml # Data processing automation
├── docker/ # Multi-stage Dockerfiles
│ ├── base/ # Base CUDA + PyTorch image
│ ├── training/ # Training environment with DeepSpeed
│ └── inference/ # Optimized inference with vLLM
├── k8s/ # Kubernetes manifests
│ ├── training-job.yaml # Single-node GPU training
│ ├── distributed-training.yaml # Multi-node PyTorchJob
│ └── jupyter-gpu.yaml # Interactive development environment
├── src/ # Source code
│ ├── models/ # Model implementations (GPT)
│ ├── data/ # Dataset classes
│ ├── train.py # Training script with DDP support
│ └── evaluate.py # Evaluation and benchmarking
├── scripts/ # Data processing & utilities
│ ├── download_data.py # Dataset download
│ ├── tokenize_data.py # Distributed tokenization
│ ├── split_data.py # Train/val splitting
│ └── verify_reproducibility.py # Checkpoint comparison
├── configs/ # Training configurations
│ ├── smoke-test.yaml # Fast validation config
│ └── train-small.yaml # Full training config
└── BUILD.bazel # Bazel build files
Automatically triggered on PRs affecting src/, configs/, or dependencies:
# Example: .github/workflows/ci-training.yml
- Smoke test training (100 steps)
- Verify checkpoint creation
- Compare two runs for reproducibility
- Upload artifacts for inspection
Multi-stage builds with aggressive caching:
Optimization Results:
Scheduled nightly runs for dataset processing:
# Automated workflow
1. Download dataset (OpenWebText, Wikipedia)
2. Distributed tokenization (4-16 workers)
3. Train/val split (95/5)
4. Generate statistics
5. Upload artifacts
Training configs use YAML format:
# configs/train-small.yaml
model:
n_layer: 12
n_head: 12
n_embd: 768
block_size: 1024
training:
batch_size: 12
learning_rate: 6.0e-4
max_iters: 100000
dtype: "bfloat16"
python src/train.py --config configs/train-small.yaml
torchrun --nproc_per_node=8 src/train.py --config configs/train-small.yaml
kubectl apply -f k8s/distributed-training.yaml
kubectl logs -f pytorch-gpt-distributed-training-master-0
python scripts/download_data.py \
--dataset openwebtext \
--output-dir data/raw
python scripts/tokenize_data.py \
--input-dir data/raw \
--output-dir data/tokenized \
--tokenizer gpt2 \
--num-workers 8
python scripts/split_data.py \
--input-dir data/tokenized \
--train-dir data/train \
--val-dir data/val \
--val-split 0.05
# Create namespace
kubectl create namespace ai-research
# Deploy PVCs for checkpoints and data
kubectl apply -f k8s/training-job.yaml
# Monitor training
kubectl logs -f job/gpt-training -n ai-research
kubectl apply -f k8s/jupyter-gpu.yaml
# Port forward to access
kubectl port-forward svc/jupyter-gpu 8888:8888 -n ai-research
| Metric | Before | After | Improvement |
|---|---|---|---|
| Docker Build Time | 45 min | 5 min | 9x faster |
| CI Pipeline Duration | 60 min | 12 min | 5x faster |
| GPU Utilization | 42% | 87% | 2x better |
| Training Reproducibility | 60% | 100% | Deterministic |
| Data Processing Time | 48 hrs | 4 hrs | 12x faster |
Contributions are welcome! Please read our contributing guidelines and submit PRs.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please open an issue on GitHub.
Built with ❤️ for AI Researchers