mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "filelock: Make waitcounter variant to use (#139816)"
This reverts commit 237c4b559c0f928dd89cf1e773458a1bdcea0b9d. Reverted https://github.com/pytorch/pytorch/pull/139816 on behalf of https://github.com/clee2000 due to Sorry, I need to revert this in order to revert something else. The only thing you need to do is rebase and remerge ([comment](https://github.com/pytorch/pytorch/pull/139816#issuecomment-2536616808))
This commit is contained in:
@ -1567,7 +1567,7 @@ class AotCodeCompiler:
|
||||
pos += rc
|
||||
return consts_o
|
||||
|
||||
from torch.utils._filelock import FileLock
|
||||
from filelock import FileLock
|
||||
|
||||
lock_dir = get_lock_dir()
|
||||
lock = FileLock(os.path.join(lock_dir, key + ".lock"), timeout=LOCK_TIMEOUT)
|
||||
@ -2002,7 +2002,7 @@ class CppCodeCache:
|
||||
key, input_path = write(source_code, "cpp", extra=vec_isa_cmd)
|
||||
|
||||
if key not in cls.cache:
|
||||
from torch.utils._filelock import FileLock
|
||||
from filelock import FileLock
|
||||
|
||||
lock_path = os.path.join(get_lock_dir(), key + ".lock")
|
||||
output_name, output_dir = get_name_and_dir_from_output_file_path(input_path)
|
||||
@ -2067,7 +2067,7 @@ def _worker_compile_cpp(
|
||||
fb_input_path: str,
|
||||
fb_output_path: str,
|
||||
) -> None:
|
||||
from torch.utils._filelock import FileLock
|
||||
from filelock import FileLock
|
||||
|
||||
with FileLock(lock_path, timeout=LOCK_TIMEOUT):
|
||||
binary_path = (
|
||||
@ -2645,11 +2645,10 @@ class HalideCodeCache(CppPythonBindingsCodeCache):
|
||||
afile = str(dirpath / "standalone_halide_runtime.a")
|
||||
sofile = str(dirpath / libname)
|
||||
if not os.path.exists(donefile):
|
||||
import filelock
|
||||
import halide as hl # type: ignore[import-untyped,import-not-found]
|
||||
|
||||
from torch.utils._filelock import FileLock
|
||||
|
||||
with FileLock(lockfile, LOCK_TIMEOUT):
|
||||
with filelock.FileLock(lockfile, LOCK_TIMEOUT):
|
||||
if not os.path.exists(donefile):
|
||||
with open(hookfile, "w") as f:
|
||||
if device_type == "cuda":
|
||||
@ -2680,7 +2679,7 @@ class HalideCodeCache(CppPythonBindingsCodeCache):
|
||||
|
||||
|
||||
def _worker_task_halide(lockfile: str, jobs: List[partial[Any]]) -> None:
|
||||
from torch.utils._filelock import FileLock
|
||||
from filelock import FileLock
|
||||
|
||||
try:
|
||||
with FileLock(lockfile, LOCK_TIMEOUT):
|
||||
@ -3075,7 +3074,7 @@ class CUDACodeCache:
|
||||
"""
|
||||
key, input_path = cls.write(source_code, dst_file_ext)
|
||||
if key not in cls.cache:
|
||||
from torch.utils._filelock import FileLock
|
||||
from filelock import FileLock
|
||||
|
||||
lock_dir = get_lock_dir()
|
||||
lock = FileLock(os.path.join(lock_dir, key + ".lock"), timeout=LOCK_TIMEOUT)
|
||||
@ -3166,7 +3165,7 @@ class ROCmCodeCache:
|
||||
|
||||
key, input_path = cls.write(source_code, dst_file_ext)
|
||||
if key not in cls.cache:
|
||||
from torch.utils._filelock import FileLock
|
||||
from filelock import FileLock
|
||||
|
||||
lock_dir = get_lock_dir()
|
||||
lock = FileLock(os.path.join(lock_dir, key + ".lock"), timeout=LOCK_TIMEOUT)
|
||||
|
||||
Reference in New Issue
Block a user