@@ -69,6 +69,7 @@ def replace_tag(filename) -> None:
6969 f .writelines (lines )
7070
7171
72+ < << << << HEAD
7273def patch_library_rpath (
7374 folder : str ,
7475 lib_name : str ,
@@ -131,11 +132,14 @@ def copy_and_patch_library(
131132 patch_library_rpath (folder , lib_name , use_nvidia_pypi_libs , desired_cuda )
132133
133134
135+ == == == =
136+ >> >> >> > 245 bf6edbc ([AUTOGENERATED ] [release / 2.8 ] skip convolution tests on Navi4x (#2675))
134137def package_cuda_wheel (wheel_path , desired_cuda ) - > None :
135138 """
136139 Package the cuda wheel libraries
137140 """
138141 folder = os .path .dirname (wheel_path )
142+ << < << << HEAD
139143 os .mkdir (f"{ folder } /tmp" )
140144 os .system (f"unzip { wheel_path } -d { folder } /tmp" )
141145 # Delete original wheel since it will be repackaged
@@ -249,15 +253,77 @@ def package_cuda_wheel(wheel_path, desired_cuda) -> None:
249253 # Copy libraries to unzipped_folder/torch/lib
250254 for lib_path in libs_to_copy :
251255 copy_and_patch_library (lib_path , folder , use_nvidia_pypi_libs , desired_cuda )
256+ == == == =
257+ wheelname = os .path .basename (wheel_path )
258+ os .mkdir (f"{ folder } /tmp" )
259+ os .system (f"unzip { wheel_path } -d { folder } /tmp" )
260+ libs_to_copy = [
261+ "/usr/local/cuda/extras/CUPTI/lib64/libcupti.so.12" ,
262+ "/usr/local/cuda/lib64/libcudnn.so.9" ,
263+ "/usr/local/cuda/lib64/libcublas.so.12" ,
264+ "/usr/local/cuda/lib64/libcublasLt.so.12" ,
265+ "/usr/local/cuda/lib64/libcudart.so.12" ,
266+ "/usr/local/cuda/lib64/libcufft.so.11" ,
267+ "/usr/local/cuda/lib64/libcusparse.so.12" ,
268+ "/usr/local/cuda/lib64/libcusparseLt.so.0" ,
269+ "/usr/local/cuda/lib64/libcusolver.so.11" ,
270+ "/usr/local/cuda/lib64/libcurand.so.10" ,
271+ "/usr/local/cuda/lib64/libnccl.so.2" ,
272+ "/usr/local/cuda/lib64/libnvJitLink.so.12" ,
273+ "/usr/local/cuda/lib64/libnvrtc.so.12" ,
274+ "/usr/local/cuda/lib64/libcudnn_adv.so.9" ,
275+ "/usr/local/cuda/lib64/libcudnn_cnn.so.9" ,
276+ "/usr/local/cuda/lib64/libcudnn_graph.so.9" ,
277+ "/usr/local/cuda/lib64/libcudnn_ops.so.9" ,
278+ "/usr/local/cuda/lib64/libcudnn_engines_runtime_compiled.so.9" ,
279+ "/usr/local/cuda/lib64/libcudnn_engines_precompiled.so.9" ,
280+ "/usr/local/cuda/lib64/libcudnn_heuristic.so.9" ,
281+ "/lib64/libgomp.so.1" ,
282+ "/usr/lib64/libgfortran.so.5" ,
283+ "/acl/build/libarm_compute.so" ,
284+ "/acl/build/libarm_compute_graph.so" ,
285+ "/usr/local/lib/libnvpl_lapack_lp64_gomp.so.0" ,
286+ "/usr/local/lib/libnvpl_blas_lp64_gomp.so.0" ,
287+ "/usr/local/lib/libnvpl_lapack_core.so.0" ,
288+ "/usr/local/lib/libnvpl_blas_core.so.0" ,
289+ ]
290+
291+ if "129" in desired_cuda :
292+ libs_to_copy + = [
293+ "/usr/local/cuda/lib64/libnvrtc-builtins.so.12.9" ,
294+ "/usr/local/cuda/lib64/libcufile.so.0" ,
295+ "/usr/local/cuda/lib64/libcufile_rdma.so.1" ,
296+ ]
297+
298+ # Copy libraries to unzipped_folder/a/lib
299+ for lib_path in libs_to_copy :
300+ lib_name = os .path .basename (lib_path )
301+ shutil .copy2 (lib_path , f"{ folder } /tmp/torch/lib/{ lib_name } " )
302+ os .system (
303+ f"cd { folder } /tmp/torch/lib/; "
304+ f"patchelf --set-rpath '$ORIGIN' --force-rpath { folder } /tmp/torch/lib/{ lib_name } "
305+ )
306+ >> >> > >> 245 bf6edbc ([AUTOGENERATED ] [release / 2.8 ] skip convolution tests on Navi4x (#2675))
252307
253308 # Make sure the wheel is tagged with manylinux_2_28
254309 for f in os .scandir (f"{ folder } /tmp/" ):
255310 if f .is_dir () and f .name .endswith (".dist-info" ):
256311 replace_tag (f"{ f .path } /WHEEL" )
257312 break
258313
314+ << << < << HEAD
259315 os .system (f"wheel pack { folder } /tmp/ -d { folder } " )
260316 os .system (f"rm -rf { folder } /tmp/" )
317+ == == == =
318+ os .mkdir (f"{ folder } /cuda_wheel" )
319+ os .system (f"cd { folder } /tmp/; zip -r { folder } /cuda_wheel/{ wheelname } *" )
320+ shutil .move (
321+ f"{ folder } /cuda_wheel/{ wheelname } " ,
322+ f"{ folder } /{ wheelname } " ,
323+ copy_function = shutil .copy2 ,
324+ )
325+ os .system (f"rm -rf { folder } /tmp/ { folder } /cuda_wheel/" )
326+ >> >> > >> 245 bf6edbc ([AUTOGENERATED ] [release / 2.8 ] skip convolution tests on Navi4x (#2675))
261327
262328
263329def complete_wheel (folder : str ) - > str :
@@ -280,7 +346,18 @@ def complete_wheel(folder: str) -> str:
280346 f"/{ folder } /dist/{ repaired_wheel_name } " ,
281347 )
282348 else :
349+ << < << < < HEAD
283350 repaired_wheel_name = list_dir (f"/{ folder } /dist" )[0 ]
351+ == == == =
352+ repaired_wheel_name = wheel_name .replace (
353+ "linux_aarch64" , "manylinux_2_28_aarch64"
354+ )
355+ print (f"Renaming { wheel_name } wheel to { repaired_wheel_name } " )
356+ os .rename (
357+ f"/{ folder } /dist/{ wheel_name } " ,
358+ f"/{ folder } /dist/{ repaired_wheel_name } " ,
359+ )
360+ >> >> > >> 245 bf6edbc ([AUTOGENERATED ] [release / 2.8 ] skip convolution tests on Navi4x (#2675))
284361
285362 print (f"Copying { repaired_wheel_name } to artifacts" )
286363 shutil .copy2 (
@@ -320,6 +397,7 @@ def parse_arguments():
320397 build_vars = "CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000 "
321398 # MAX_JOB=5 is not required for CPU backend (see commit 465d98b)
322399 if enable_cuda :
400+ << << << < HEAD
323401 build_vars + = "MAX_JOBS=5 "
324402
325403 # Handle PyPI NVIDIA libraries vs bundled libraries
@@ -331,6 +409,9 @@ def parse_arguments():
331409 else :
332410 print ("Configuring build for bundled NVIDIA libraries" )
333411 # Keep existing static linking approach - already configured above
412+ == == == =
413+ build_vars = "MAX_JOBS=5 " + build_vars
414+ >> >> > >> 245 bf6edbc ([AUTOGENERATED ] [release / 2.8 ] skip convolution tests on Navi4x (#2675))
334415
335416 override_package_version = os .getenv ("OVERRIDE_PACKAGE_VERSION" )
336417 desired_cuda = os .getenv ("DESIRED_CUDA" )
0 commit comments