Repository navigation
Fix path in find_library_location for libs in pytorch/build/lib - #194884
dominikjastrzebskix wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/194884
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit d3e2399 with merge base a402343 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "topic: not user facing" |
|
|
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
0cf2242 to
d3e2399
Compare
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 3 jobs have failed, first few of them are: xpu / linux-noble-xpu-n-py3.10 / test (default, 5, 12, linux.idc.xpu), xpu / linux-noble-xpu-n-py3.10 / test (default, 6, 12, linux.idc.xpu), xpu / linux-noble-xpu-n-py3.10 / test (default, 8, 12, linux.idc.xpu) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
Hello @dominikjastrzebskix, After this PR was merged, there are 503 failures with this new message: So it looks like the problem hasn't been fixed, only the error message changed and even more tests are now failing with this message. Could you please check that? My short investigation showed that the whole CC: @guangyey |
On a wheel install `libtorchbind_test.so` is absent, and `WeakKeyDictionaryScriptObjectTestCase` errors instead of skipping. Two causes: 1. `load_torchbind_test_lib()` never raises `SkipTest` anymore. pytorch#193122 added an `.exists()` check for that, but pytorch#194884 later made `find_library_location` raise `FileNotFoundError` when the library is missing, so the check became unreachable. Fix: convert the `FileNotFoundError` to `SkipTest` in the loader. This also fixes the other callers of the loader. 2. The test class called the loader from `__init__`, and unittest ignores `SkipTest` raised there. Fix: load in `setUp`. Under `PYTORCH_TEST_WITH_DYNAMO`, `setUp` is compiled and tracing the `_TorchScriptTesting._Foo` construction fails on the unregistered fake class, so the fixtures are built in a `torch._dynamo.disable`'d helper. Test Plan: On `2.15.0.dev20260915+xpu` (no torchbind library), with main's `find_library_location` injected and this PR's `torchbind_impls.py` and `test_weak.py`: ``` python test/test_weak.py -k ScriptObject # OK (skipped=14) PYTORCH_TEST_WITH_DYNAMO=1 python test/test_weak.py -k ScriptObject # OK (skipped=14) ``` Without the fix: 14 errors (`FileNotFoundError`). The library-present path is covered by CI. Fixes intel/torch-xpu-ops#5127 Authored with an AI assistant.
On a wheel install `libtorchbind_test.so` is absent, and `WeakKeyDictionaryScriptObjectTestCase` errors instead of skipping. Two causes: 1. `load_torchbind_test_lib()` never raises `SkipTest` anymore. pytorch#193122 added an `.exists()` check for that, but pytorch#194884 later made `find_library_location` raise `FileNotFoundError` when the library is missing, so the check became unreachable. Fix: convert the `FileNotFoundError` to `SkipTest` in the loader. This also fixes the other callers of the loader. 2. The test class called the loader from `__init__`, and unittest ignores `SkipTest` raised there. Fix: load in `setUp`. Under `PYTORCH_TEST_WITH_DYNAMO`, `setUp` is compiled and tracing the `_TorchScriptTesting._Foo` construction fails on the unregistered fake class, so the fixtures are built in a `torch._dynamo.disable`'d helper. Test Plan: On `2.15.0.dev20260915+xpu` (no torchbind library), with main's `find_library_location` injected and this PR's `torchbind_impls.py` and `test_weak.py`: ``` python test/test_weak.py -k ScriptObject # OK (skipped=14) PYTORCH_TEST_WITH_DYNAMO=1 python test/test_weak.py -k ScriptObject # OK (skipped=14) ``` Without the fix: 14 errors (`FileNotFoundError`). The library-present path is covered by CI. Fixes intel/torch-xpu-ops#5127 Authored with an AI assistant.
On a wheel install `libtorchbind_test.so` is absent, and `WeakKeyDictionaryScriptObjectTestCase` errors instead of skipping. Two causes: 1. `load_torchbind_test_lib()` never raises `SkipTest` anymore. pytorch#193122 added an `.exists()` check for that, but pytorch#194884 later made `find_library_location` raise `FileNotFoundError` when the library is missing, so the check became unreachable. Fix: convert the `FileNotFoundError` to `SkipTest` in the loader. This also fixes the other callers of the loader. 2. The test class called the loader from `__init__`, and unittest ignores `SkipTest` raised there. Fix: load in `setUp`. Under `PYTORCH_TEST_WITH_DYNAMO`, `setUp` is compiled and tracing the `_TorchScriptTesting._Foo` construction fails on the unregistered fake class, so the fixtures are built in a `torch._dynamo.disable`'d helper. Test Plan: On `2.15.0.dev20260915+xpu` (no torchbind library), with main's `find_library_location` injected and this PR's `torchbind_impls.py` and `test_weak.py`: ``` python test/test_weak.py -k ScriptObject # OK (skipped=14) PYTORCH_TEST_WITH_DYNAMO=1 python test/test_weak.py -k ScriptObject # OK (skipped=14) ``` Without the fix: 14 errors (`FileNotFoundError`). The library-present path is covered by CI. Fixes intel/torch-xpu-ops#5127 Authored with an AI assistant.
On a wheel install `libtorchbind_test.so` is absent, and `WeakKeyDictionaryScriptObjectTestCase` errors instead of skipping. Two causes: 1. `load_torchbind_test_lib()` never raises `SkipTest` anymore. pytorch#193122 added an `.exists()` check for that, but pytorch#194884 later made `find_library_location` raise `FileNotFoundError` when the library is missing, so the check became unreachable. Fix: convert the `FileNotFoundError` to `SkipTest` in the loader. This also fixes the other callers of the loader. 2. The test class called the loader from `__init__`, and unittest ignores `SkipTest` raised there. Fix: load in `setUpClass`, which skips the whole class and loads the library once. Under `PYTORCH_TEST_WITH_DYNAMO`, `setUp` is compiled and tracing the `_TorchScriptTesting._Foo` construction fails on the unregistered fake class, so the fixtures are built in a `torch._dynamo.disable`'d helper. Test Plan: On `2.15.0.dev20260915+xpu` (no torchbind library), with main's `find_library_location` injected and this PR's `torchbind_impls.py` and `test_weak.py`: ``` python test/test_weak.py -k ScriptObject # OK (skipped=1) PYTORCH_TEST_WITH_DYNAMO=1 python test/test_weak.py -k ScriptObject # OK (skipped=1) ``` Without the fix: 14 errors (`FileNotFoundError`). The library-present path is covered by CI. Fixes intel/torch-xpu-ops#5127 Authored with an AI assistant.
On a wheel install `libtorchbind_test.so` is absent, and `WeakKeyDictionaryScriptObjectTestCase` errors instead of skipping. Two causes: 1. `load_torchbind_test_lib()` never raises `SkipTest` anymore. pytorch#193122 added an `.exists()` check for that, but pytorch#194884 later made `find_library_location` raise `FileNotFoundError` when the library is missing, so the check became unreachable. Fix: convert the `FileNotFoundError` to `SkipTest` in the loader. This also fixes the other callers of the loader. 2. The test class called the loader from `__init__`, and unittest ignores `SkipTest` raised there. Fix: load in `setUpClass`, which skips the whole class and loads the library once. Under `PYTORCH_TEST_WITH_DYNAMO`, `setUp` is compiled and tracing the `_TorchScriptTesting._Foo` construction fails on the unregistered fake class, so the fixtures are built in a `torch._dynamo.disable`'d helper. Test Plan: On `2.15.0.dev20260915+xpu` (no torchbind library), with main's `find_library_location` injected and this PR's `torchbind_impls.py` and `test_weak.py`: ``` python test/test_weak.py -k ScriptObject # OK (skipped=1) PYTORCH_TEST_WITH_DYNAMO=1 python test/test_weak.py -k ScriptObject # OK (skipped=1) ``` Without the fix: 14 errors (`FileNotFoundError`). The library-present path is covered by CI. Fixes intel/torch-xpu-ops#5127 Authored with an AI assistant.
On a wheel install `libtorchbind_test.so` is absent, and `WeakKeyDictionaryScriptObjectTestCase` errors instead of skipping. Two causes: 1. `load_torchbind_test_lib()` never raises `SkipTest` anymore. pytorch#193122 added an `.exists()` check for that, but pytorch#194884 later made `find_library_location` raise `FileNotFoundError` when the library is missing, so the check became unreachable. Fix: convert the `FileNotFoundError` to `SkipTest` in the loader. This also fixes the other callers of the loader. 2. The test class called the loader from `__init__`, and unittest ignores `SkipTest` raised there. Fix: load in `setUpClass`, which skips the whole class and loads the library once. Under `PYTORCH_TEST_WITH_DYNAMO`, `setUp` is compiled and tracing the `_TorchScriptTesting._Foo` construction fails on the unregistered fake class, so the fixtures are built in a `torch._dynamo.disable`'d helper. Test Plan: On `2.15.0.dev20260915+xpu` (no torchbind library), with main's `find_library_location` injected and this PR's `torchbind_impls.py` and `test_weak.py`: ``` python test/test_weak.py -k ScriptObject # OK (skipped=1) PYTORCH_TEST_WITH_DYNAMO=1 python test/test_weak.py -k ScriptObject # OK (skipped=1) ``` Without the fix: 14 errors (`FileNotFoundError`). The library-present path is covered by CI. Fixes intel/torch-xpu-ops#5127 Authored with an AI assistant.
On a wheel install `libtorchbind_test.so` is absent, and `WeakKeyDictionaryScriptObjectTestCase` errors instead of skipping. Two causes: 1. `load_torchbind_test_lib()` never raises `SkipTest` anymore. pytorch#193122 added an `.exists()` check for that, but pytorch#194884 later made `find_library_location` raise `FileNotFoundError` when the library is missing, so the check became unreachable. Fix: convert the `FileNotFoundError` to `SkipTest` in the loader. This also fixes the other callers of the loader. 2. The test class called the loader from `__init__`, and unittest ignores `SkipTest` raised there. Fix: load in `setUpClass`, which skips the whole class and loads the library once. Under `PYTORCH_TEST_WITH_DYNAMO`, `setUp` is compiled and tracing the `_TorchScriptTesting._Foo` construction fails on the unregistered fake class, so the fixtures are built in a `torch._dynamo.disable`'d helper. Test Plan: On `2.15.0.dev20260915+xpu` (no torchbind library), with main's `find_library_location` injected and this PR's `torchbind_impls.py` and `test_weak.py`: ``` python test/test_weak.py -k ScriptObject # OK (skipped=1) PYTORCH_TEST_WITH_DYNAMO=1 python test/test_weak.py -k ScriptObject # OK (skipped=1) ``` Without the fix: 14 errors (`FileNotFoundError`). The library-present path is covered by CI. Fixes intel/torch-xpu-ops#5127 Authored with an AI assistant.
On a wheel install `libtorchbind_test.so` is absent, and `WeakKeyDictionaryScriptObjectTestCase` errors instead of skipping. Two causes: 1. `load_torchbind_test_lib()` never raises `SkipTest` anymore. pytorch#193122 added an `.exists()` check for that, but pytorch#194884 later made `find_library_location` raise `FileNotFoundError` when the library is missing, so the check became unreachable. Fix: convert the `FileNotFoundError` to `SkipTest` in the loader. This also fixes the other callers of the loader. 2. The test class called the loader from `__init__`, and unittest ignores `SkipTest` raised there. Fix: load in `setUpClass`, which skips the whole class and loads the library once. Under `PYTORCH_TEST_WITH_DYNAMO`, `setUp` is compiled and tracing the `_TorchScriptTesting._Foo` construction fails on the unregistered fake class, so the fixtures are built in a `torch._dynamo.disable`'d helper. Test Plan: On `2.15.0.dev20260915+xpu` (no torchbind library), with main's `find_library_location` injected and this PR's `torchbind_impls.py` and `test_weak.py`: ``` python test/test_weak.py -k ScriptObject # OK (skipped=1) PYTORCH_TEST_WITH_DYNAMO=1 python test/test_weak.py -k ScriptObject # OK (skipped=1) ``` Without the fix: 14 errors (`FileNotFoundError`). The library-present path is covered by CI. Fixes intel/torch-xpu-ops#5127 Authored with an AI assistant.
Fixes issues found in intel/torch-xpu-ops#4436
Currently,
find_library_location()forlibtorchbind_test.soresolves to:pytorch/torch/build/lib/libtorchbind_test.so
but the actual built library is here:
pytorch/build/lib/libtorchbind_test.so
Issue initially caused by: #129409, but it only exposed old issue introduced to
find_library_location()here: #61960