Set environment variable FLAGS_logging_pir_py_code_dir
to an existed logging directory before running a paddle program. Once the paddle program finished, under the logging directory, there are two generated pir python files: exec_programs.py
and programs_example_input_tensor_meta.py
.
Dumped example python files see tests/example_exec_programs.py
and tests/example_programs_example_input_tensor_meta.py
.
Op example input tensor meta file are generated from pir programs file and program example input tensor meta file.
python3.9 -m athena.op_example_input_tensor_meta --ir_programs=./example_exec_programs.py --example_inputs=./example_programs_example_input_tensor_meta.py --tmp_dir=/tmp --output=/tmp/op_example_input_tensor_meta.py
Details see tests/test_op_example_input_tensor_meta.sh
.
Module op unittests are generated from pir programs file and program example input tensor meta file.
python3 -m athena.module_op_unittests --ir_programs=./example_exec_programs.py --example_inputs=./example_programs_example_input_tensor_meta.py --output_dir=/tmp
Details see `tests/test_module_op_unittests.sh
examples see tests/test-generate-module-op-unittests.sh
.
Sequence statement unittests are generated from pir programs file and op example input tensor meta file.
python3.9 -m athena.sequence_unittests --ir_programs=./example_exec_programs.py --op_example_input_tensor_meta=./example_op_example_input_tensor_meta.py --output_dir=/tmp
Details see tests/test_sequence_unittests.sh
.
Typical sequence statement unittests are generated from pir programs file and op example input tensor meta file.
python3.9 -m athena.typical_sequence_unittests --length_slice="16:33" --ir_programs=./example_exec_programs.py --op_example_input_tensor_meta=./example_op_example_input_tensor_meta.py --output_dir=/tmp
Details see tests/test_typical_sequence_unittests.sh
.
Primitive op unittests are generated from pir programs file and op example input tensor meta file.
python3.9 -m athena.primitive_op_unittests --ir_programs=./example_exec_programs.py --op_example_input_tensor_meta=./example_op_example_input_tensor_meta.py --output_dir=/tmp
Details see tests/test_primitive_op_unittests.sh
.