cirron compile
Compile your ML models for production deployment with architecture-specific optimizations and validation.Usage
Options
| Option | Description | Default |
|---|---|---|
--arch, -a | Target architecture (cpu, cuda, gpu) | Auto-detected |
--index | Path to index/manifest file (JSON or YAML) | null |
--validate | Run pre-compilation validation | false |
--strict | Fail fast on validation errors with detailed messages | false |
-i, --interactive | Step-by-step compilation confirmations | false |
Architecture and Framework Support
| Architecture | Frameworks | Notes |
|---|---|---|
cpu | PyTorch, TensorFlow, Scikit-learn | Lightweight, compatible with all frameworks |
cuda | PyTorch | GPU-accelerated, validates CUDA availability |
gpu | TensorFlow | GPU-accelerated, validates GPU availability |
src/model.py, optimizes for the target architecture, and writes:
- PyTorch →
models/model_{arch}.pth - TensorFlow →
models/model_{arch}/ - Scikit-learn →
models/model_{arch}.joblib(via joblib)
artifacts/model_info.json.
Validation
With--validate, the command verifies required files (src/model.py, requirements.txt), Python version compatibility, architecture-specific requirements (e.g. CUDA availability), model instantiation, and index file format. Combine with --strict to fail on the first issue.
Index Files
--index config/index.json or --index config/index.yaml.
Examples
Output
Troubleshooting
| Error | Resolution |
|---|---|
No cirron.yaml found | Run cirron init <name> to initialize the project |
Required file missing: src/model.py | Create the model file and verify it imports cleanly |
Python 3.9+ required, found 3.7 | Upgrade Python or update pythonVersion in cirron.yaml |
CUDA not available for PyTorch | Switch to --arch cpu, or install CUDA and verify with nvidia-smi |
Compilation failed | Run python3 src/model.py to surface errors; check pip install -r requirements.txt |