Repository: pytorch
Issue: DISABLED test_open_device_registration (__main__.ExtensionBackendTests)
Labels: triaged,module: flaky-tests,skipped,oncall: pt2,module: inductor

Platforms: linux, rocm, slow



This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_open_device_registration&suite=ExtensionBackendTests&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/30857493223).

Over the past 3 hours, it has been determined flaky in 8 workflow(s) with 16 failures and 8 successes.

**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_open_device_registration`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.



<details><summary>Sample error message</summary>

```
Traceback (most recent call last):
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 2147, in _run_ninja_build
    subprocess.run(
  File "/opt/conda/envs/py_3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '6']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1764, in _jit_compile
    _write_ninja_file_and_build_library(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1876, in _write_ninja_file_and_build_library
    _run_ninja_build(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 2163, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error building extension 'extension_device'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/test/inductor/test_extension_backend.py", line 75, in setUpClass
    cls.module = torch.utils.cpp_extension.load(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1357, in load
    return _jit_compile(
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 1779, in _jit_compile
    baton.release()
  File "/opt/conda/envs/py_3.9/lib/python3.9/site-packages/torch/utils/file_baton.py", line 50, in release
    os.remove(self.lock_file_path)
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/jenkins/.cache/torch_extensions/py39_cpu/extension_device/lock'
```

</details>


Test file path: `inductor/test_extension_backend.py`

cc @clee2000 @ezyang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire