Overview: A research project focused on predicting and explaining bottlenecks in LLM training jobs using heterogeneous graph neural networks. The project converts training execution traces into graphs and trains GNNs to predict step times, identify critical nodes, and suggest optimizations.
BottleneckOracle/
├── README.md # Main project documentation
├── requirements.txt # Python dependencies
├── .gitignore # Version control exclusions
├── patch_nb03.py # Notebook patching utility
├── REPOSITORY_STRUCTURE.md # This file
├── data/ # Data storage
│ ├── graphs/.gitkeep # Processed PyG HeteroData files (.pt)
│ └── raw/.gitkeep # Raw trace files (.json)
├── src/ # Source code (planned structure)
│ ├── graph_pipeline/.gitkeep # Chakra trace → NetworkX DAG
│ ├── models/.gitkeep # HeteroGAT and baseline models
│ ├── training/.gitkeep # Training and evaluation scripts
│ ├── systems/.gitkeep # Picotron instrumentation tools
│ └── llm/.gitkeep # GraphRAG integration utilities
├── notebooks/ # Research implementation
│ ├── 01_trace_generation_ipynb.ipynb
│ ├── 02-trace-generation-fixed.ipynb
│ ├── 03_heterogat_fixed.ipynb
│ ├── 04_timing_based_dag.ipynb
│ ├── model_1f1b.ipynb
│ └── Citation.ris
└── paper/ # Academic paper documentation
└── .gitkeep
Purpose: Main project documentation and quickstart guide
Contents:
- Project description and goals
- Team structure and ownership
- Repository structure overview
- Quickstart commands
- Node and edge type definitions
- Future work roadmap
Purpose: Python dependencies specification
Key Dependencies:
- Deep Learning:
torch,torch-geometric - Graph Processing:
networkx - Data Science:
numpy,pandas,scikit-learn,xgboost - Visualization:
matplotlib - Utilities:
scipy,tqdm,pyyaml
Purpose: Version control exclusions
Excludes:
- Data directories (
data/raw/,data/graphs/) - Cache and build artifacts (
__pycache__/,*.pyc) - Environment files (
.env) - Model checkpoints (
*.pt,*.pth) - Virtual environments (
venv/)
Purpose: Utility script for patching notebook 03
Functionality:
- Updates imports from
huggingface_hubto usesnapshot_download - Modifies graph-loading code to use correct repository ID
- Applies fixes for notebook compatibility issues
Status: Currently contains placeholder files (.gitkeep) - planned modular structure
Note: Actual implementation is in the notebooks directory
Purpose: Chakra trace → NetworkX DAG conversion pipeline
Intended Functionality:
- Parse Chakra execution traces
- Build directed acyclic graphs
- Feature engineering and preprocessing
Purpose: HeteroGAT and baseline model implementations
Intended Functionality:
- Heterogeneous GNN architectures
- Multi-task learning frameworks
- Baseline comparison models
Purpose: Training and evaluation scripts
Intended Functionality:
- Model training loops
- Evaluation metrics
- Experiment logging
Purpose: Picotron instrumentation tools
Intended Functionality:
- Production trace collection
- Performance monitoring
- Real-time analysis
Purpose: GraphRAG integration utilities
Intended Functionality:
- LLM-based optimization suggestions
- Graph retrieval augmented generation
- Natural language explanations
Purpose: Proof-of-concept trace generation pipeline
Key Features:
- Generates synthetic transformer traces using PyTorch Profiler
- Parses Chrome traces into NetworkX graphs
- Implements basic feature engineering and critical path analysis
- Converts to PyTorch Geometric HeteroData format
- Generates 501 synthetic graphs across 3 model configurations
Output: Initial dataset with basic graph structure
Purpose: Enhanced trace generation with HuggingFace integration
Improvements over v1:
- Fixes graph edge construction timing logic
- Implements proper multi-task head (node + graph level)
- Adds batch upload to HuggingFace datasets
- Implements directed vs bidirectional GAT variants
- Includes comprehensive validation checks
Output: Production-ready dataset with proper labels
Purpose: Core HeteroGAT model implementation
Key Features:
- Two-layer heterogeneous GNN with GAT convolutions
- Multi-task learning (node criticality + step time prediction)
- Bidirectional vs directed message passing variants
- Comprehensive evaluation with baselines
- Acceptance criteria testing
Models: HeteroGAT with attention mechanisms
Purpose: Realistic DAG construction based on timing constraints
Key Innovation:
- Timing-based edge creation (non-overlapping ops only)
- Generates genuine parallelism in graphs
- Improved critical path labeling
- 501 graphs with healthy variance in critical node fractions
Output: More realistic parallel execution graphs
Purpose: 1F1B analytic baseline comparison
Functionality:
- Implements 1F1B formula (sum of compute node durations)
- MLP baseline implementation
- Train/validation/test split management
- Error analysis and comparison
Baselines: Analytical formulas and simple MLP
Purpose: Academic reference file
Content: Citation for electrocardiogram standardization paper (placeholder/example)
Status: Contains placeholder files - actual data hosted on HuggingFace
Purpose: Placeholder for processed PyG HeteroData files (.pt)
Content: Graph objects ready for GNN training
Purpose: Placeholder for raw trace files (.json)
Content: Chrome trace format execution traces
Dataset Information:
- Size: 501 synthetic training traces
- Configurations: 3 transformer model sizes (tiny, small, medium)
- Hosted: HuggingFace dataset
preethamvj/bottleneck-oracle-graphs - Split: 70% train, 15% validation, 15% test
Status: Currently contains only placeholder file
Purpose: Academic paper documentation and LaTeX sources
compute: Neural network operations (matmul, attention, etc.)network: Communication operations (allreduce, comm, etc.)
('compute', 'depends_on', 'compute'): Sequential dependencies('compute', 'sends_to', 'network'): Compute to communication('network', 'feeds', 'compute'): Communication to compute
duration_ms: Operation durationcompute_ratio: Duration relative to total timenorm_duration: Normalized durationis_critical: Binary label from critical path analysis
- Input: Heterogeneous graph with compute/network nodes
- Output:
- Node-level: Criticality scores (Spearman correlation)
- Graph-level: Step time prediction (MSE + ΔT%)
- Variants: Bidirectional GAT vs Directed GAT
- Spearman ρ: Node criticality prediction accuracy
- ΔT%: Step time prediction error percentage
- MSE: Mean squared error for step time prediction
- Critical Fraction: Ratio of critical nodes (target: 0.05-0.5)
- Trace Generation: PyTorch Profiler → Chrome traces (.json)
- Graph Processing: NetworkX DAG → PyG HeteroData (.pt)
- Model Training: HeteroGAT models → Multi-task learning
- Evaluation: Step time prediction + Criticality scoring
- Optimization: GraphRAG loop → LLM suggestions
- Complete trace generation pipeline
- Graph processing and conversion
- HeteroGAT model implementation
- Multi-task training framework
- Comprehensive evaluation pipeline
- HuggingFace dataset integration
src/graph_pipeline/: Production trace parsingsrc/models/: Model implementationssrc/training/: Training utilitiessrc/systems/: Picotron integrationsrc/llm/: GraphRAG optimization
- Actual Python source code (notebooks contain working implementation)
- Paper LaTeX sources
- Configuration files
- Test scripts
- Documentation beyond README
The BottleneckOracle repository represents a comprehensive research project with a working end-to-end pipeline, primarily implemented through Jupyter notebooks, with a planned modular Python structure for future production deployment. The project successfully demonstrates the use of heterogeneous graph neural networks for predicting and explaining performance bottlenecks in LLM training jobs.
Key Achievement: Working pipeline from synthetic trace generation to GNN-based bottleneck prediction with multi-task learning for both step time estimation and critical node identification.
Future Work: Migrate notebook implementations to modular Python structure, integrate with production systems (Picotron), and develop LLM-based optimization suggestions using GraphRAG.