Skip to content

Commit 526bca3

Browse files
authored
support hardware testing (#348)
1 parent e9d6055 commit 526bca3

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ python -m graph_net.plot_violin \
9696

9797
The scripts are designed to process a file structure as `/benchmark_path/category_name/`, and items on x-axis are identified by name of the sub-directories. After executing, several summary plots of result in categories (model tasks, libraries...) will be exported to `$GRAPH_NET_BENCHMARK_PATH`.
9898

99+
### Hardware Regression Testing
100+
We also provide a two-step workflow that validates compiler correctness and performance against a "golden" reference, which is crucial for hardware-specific testing and regression tracking. Details can be found in this [guide](./docs/hardware_test.md).
101+
99102
### 🧱 Construction & Contribution Guide
100103
Want to understand how GraphNet is built or contribute new samples?
101104
Check out the [Construction Guide](./docs/README_contribute.md) for details on the extraction and validation workflow.

docs/hardware_test.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Hardware Regression Testing
2+
### Step 1: Generate Reference Data
3+
First, use `graph_net.paddle.test_reference_device` on a trusted setting (e.g., a specific hardware/compiler version) to generate baseline logs and output files.
4+
```bash
5+
python -m graph_net.paddle.test_reference_device \
6+
--model-path /path/to/all_models/ \
7+
--reference-dir ./gold_reference \
8+
--compiler cinn \
9+
--device cuda
10+
# --reference-dir: (Required) Directory where the output .log (performance/config) and .pdout (output tensors) files will be saved.
11+
# --compiler: Specifies the compiler backend.
12+
```
13+
### Step 2: Run Regression Test
14+
After changing hardware, run the correctness test script. This script reads the reference data, re-runs the models using the exact same configuration, and compares the new results against the "golden" reference.
15+
```bash
16+
python -m graph_net.paddle.test_device_correctness \
17+
--reference-dir ./golden_reference \
18+
--device cuda
19+
```
20+
This script will report any failures (e.g., compilation errors, output mismatches) and print a performance comparison (speedup/slowdown) against the reference log, allowing you to quickly identify regressions.

0 commit comments

Comments
 (0)