microsoft / nnfusion

A flexible and efficient deep neural network (DNN) compiler that generates high-performance executable from a DNN model description.
MIT License
948 stars 158 forks source link

Run ONNX Backend standard test for NNFusion #470

Closed wenxcs closed 1 year ago

wenxcs commented 1 year ago

Original ONNX Backend tests are here: https://github.com/onnx/onnx/tree/main/onnx/backend/test/data/node Files are organized as model.onnx and corresponding input & output tensors in pb.

In NNFusion, after building project in build/ folder, change into source code root directory, and to invoke standard ONNX test use command like this:

# wenxh @ srgam-02 in ~/nnfusion_onnxtest/nnfusion on git:wenxh/onnx_unittest x [16:01:59] 
$ python test/python/onnx_test.py --mode=name --name="abs,log"
@, abs , test_abs ,/home/wenxh/nnfusion_onnxtest/nnfusion/build/onnx/onnx/backend/test/data/node/test_abs/test_data_set_0 , PASS
@, log , test_log ,/home/wenxh/nnfusion_onnxtest/nnfusion/build/onnx/onnx/backend/test/data/node/test_log/test_data_set_0 , FAILED
@, log , test_log_example ,/home/wenxh/nnfusion_onnxtest/nnfusion/build/onnx/onnx/backend/test/data/node/test_log_example/test_data_set_0 , FAILED

log.txt