CIMFlow LogoCIMFlow

CLI Reference

Complete command-line interface reference for CIMFlow

The cimflow command provides unified access to compilation, simulation, and pipeline execution. It serves as the primary interface for running CIMFlow workflows, from compiling ONNX models to simulating their execution on CIM hardware.

cimflow [OPTIONS] COMMAND [ARGS]...

Commands Overview

CIMFlow organizes functionality into three main command groups. Most users will use run pipeline for end-to-end execution, while compile and sim provide finer control for debugging or custom workflows.


Global Options

These options can be used with any command and must appear before the subcommand name.

OptionDescription
--version, -VShow CIMFlow version and exit
--debugEnable debug mode with full tracebacks and detailed error information
--install-completionInstall completion for the current shell
--show-completionShow completion for the current shell
--help, -hShow this message and exit

Pipeline Execution

The run command group provides end-to-end pipeline execution. It handles compilation and simulation in a single invocation, making it the recommended approach for most workflows.

Full Pipeline

cimflow run pipeline [OPTIONS]

Executes the complete CIMFlow pipeline: CG-level compilation, OP-level compilation, and cycle-accurate simulation. This is the primary command for evaluating neural network models on CIM hardware.

Examples:

Basic pipeline
cimflow run pipeline -m model.onnx -o output
Custom hardware parameters
cimflow run pipeline -m model.onnx -o output -t 16 -k 32 -c 128
With profiling
cimflow run pipeline -m model.onnx -o output --profile=from-config
Keep intermediate files
cimflow run pipeline -m model.onnx -o output --keep-ir
Verbose logging
cimflow run pipeline -m model.onnx -o output -l VERBOSE

Batch Execution

cimflow run from-file <config-file>

Executes one or more pipeline runs defined in a JSON configuration file. This is useful for batch processing multiple models or exploring different hardware configurations systematically.

ArgumentDescription
<config-file>Path to JSON configuration file

Examples:

Run batch from config
cimflow run from-file config/batch.json
Run with debug mode
cimflow --debug run from-file config/batch.json

See Configuration for batch file format.


Compilation

The compile command group provides direct access to CIMFlow's two-level compiler. Use these commands when you need to run compilation stages separately, inspect intermediate representations, or integrate with custom workflows.

Graph-Level Compilation

cimflow compile cg [OPTIONS]

Performs CG-level (Computational Graph) compilation. This stage analyzes the ONNX model, partitions workloads across cores, and generates intermediate instructions for each core.

Example:

cimflow compile cg -m model.onnx -o output/cg -t 8 -k 16 -c 64

Operator-Level Compilation

cimflow compile op [OPTIONS]

Performs OP-level (Operator) compilation. This stage takes CG-level output and generates executable machine instructions using the LLVM/MLIR infrastructure. Requires a hardware configuration file to determine resource constraints.

Example:

cimflow compile op -i output/cg/instructions.json -o output/op -t 8 -b 16

Simulation

cimflow sim [OPTIONS]

The sim command runs the cycle-accurate simulator on compiled instructions. Use this command when you have pre-compiled instruction files and want to run simulation separately, or when experimenting with different hardware configurations without recompiling.

Example:

cimflow sim -i output/op/instructions.bin -o output/sim -t 8 -b 16

Log Levels

Control the verbosity of console output using the -l flag. Higher verbosity levels include all messages from lower levels.

TRACE
All internal operations
For deep debugging
DEBUG
Debug information
For troubleshooting
VERBOSE
Detailed progress
For understanding execution flow
INFO
Standard progress
Default level
WARNING
Warnings only
For quiet operation
ERROR
Errors only
For minimal output
# Verbose logging for detailed progress
cimflow run pipeline -m model.onnx -o output -l VERBOSE

# Debug mode with full tracebacks
cimflow --debug run pipeline -m model.onnx -o output

The --debug global flag automatically sets log level to DEBUG and enables full Python tracebacks.


Exit Codes

CIMFlow returns standard exit codes that can be used in scripts and automation workflows.

0
Success
1
Runtime error
2
Invalid arguments

Shell Completion

Install shell completion for tab-completion of commands and options (auto-detects your current shell):

cimflow --install-completion

View completion script without installing:

cimflow --show-completion

Last updated on