Skip to content

Add CREATE_REPRODUCTION_REPORT instructions to readme | test(torchlib) #1001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion onnxscript/tests/function_libs/torch_lib/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Test op correctness by comparing with PyTorch results.
# Test op correctness by comparing with PyTorch results

## Usage

Expand All @@ -13,6 +13,16 @@ pytest onnxscript/tests/function_libs/torch_lib/ops_test.py -k ceil
pytest onnxscript/tests/function_libs/torch_lib/ops_test.py -k nn_functional_scaled_dot_product_attention
```

### Environment variables

1. Set environment variable `CATCH_ORT_SEGFAULT=1` to catch segmentation faults
in onnxruntime by running the inference sessions in a separate process.
2. Set `CREATE_REPRODUCTION_REPORT=1` to create markdown files for reproduction of errors. E.g.

```bash
CREATE_REPRODUCTION_REPORT=1 python -m pytest onnxscript/tests/function_libs/torch_lib/ops_test.py -k div_mode_int
```

## How to add a new operator test

See _usage_ in [ops_test_data.py](./ops_test_data.py)