From f072ad68fd07439ef54dbaba02b62517c4042f1c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 6 Feb 2025 08:16:14 +1100 Subject: [PATCH] drop unsuccessful patch; now covered by skip see also ba2564b1a70011d975cb74c995cba5053fa083f3 --- recipe/meta.yaml | 1 - ...e-in-test_mutable_custom_op_fixed_la.patch | 57 ------------------- 2 files changed, 58 deletions(-) delete mode 100644 recipe/patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 7430453a..ff618c91 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -70,7 +70,6 @@ source: - patches/0017-Add-conda-prefix-to-inductor-include-paths.patch - patches/0018-make-ATEN_INCLUDE_DIR-relative-to-TORCH_INSTALL_PREF.patch - patches/0019-remove-DESTINATION-lib-from-CMake-install-TARGETS-di.patch # [win] - - patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch - patches/0021-avoid-deprecated-find_package-CUDA-in-caffe2-CMake-m.patch - patches_submodules/fbgemm/0001-remove-DESTINATION-lib-from-CMake-install-directives.patch # [win] - patches_submodules/tensorpipe/0001-switch-away-from-find_package-CUDA.patch diff --git a/recipe/patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch b/recipe/patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch deleted file mode 100644 index 17c54e33..00000000 --- a/recipe/patches/0020-make-library-name-in-test_mutable_custom_op_fixed_la.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 39041f5a78068d2cf58d99f76938aee95a3c7bb5 Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Thu, 30 Jan 2025 13:23:14 +1100 -Subject: [PATCH 20/21] make library name in - `test_mutable_custom_op_fixed_layout{,2}` unique - -Suggested-By: Daniel Petry ---- - test/inductor/test_torchinductor.py | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - -diff --git a/test/inductor/test_torchinductor.py b/test/inductor/test_torchinductor.py -index 610f5d27332..99e2169febb 100644 ---- a/test/inductor/test_torchinductor.py -+++ b/test/inductor/test_torchinductor.py -@@ -10628,7 +10628,8 @@ class CommonTemplate: - @requires_gpu() - @config.patch(implicit_fallbacks=True) - def test_mutable_custom_op_fixed_layout2(self): -- with torch.library._scoped_library("mylib", "DEF") as lib: -+ unique_lib_name = f"mylib_{id(self)}" # Make unique name using test instance id -+ with torch.library._scoped_library(unique_lib_name, "DEF") as lib: - mod = nn.Conv2d(3, 128, 1, stride=1, bias=False).to(device=GPU_TYPE) - inp = torch.rand(2, 3, 128, 128, device=GPU_TYPE) - expected_stride = mod(inp).clone().stride() -@@ -10664,8 +10665,9 @@ class CommonTemplate: - def fn(x): - # Inductor changes the conv to be channels-last - z = mod(x) -- output = torch.ops.mylib.bar(z, torch._dynamo.is_compiling()) -- torch.ops.mylib.add_one(output) -+ mylib = importlib.import_module(f"torch.ops.{unique_lib_name}") -+ output = mylib.bar(z, torch._dynamo.is_compiling()) -+ mylib.add_one(output) - return output**2 - - with torch.no_grad(): -@@ -10681,7 +10683,8 @@ class CommonTemplate: - - @config.patch(implicit_fallbacks=True) - def test_mutable_custom_op_fixed_layout(self): -- with torch.library._scoped_library("mylib", "DEF") as lib: -+ unique_lib_name = f"mylib_{id(self)}" # Make unique name using test instance id -+ with torch.library._scoped_library(unique_lib_name, "DEF") as lib: - lib.define( - "copy_(Tensor(a!) dst, Tensor src) -> ()", - tags=torch.Tag.needs_fixed_stride_order, -@@ -10697,7 +10700,8 @@ class CommonTemplate: - - def f(x): - full_default_3 = torch.full([3], 7.0, device="cpu") -- chunk_cat_default_1 = torch.ops.mylib.copy_.default(full_default_3, x) -+ mylib = importlib.import_module(f"torch.ops.{unique_lib_name}") -+ chunk_cat_default_1 = mylib.copy_.default(full_default_3, x) - mul_out = torch.mul(full_default_3, full_default_3) - return mul_out -