Examples
Hands-on tutorials for CIMFlow compilation and simulation
This section provides hands-on tutorials for using CIMFlow to compile and simulate deep learning models on CIM hardware. Follow the tutorials in order for the best learning experience.
Tutorial Overview
Prerequisites
The Docker image includes all dependencies and example models pre-configured.
docker pull ghcr.io/buaa-ci-lab/cimflow-tutorial:latestThe download is approximately 3GB. Ensure 15GB or more disk space is available after unpacking.
If running locally, ensure CIMFlow is installed and download example models:
./scripts/download_models.shLocal installation requires Ubuntu 22.04+ (see system requirements) and building LLVM/MLIR from source (~20-30 minutes).
Quick Start with Docker
Start an interactive container
docker run -it --rm \
-v "$(pwd)/output:/app/output" \
ghcr.io/buaa-ci-lab/cimflow-tutorial:latestdocker run -it --rm `
-v "${PWD}/output:/app/output" `
ghcr.io/buaa-ci-lab/cimflow-tutorial:latestdocker run -it --rm -v "%cd%/output:/app/output" ghcr.io/buaa-ci-lab/cimflow-tutorial:latestThis mounts a local output directory to persist results outside the container.
Run the tutorial scripts
Inside the container, execute the demo scripts in order:
./tutorial/demo0_setup.sh # Verify installation
./tutorial/demo1_quickstart.sh # End-to-end pipeline
./tutorial/demo2_stages.sh # Step-by-step compilation
./tutorial/demo3_exploration.sh # Design space explorationKey Terminology
Hardware Parameters Reference
These parameters configure the CIM architecture for compilation and simulation:
| Parameter | Flag | Description | Typical Values |
|---|---|---|---|
| T | -t | Macro group size (rows per macro) | 8, 16 |
| K | -k | Macro group number (macros per core) | 16, 32 |
| B | -b | NoC bandwidth (flits per cycle) | 8, 16 |
| C | -c | Total core count in the accelerator | 64, 128 |
| batch_size | --batch-size | Inference batch size | 1, 2, 4, 8 |
When parameters are omitted from a command, CIMFlow uses default values. See CLI Reference for all defaults.
Output Metrics
After simulation, CIMFlow reports these performance metrics:
Get Started
Ready to begin?
Start with the Docker Tutorial to set up your environment, then follow the tutorials in sequence for the complete learning experience.
Last updated on