Skip to content

benchmarks.SaturnNPU.scripts.export_golden_data

Source: benchmarks/SaturnNPU/scripts/export_golden_data.py

benchmarks.SaturnNPU.scripts.export_golden_data

Export golden test data in multiple formats for kernel writers.

Reads the .pt golden data produced by generate_npu_golden_tests.py and exports: 1. NumPy .npy files (for non-PyTorch consumers) 2. Raw binary files with shape metadata (for RTL/C testing) 3. A summary report per kernel with shapes, dtypes, and golden values

Usage

python tools/export_golden_data.py benchmarks/SaturnNPU/golden_data/ --formats numpy raw

export_scale_dir(pt_dir, np_dir, raw_dir, do_numpy, do_raw)

Export one scale directory (small or real) of golden data.

generate_kernel_summary(golden_dir, output_path)

Generate a comprehensive summary for kernel writers.

pt_to_numpy(tensor)

Convert a PyTorch tensor to numpy, handling bf16.