mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE] simplify test_cpp_extensions_aot and .gitignore (#149231)
It is shady to clean up an install mid-test. So don't do that anymore and use .gitignore instead. Pull Request resolved: https://github.com/pytorch/pytorch/pull/149231 Approved by: https://github.com/albanD, https://github.com/msaroufim
This commit is contained in:
committed by
PyTorch MergeBot
parent
b99fc9d29f
commit
88a26dbb9d
4
.gitignore
vendored
4
.gitignore
vendored
@ -62,9 +62,7 @@ test/forward_backward_compatibility/nightly_schemas.txt
|
||||
dropout_model.pt
|
||||
test/generated_type_hints_smoketest.py
|
||||
test/htmlcov
|
||||
test/cpp_extensions/install/
|
||||
test/cpp_extensions/open_registration_extension/install
|
||||
test/cpp_extensions/libtorch_agnostic_extension/install
|
||||
test/cpp_extensions/**/install
|
||||
test/kernel.errors.txt
|
||||
third_party/build/
|
||||
third_party/nccl/
|
||||
|
@ -3,7 +3,6 @@
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
from itertools import repeat
|
||||
from pathlib import Path
|
||||
@ -16,7 +15,6 @@ import torch.utils.cpp_extension
|
||||
from torch.testing._internal.common_cuda import TEST_CUDA
|
||||
from torch.testing._internal.common_utils import (
|
||||
IS_WINDOWS,
|
||||
shell,
|
||||
skipIfTorchDynamo,
|
||||
TEST_XPU,
|
||||
xfailIfTorchDynamo,
|
||||
@ -217,16 +215,6 @@ class TestCppExtensionAOT(common.TestCase):
|
||||
missing_symbols = subprocess.check_output(["nm", "-u", so_file]).decode("utf-8")
|
||||
self.assertFalse("Py" in missing_symbols)
|
||||
|
||||
# finally, clean up the folder
|
||||
cmd = [sys.executable, "setup.py", "clean"]
|
||||
return_code = shell(
|
||||
cmd,
|
||||
cwd=os.path.join("cpp_extensions", "python_agnostic_extension"),
|
||||
env=os.environ.copy(),
|
||||
)
|
||||
if return_code != 0:
|
||||
return return_code
|
||||
|
||||
@unittest.skipIf(not TEST_CUDA, "some aspects of this test require CUDA")
|
||||
def test_libtorch_agnostic(self):
|
||||
import libtorch_agnostic
|
||||
|
Reference in New Issue
Block a user