refactors
This commit is contained in:
@@ -29,7 +29,8 @@ lowering, scheduling, memory layout, and code-generation optimizations.
|
||||
- `backend-simulators/pim/pim-simulator` is the in-tree Rust functional
|
||||
simulator used by validation. It reads Raptor's `pim/` artifact directory and
|
||||
compares simulator output against native ONNX-MLIR execution.
|
||||
- `backend-simulators/pim/pimsim-nn` is the performance simulator submodule.
|
||||
- `backend-simulators/pim/pimsim-nn` is the non-functional simulator submodule
|
||||
used internally by validation for latency, power, and energy.
|
||||
The helper scripts in `pimcomp_utils/` are for comparison with PIMCOMP-NN and
|
||||
contain local paths; treat them as local utilities, not portable workflows.
|
||||
|
||||
@@ -155,7 +156,7 @@ This writes PIM artifacts under `/tmp/raptor/pim/`.
|
||||
|
||||
Functional validation lives in `validation/`. It compiles ONNX models, builds a
|
||||
native ONNX-MLIR reference runner, generates random inputs, runs Raptor, runs
|
||||
the Rust PIM simulator, and compares outputs.
|
||||
the Rust functional simulator, and compares outputs.
|
||||
|
||||
Python dependencies used by the validation scripts are `numpy`, `onnx`, and
|
||||
`colorama`. The simulator requires the Rust toolchain.
|
||||
@@ -167,9 +168,6 @@ Per-operation validation from the repository root:
|
||||
--raptor-path build_release/Release/bin/onnx-mlir \
|
||||
--onnx-include-dir onnx-mlir/include \
|
||||
--operations-dir validation/operations \
|
||||
--crossbar-count 64 \
|
||||
--crossbar-size 128 \
|
||||
--core-count 144 \
|
||||
--verbose \
|
||||
--raptor-extra-arg=--pim-detect-communication-deadlock \
|
||||
--raptor-extra-arg=--pim-export-spatial-dataflow=none
|
||||
@@ -183,17 +181,24 @@ containing `.onnx` files:
|
||||
--raptor-path build_release/Release/bin/onnx-mlir \
|
||||
--onnx-include-dir onnx-mlir/include \
|
||||
--operations-dir validation/networks/yolo11n/depth_04 \
|
||||
--crossbar-count 64 \
|
||||
--crossbar-size 128 \
|
||||
--core-count 144 \
|
||||
--verbose \
|
||||
--raptor-extra-arg=--pim-detect-communication-deadlock \
|
||||
--raptor-extra-arg=--pim-export-spatial-dataflow=none
|
||||
```
|
||||
|
||||
Useful validation options:
|
||||
- `--simulator-dir <path>` - override the auto-detected
|
||||
- `--simulator-dir <path>` - override the auto-detected functional
|
||||
`backend-simulators/pim/pim-simulator` path.
|
||||
- `--pimcomp-config <arch-a|arch-b|arch-c>` - select the checked-in
|
||||
non-functional simulation profile. Arch-A is the default; the hardware
|
||||
argument defaults match it (`168` cores, `96` crossbars/core, `128x128`
|
||||
crossbars).
|
||||
Selecting another profile also requires its matching hardware arguments.
|
||||
- `--non-functional-simulator-build-dir <path>` - override the auto-detected
|
||||
non-functional simulator build directory.
|
||||
- `--skip-non-functional-simulation` - skip non-functional simulation. If
|
||||
explicit core/crossbar arguments do not match the selected profile, validation
|
||||
reports the mismatch and skips only non-functional simulation.
|
||||
- `--threshold <float>` - maximum allowed per-element output difference.
|
||||
- `--seed <int>` - RNG seed for generated inputs.
|
||||
- `--command-timeout-seconds <float>` - timeout for compiler, runner, and
|
||||
@@ -208,7 +213,14 @@ Each validation run writes artifacts in the model workspace, for example under
|
||||
- `raptor/` - compiler artifacts, including `*.onnx.mlir`, dialect dumps under
|
||||
`dialects/`, reports under `reports/`, and final PIM artifacts under `pim/`.
|
||||
- `runner/` - generated reference runner source, build tree, and shared library.
|
||||
- `simulation/out.bin` - raw simulator output used for comparison.
|
||||
- `simulation/out.bin` - raw functional simulation output used for comparison.
|
||||
|
||||
By default, validation also runs non-functional simulation. Per-model `Latency`
|
||||
is shown in the result table alongside `Power`, with measured, failed, and
|
||||
skipped counts plus total latency in the summary. Use these validation results
|
||||
for performance comparisons; the simulation backend does not need to be invoked
|
||||
separately. The selected pre-generated configs and meshes live under
|
||||
`validation/pimsim_configs/pimcomp/`.
|
||||
|
||||
The compiler currently dumps dialect snapshots such as `spatial0.mlir`,
|
||||
`spatial1_graph.mlir`, `spatial2_trivial_merged.mlir`,
|
||||
@@ -216,8 +228,8 @@ The compiler currently dumps dialect snapshots such as `spatial0.mlir`,
|
||||
`pim2_folded.mlir`, and `pim3_memory_planned.mlir` when an output directory is
|
||||
available.
|
||||
|
||||
To rerun the simulator manually with tracing after validation has produced a
|
||||
`raptor/pim/` directory:
|
||||
To rerun the functional simulator manually with tracing after validation has
|
||||
produced a `raptor/pim/` directory:
|
||||
|
||||
```bash
|
||||
cd backend-simulators/pim/pim-simulator
|
||||
@@ -360,7 +372,7 @@ cargo test
|
||||
- `validation/` - functional validation scripts, ONNX operation tests, network
|
||||
slices, and pimsim config generation.
|
||||
- `backend-simulators/pim/pim-simulator/` - in-tree Rust functional simulator.
|
||||
- `backend-simulators/pim/pimsim-nn/` - performance simulator submodule.
|
||||
- `backend-simulators/pim/pimsim-nn/` - non-functional simulator submodule.
|
||||
- `pimcomp_utils/` - local comparison helpers for PIMCOMP-NN.
|
||||
- `.github/actions/` and `.github/workflows/validate_operations.yml` - CI setup
|
||||
for MLIR/Protobuf caching, building Raptor, and validation.
|
||||
|
||||
Reference in New Issue
Block a user