Skip to main content

cirron compile

Compile your ML models for production deployment with architecture-specific optimizations and validation.

Usage

Options

OptionDescriptionDefault
--arch, -aTarget architecture (cpu, cuda, gpu)Auto-detected
--indexPath to index/manifest file (JSON or YAML)null
--validateRun pre-compilation validationfalse
--strictFail fast on validation errors with detailed messagesfalse
-i, --interactiveStep-by-step compilation confirmationsfalse

Architecture and Framework Support

ArchitectureFrameworksNotes
cpuPyTorch, TensorFlow, Scikit-learnLightweight, compatible with all frameworks
cudaPyTorchGPU-accelerated, validates CUDA availability
gpuTensorFlowGPU-accelerated, validates GPU availability
Compilation reads 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)
Metadata is written to 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

YAML form is also accepted. Pass with --index config/index.json or --index config/index.yaml.

Examples

Output

Troubleshooting

ErrorResolution
No cirron.yaml foundRun cirron init <name> to initialize the project
Required file missing: src/model.pyCreate the model file and verify it imports cleanly
Python 3.9+ required, found 3.7Upgrade Python or update pythonVersion in cirron.yaml
CUDA not available for PyTorchSwitch to --arch cpu, or install CUDA and verify with nvidia-smi
Compilation failedRun python3 src/model.py to surface errors; check pip install -r requirements.txt

Integration