File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -925,6 +925,18 @@ def copy_msvc_libomp_to_torch_lib(pytorch_dir: Path):
925925 shutil .copy2 (omp_path , target_lib )
926926
927927
928+ def copy_libuv_to_torch_lib (pytorch_dir : Path ):
929+ libuv_root = os .environ .get ("libuv_ROOT" , "" )
930+ if not libuv_root :
931+ return
932+ uv_dll = Path (libuv_root ) / "bin" / "uv.dll"
933+ if not uv_dll .exists ():
934+ raise RuntimeError (f"Did not find uv.dll at '{ uv_dll } '" )
935+ target_lib = pytorch_dir / "torch" / "lib"
936+ print (f"Copying libuv from '{ uv_dll } ' to '{ target_lib } '" )
937+ shutil .copy2 (uv_dll , target_lib )
938+
939+
928940def do_build_pytorch (
929941 args : argparse .Namespace ,
930942 pytorch_dir : Path ,
@@ -1054,6 +1066,7 @@ def do_build_pytorch(
10541066 # Windows-specific settings.
10551067 if is_windows :
10561068 copy_msvc_libomp_to_torch_lib (pytorch_dir )
1069+ copy_libuv_to_torch_lib (pytorch_dir )
10571070
10581071 use_flash_attention = (
10591072 "1"
You can’t perform that action at this time.
0 commit comments