CIMFlow LogoCIMFlow

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/tool_paths.json
{
  "config_dir": "../modules/CIMFlow-Simulator/config/example",
  "profiler_cfg": "../modules/CIMFlow-Simulator/config/profiler_config.json",
  "compiler_bin": "cim-compiler",
  "simulator_bin": "cim-simulator"
}
FieldDescription
config_dirDirectory containing hardware configuration files
profiler_cfgPath to profiler configuration (optional)
compiler_binCompiler executable name or path
simulator_binSimulator 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.

config/batch.json
{
  "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

FieldDescription
paths_cfgPath to tool_paths.json (optional, defaults to config/tool_paths.json)
output_dirShared output directory for all runs
keep_irKeep intermediate IR files for debugging
run_nameName for batch output folder

Per-Run Settings

FieldDefaultDescription
model_path(required)Path to ONNX model
t8Macro group size
k16Macro group number
b16NoC bandwidth (flit size)
c64Number of cores
batch_size8Inference batch size
strategydpPartition strategy
visualizefalseVisualize partition result
log_levelnullLogging level (null uses default)
config_pathnullCustom 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-t
Macro group size — number of macros per group
K-k
Macro group number — number of macro groups per core
B-b
Bandwidth — NoC flit size in bytes
C-c
Core count — number of parallel execution cores

These 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 16

Hardware 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.json

Profiler Configuration File

profiler_config.json
{
  "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": []
  }
}
FieldDescription
profilingEnable profiling globally
report_to_jsonOutput results in JSON format
json_filePath for JSON output file
hardware_profiler_configHardware-level profiling options
inst_profiler_configInstruction-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 metadata

Debug 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 metadata

For log level options and debugging flags, see CLI Reference.

Last updated on