Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cirron.com/llms.txt

Use this file to discover all available pages before exploring further.

cirron plan

Generate comprehensive execution plans for Cirron operations including compilation and building. The plan command provides detailed analysis of what will be executed, estimated resources, and potential issues before running actual operations. You can also save, compare, and replay plans.

Usage

cirron plan <command> [options]

Commands

CommandDescription
compileGenerate compilation plan for ML models
buildGenerate build plan for ML projects
diffCompare two saved plans
saveSave plans for future reference
replayExecute a saved plan from file

Options

The following options apply to plan compile and plan build:
OptionDescriptionDefault
--arch, -aTarget architecture (cpu, cuda, gpu)Auto-detected
--indexPath to index/manifest filenull
--validateRun validation checks during planningfalse
--saveSave plan to filefalse
--jsonOutput plan in JSON formatfalse
--verboseShow detailed plan informationfalse
-i, --interactiveEnhanced planning with save optionsfalse

Plan Compile

Generate a detailed compilation plan for ML models.
# Basic compilation plan
cirron plan compile

# Plan with specific architecture
cirron plan compile --arch cuda

# Plan with validation
cirron plan compile --validate

# Save plan for later
cirron plan compile --save my-compile-plan.json

Compilation Plan Features

Architecture Analysis

  • CPU Compilation: Standard CPU optimization
  • CUDA Compilation: GPU acceleration for PyTorch
  • GPU Compilation: GPU acceleration for TensorFlow

Validation Checks

  • Required files verification (src/model.py, requirements.txt)
  • Architecture-specific validation (CUDA availability)
  • Framework compatibility checks
  • Dependency resolution analysis

Simulation Steps

Compilation simulation:
  Environment setup simulation
  Dependencies resolution simulation
  Model compilation simulation
  cuda optimization simulation
  Artifact generation simulation

Plan Build

Generate a build plan for ML projects with containerization.
# Basic build plan
cirron plan build

# Build plan with validation
cirron plan build --validate --save build-plan.json

Build Plan Features

ML Project Support

  • PyTorch Projects: CUDA and CPU builds
  • TensorFlow Projects: GPU and CPU builds
  • Scikit-learn Projects: CPU-only builds

Build Simulation

Build simulation:
  Environment setup simulation
  Dependencies resolution simulation
  Model build simulation
  cuda optimization simulation
  Artifact generation simulation

Plan Diff

Compare two saved plans to identify differences.
# Compare specific plans
cirron plan diff plan-a.json plan-b.json

# Save comparison
cirron plan diff plan-a.json plan-b.json --save comparison.json

Comparison Features

Plan Validation

  • Validates plan file structure
  • Checks for required fields
  • Ensures plan compatibility

Difference Analysis

  • Added: New configurations, dependencies, or steps
  • Removed: Deleted configurations or steps
  • Changed: Modified values or parameters
  • Unchanged: Identical configurations

Enhanced Diff Display

Dependencies Changed:
- torch==1.9.0
+ torch==2.0.0
+ numpy==1.21.0

Model Params:
- Total: 1.2M -> 2.1M (+75.0%)

Plan Save

Save plans for future reference and comparison.

Save Options

OptionDescriptionDefault
--allSave all plan types (compile, build)false
--name <filename>Custom filename for the saved planAuto-generated
--description <desc>Description for the saved plan-
--tags <tags>Comma-separated tags for the saved plan-
--listList all saved plansfalse
--cleanup [days]Remove plans older than specified days30
--verboseShow detailed save informationfalse
--jsonOutput plan in JSON formatfalse
# Save specific plan type
cirron plan save compile --name my-compile-plan

# Save all plan types
cirron plan save --all --tags "production,optimized"

# List saved plans
cirron plan save --list

# Clean up old plans
cirron plan save --cleanup 30

Save Examples

Single Plan Types

# Save compilation plan
cirron plan save compile --name "production-compile" --description "Production compilation plan"

# Save build plan
cirron plan save build --tags "gpu,optimized"

Batch Operations

# Save all plan types
cirron plan save --all --name "project-baseline" --tags "baseline,comprehensive"

# List all saved plans
cirron plan save --list

# Clean up plans older than 30 days
cirron plan save --cleanup 30

Plan Management

Plan Metadata

  • Timestamp: When plan was generated
  • Description: User-provided description
  • Tags: Categorization tags
  • Command: Original command type
  • Framework: ML framework used

Storage Location

Plans are stored in ~/.cirron/plans/ with the following structure:
~/.cirron/plans/
├── compile-plan-2024-01-15T10-30-00.json
├── build-plan-production.json
└── build-plan-baseline.json

Plan Replay

Execute a previously saved plan from file.
# Replay a saved plan
cirron plan replay --plan build-plan.json

# Validate environment before replaying
cirron plan replay --plan compile-plan.json --validate

# Dry run to preview
cirron plan replay --plan compile-plan.json --dry-run

# Force replay despite compatibility warnings
cirron plan replay --plan build-plan.json --force --verbose

Replay Options

OptionDescriptionDefault
--plan <file>Plan file to replay (required)-
--validateValidate environment compatibilitytrue
--dry-runShow what would be executed without runningfalse
--verboseShow detailed execution informationfalse
--forceForce replay despite compatibility warningsfalse

Examples

Basic Planning Workflow

# Generate compilation plan
cirron plan compile --arch cuda --save

# Generate build plan
cirron plan build --validate --save

# Compare plans
cirron plan diff compile-plan.json build-plan.json

# Execute actual operations
cirron compile --arch cuda
cirron build

Advanced Planning

# Comprehensive project analysis
cirron plan save --all --name "project-analysis" --tags "analysis,comprehensive"

# Compare different configurations
cirron plan compile --arch cpu --save cpu-plan.json
cirron plan compile --arch cuda --save cuda-plan.json
cirron plan diff cpu-plan.json cuda-plan.json

# Replay a saved plan
cirron plan replay --plan cuda-plan.json --validate

CI/CD Integration

# Generate plans in CI
cirron plan compile --arch cpu --json > compile-plan.json
cirron plan build --json > build-plan.json

# Validate plans before execution
cirron plan diff compile-plan.json previous-compile-plan.json

# Replay a known-good plan
cirron plan replay --plan production-compile.json --validate

Output Formats

Console Output

Compilation Plan:
  Project: sentiment-analysis
  Framework: pytorch
  Architecture: cuda
  Generated: 1/15/2024, 10:30:00 AM

Compilation Steps:
  Environment setup
  Dependencies resolution
  Model compilation
  CUDA optimization
  Artifact generation

Generated Artifacts:
  models/model_cuda.pth
  artifacts/model_info.json

JSON Output

{
  "command": "compile",
  "framework": "pytorch",
  "architecture": "cuda",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "steps": [
    {
      "name": "Environment Setup",
      "description": "Prepare Python environment",
      "estimatedTime": "30s"
    }
  ],
  "artifacts": [
    "models/model_cuda.pth",
    "artifacts/model_info.json"
  ]
}

Integration

Development Workflow

# Plan before major changes
cirron plan compile --save before-changes.json

# Make changes to model
# ... edit src/model.py ...

# Plan after changes
cirron plan compile --save after-changes.json

# Compare impact
cirron plan diff before-changes.json after-changes.json

Team Collaboration

# Share plans with team
cirron plan save compile --name "team-baseline" --tags "team,shared"

# Replay the team baseline
cirron plan replay --plan team-baseline.json --validate

Troubleshooting

Common Issues

Missing Project Configuration

Error: No cirron.yaml found
Solution: Initialize project first
cirron init my-project

Invalid Plan Files

Error: Invalid plan files
Solution: Regenerate plans
cirron plan compile --save new-plan.json

Best Practices

Plan Organization

  • Use descriptive names for saved plans
  • Add tags for categorization
  • Include descriptions for context
  • Regular cleanup of old plans

Comparison Strategy

  • Save baseline plans before major changes
  • Compare configurations before deployment
  • Use diff to understand changes between versions
  • Export comparisons for documentation

Integration Tips

  • Generate plans in CI/CD pipelines
  • Compare plans across environments
  • Use JSON output for programmatic processing
  • Regular plan validation and cleanup