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.
| Option | Description |
|---|---|
--version, -V | Show CIMFlow version and exit |
--debug | Enable debug mode with full tracebacks and detailed error information |
--install-completion | Install completion for the current shell |
--show-completion | Show completion for the current shell |
--help, -h | Show 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:
cimflow run pipeline -m model.onnx -o outputcimflow run pipeline -m model.onnx -o output -t 16 -k 32 -c 128cimflow run pipeline -m model.onnx -o output --profile=from-configcimflow run pipeline -m model.onnx -o output --keep-ircimflow run pipeline -m model.onnx -o output -l VERBOSEBatch 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.
| Argument | Description |
|---|---|
<config-file> | Path to JSON configuration file |
Examples:
cimflow run from-file config/batch.jsoncimflow --debug run from-file config/batch.jsonSee 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 64Operator-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 16Simulation
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 16Log Levels
Control the verbosity of console output using the -l flag. Higher verbosity levels include all messages from lower levels.
TRACEDEBUGVERBOSEINFOWARNINGERROR# 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 outputThe --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.
012Shell Completion
Install shell completion for tab-completion of commands and options (auto-detects your current shell):
cimflow --install-completionView completion script without installing:
cimflow --show-completionLast updated on