Configuration
Configuration files and parameters for CIMFlow
CIMFlow uses JSON configuration files to define tool paths, batch runs, and hardware parameters.
Configuration Directory
After installation, configuration files are stored in config/:
config/
├── tool_paths.json # Tool paths and global settings
└── batch.json # Batch run configurations (user-created)tool_paths.json
Defines paths to CIMFlow tools and hardware configuration directories.
batch.json
User-created file for defining multiple pipeline runs with different parameters.
Tool Paths Configuration
The tool_paths.json file defines paths to CIMFlow tools and resources.
{
"config_dir": "../modules/CIMFlow-Simulator/config/example",
"profiler_cfg": "../modules/CIMFlow-Simulator/config/profiler_config.json",
"compiler_bin": "cim-compiler",
"simulator_bin": "cim-simulator"
}| Field | Description |
|---|---|
config_dir | Directory containing hardware configuration files |
profiler_cfg | Path to profiler configuration (optional) |
compiler_bin | Compiler executable name or path |
simulator_bin | Simulator executable name or path |
Relative paths in tool_paths.json are resolved relative to the file's directory.
This file is generated during installation. Modify it to use custom tool paths or configuration directories.
Batch Configuration
Batch files define multiple pipeline runs with different parameters.
{
"paths_cfg": "tool_paths.json",
"output_dir": "output",
"keep_ir": false,
"run_name": "batch",
"runs": [
{
"model_path": "path/to/model.onnx",
"t": 8,
"k": 16,
"b": 16,
"c": 64,
"batch_size": 8,
"strategy": "dp",
"visualize": false,
"log_level": null,
"config_path": null
}
]
}Global Settings
| Field | Description |
|---|---|
paths_cfg | Path to tool_paths.json (optional, defaults to config/tool_paths.json) |
output_dir | Shared output directory for all runs |
keep_ir | Keep intermediate IR files for debugging |
run_name | Name for batch output folder |
Per-Run Settings
| Field | Default | Description |
|---|---|---|
model_path | (required) | Path to ONNX model |
t | 8 | Macro group size |
k | 16 | Macro group number |
b | 16 | NoC bandwidth (flit size) |
c | 64 | Number of cores |
batch_size | 8 | Inference batch size |
strategy | dp | Partition strategy |
visualize | false | Visualize partition result |
log_level | null | Logging level (null uses default) |
config_path | null | Custom hardware config (null auto-resolves) |
profile | "" | Profiling: "" (disabled), "from-config", or path to config |
Model paths can be absolute or relative to the batch file location.
Hardware Parameters
CIMFlow's hardware model is controlled by four primary parameters:
T-tK-kB-bC-cThese parameters affect:
- Compilation: Operator partitioning and memory allocation
- Simulation: Timing accuracy and resource utilization
For theoretical background and architectural details, see Hardware Abstractions.
Auto-Resolution
When --config is not specified, CIMFlow automatically resolves the hardware configuration based on T and B values. Configuration files are named config-mg{T}-b{B}.json in the config directory.
# Uses config-mg8-b16.json automatically
cimflow run pipeline -m model.onnx -o output -t 8 -b 16Hardware Configuration Files
Hardware configuration files define the complete accelerator architecture.
Profiling Configuration
Enable profiling for detailed performance breakdowns.
# Use profiler config from tool_paths.json
cimflow run pipeline -m model.onnx -o output --profile=from-config
# Use custom profiler config
cimflow run pipeline -m model.onnx -o output --profile=path/to/profiler.jsonProfiler Configuration File
{
"profiling": false,
"report_to_json": true,
"json_flat": true,
"json_file": "../report/profiling.json",
"hardware_profiler_config": {
"profiling": false,
"record_timing_segments": false,
"each_core_profiling": false,
"report_level_cnt_": 2
},
"inst_profiler_config": {
"single_inst_profiling": false,
"inst_type_profiling": false,
"inst_group_profiling": false,
"inst_groups": []
}
}| Field | Description |
|---|---|
profiling | Enable profiling globally |
report_to_json | Output results in JSON format |
json_file | Path for JSON output file |
hardware_profiler_config | Hardware-level profiling options |
inst_profiler_config | Instruction-level profiling options |
Output Directory Structure
CIMFlow organizes output based on the --keep-ir flag:
Default Output (--no-keep-ir)
output/
└── 20250101_120000_example_run/ # Timestamped folder with run_name
├── simulation_report_*.txt # Per-model simulation reports
├── profiling_*.json # Profiling output (if enabled)
└── run_info.json # Batch run metadataDebug Output (--keep-ir)
output/
└── 20250101_120000_resnet18/ # Timestamped folder with model name
├── instructions_*.json # CG-level instructions
├── isa_instructions_*.json # OP-level ISA output
├── simulation_report.txt # Simulation report
├── profiling_*.json # Profiling output (if enabled)
└── run_info.json # Run metadataFor log level options and debugging flags, see CLI Reference.
Last updated on