Quickstart
End-to-end pipeline tutorial
Before starting, ensure CIMFlow is installed and your virtual environment is activated.
Verify Installation
Confirm CIMFlow is installed correctly:
# Check version
cimflow --versionExpected output:
CIMFlow 0.1.0Running a Pipeline
This section demonstrates running a complete compile-and-simulate pipeline with an example model.
Navigate to CIMFlow Directory
cd /path/to/CIMFlowReplace /path/to/CIMFlow with the actual installation directory.
Download Example Models
Example ONNX models are not included in the repository. Download them using the provided script:
./scripts/download_models.shThis downloads ResNet-18 and MobileNetV2 models to data/models/.
Custom ONNX models exported from PyTorch, TensorFlow, or other frameworks are also supported.
Run Pipeline with Example Model
cimflow run pipeline \
-m data/models/resnet18.onnx \
-o output/quickstart \
-t 8 \
-k 16 \
-b 16 \
-c 64This compiles ResNet-18 and simulates execution on a 64-core CIM accelerator.
View Results
After completion, check the output:
ls output/quickstart/The output directory contains simulation results including performance metrics.
Understanding the Output
The simulation produces several key metrics:
| Metric | Description |
|---|---|
| Cycles | Total clock cycles for inference |
| Latency | Execution time based on target clock frequency |
| Energy | Estimated energy consumption |
| Throughput | Inferences per second |
Detailed breakdowns are available in the output JSON files.
Running with Custom Parameters
Adjust hardware parameters via CLI flags:
cimflow run pipeline \
-m data/models/mobilenetv2.onnx \
-o output/mobilenet \
-t 16 \
-k 32 \
-b 8 \
-c 128 \
--batch-size 4| Flag | Parameter | Description |
|---|---|---|
-t | T | Macro group size |
-k | K | Macro group number |
-b | B | NoC flit size (bandwidth) |
-c | C | Core number |
--batch-size | - | Batch size |
For the complete parameter reference, see CLI Reference.
Batch Processing
Run multiple configurations from a JSON file:
Copy template:
cp config_templates/batch.json config/batch.jsonRun batch:
Edit config/batch.json with your models and parameters, then run:
cimflow run from-file config/batch.jsonExample configuration (update model_path to point to your ONNX model):
{
"paths_cfg": "tool_paths.json",
"output_dir": "output",
"keep_ir": false,
"run_name": "batch",
"runs": [
{
"model_path": "path/to/your/model.onnx",
"t": 8,
"k": 16,
"b": 16,
"c": 64,
"batch_size": 8,
"strategy": "dp",
"visualize": false
}
]
}Enabling Profiling
Enable profiling for performance breakdowns:
cimflow run pipeline \
-m data/models/resnet18.onnx \
-o output/profiled \
--profile=from-configDebugging Tips
These options are useful for troubleshooting compilation or simulation issues.
Keep Intermediate Files
cimflow run pipeline -m model.onnx -o output --keep-irSaves all IR files, ISA outputs, and logs in timestamped directories.
Enable Debug Mode
cimflow --debug run pipeline -m model.onnx -o outputProduces detailed tracebacks and debug-level logging.
Increase Log Verbosity
cimflow run pipeline -m model.onnx -o output -l VERBOSELog levels: TRACE | DEBUG | VERBOSE | INFO | WARNING | ERROR
CLI Quick Reference
| Command | Description |
|---|---|
cimflow --help | View all commands |
cimflow run pipeline --help | Pipeline options |
cimflow run from-file --help | Batch processing options |
cimflow compile --help | Compile only |
cimflow sim --help | Simulate only |
Next Steps
Last updated on