From a3360ff9c85e7d0bae8bb4ca6dbbca69cfadea37 Mon Sep 17 00:00:00 2001 From: Pzzzzz <31173671+Pzzzzz5142@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:26:41 +0800 Subject: [PATCH] Fix potential multi-process compile issue (#610) When running with multi-process, multiple processes may enter the if branch and the latter one cannot mkdir successfully. Adding such flag to it is enough to solve the issue. --- python/flashinfer/jit/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/flashinfer/jit/__init__.py b/python/flashinfer/jit/__init__.py index eacefbe5..b30f9a24 100644 --- a/python/flashinfer/jit/__init__.py +++ b/python/flashinfer/jit/__init__.py @@ -137,7 +137,7 @@ def load_cuda_ops( check_cuda_arch() build_directory = FLASHINFER_JIT_DIR / name if not os.path.exists(build_directory): - os.makedirs(build_directory) + os.makedirs(build_directory, exist_ok=True) if extra_include_paths is None: extra_include_paths = [ FLASHINFER_INCLUDE_DIR,