From: Bert Maher Date: Wed, 25 Aug 2021 01:52:29 +0000 (-0700) Subject: Don't switch executors mid test (#63830) X-Git-Tag: accepted/tizen/8.0/unified/20231005.095509~752 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1787b905c4a571ff1ae09ddc56ce56cb04e52136;p=platform%2Fupstream%2Fpytorch.git Don't switch executors mid test (#63830) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63830 It's really not safe to change the executor out from under models that may have already been partially compiled. ghstack-source-id: 136526228 Test Plan: ``` DEBUG=1 CFLAGS="-fsanitize=address" CXXFLAGS="-fsanitize=address" USE_LLVM=$(realpath ../llvm-project/install) CMAKE_PREFIX_PATH=$CONDA_PREFIX python setup.py install LD_PRELOAD=/lib64/libasan.so.5 numactl -C3 pytest -v --cov --cov-report xml:test/coverage.xml --cov-append onnx/test_pytorch_onnx_onnxruntime.py::TestONNXRuntime_opset11 -s ``` Reviewed By: desertfire Differential Revision: D30504489 fbshipit-source-id: 188581cb53f0cf5bd3442d1e9d46e8c0c7e124f8 --- diff --git a/test/onnx/test_pytorch_onnx_onnxruntime.py b/test/onnx/test_pytorch_onnx_onnxruntime.py index 9d56c11..ffeef00 100644 --- a/test/onnx/test_pytorch_onnx_onnxruntime.py +++ b/test/onnx/test_pytorch_onnx_onnxruntime.py @@ -531,10 +531,6 @@ class TestONNXRuntime(unittest.TestCase): dynamic_axes={"images_tensors": [0, 1, 2], "outputs": [0, 1, 2]}, rtol=1e-3, atol=1e-5) def test_paste_mask_in_image(self): - # disable profiling - torch._C._jit_set_profiling_executor(False) - torch._C._jit_set_profiling_mode(False) - masks = torch.rand(10, 1, 26, 26) boxes = torch.rand(10, 4) boxes[:, 2:] += torch.rand(10, 2) @@ -582,10 +578,6 @@ class TestONNXRuntime(unittest.TestCase): "scores": [0], "masks": [0, 1, 2]}, rtol=1e-3, atol=1e-5) def test_heatmaps_to_keypoints(self): - # disable profiling - torch._C._jit_set_profiling_executor(False) - torch._C._jit_set_profiling_mode(False) - maps = torch.rand(10, 1, 26, 26) rois = torch.rand(10, 4) from torchvision.models.detection.roi_heads import heatmaps_to_keypoints