@@ -122,12 +122,10 @@ def update_wheel(wheel_path) -> None:
122122 "/usr/local/cuda/lib64/libcudnn_cnn_train.so.8" ,
123123 "/usr/local/cuda/lib64/libcudnn_ops_infer.so.8" ,
124124 "/usr/local/cuda/lib64/libcudnn_ops_train.so.8" ,
125- "/opt/conda/envs/aarch64_env/lib/libopenblas.so.0" ,
126- "/opt/conda/envs/aarch64_env/lib/libgfortran.so.5" ,
127125 "/opt/conda/envs/aarch64_env/lib/libgomp.so.1" ,
126+ "/opt/OpenBLAS/lib/libopenblas.so.0" ,
128127 "/acl/build/libarm_compute.so" ,
129128 "/acl/build/libarm_compute_graph.so" ,
130- "/acl/build/libarm_compute_core.so" ,
131129 ]
132130 # Copy libraries to unzipped_folder/a/lib
133131 for lib_path in libs_to_copy :
@@ -140,10 +138,10 @@ def update_wheel(wheel_path) -> None:
140138 os .system (f"cd { folder } /tmp/; zip -r { folder } /cuda_wheel/{ wheelname } *" )
141139 shutil .move (
142140 f"{ folder } /cuda_wheel/{ wheelname } " ,
143- f"/dist /{ wheelname } " ,
141+ f"{ folder } /{ wheelname } " ,
144142 copy_function = shutil .copy2 ,
145143 )
146- os .system (f"rm -rf { folder } /tmp { folder } /dist /cuda_wheel/" )
144+ os .system (f"rm -rf { folder } /tmp/ { folder } /cuda_wheel/" )
147145
148146
149147def complete_wheel (folder : str ) -> str :
@@ -201,8 +199,9 @@ def parse_arguments():
201199 branch = "master"
202200
203201 print ("Building PyTorch wheel" )
204- build_vars = "CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000 "
205- os .system ("python setup.py clean" )
202+ os .system ("export USE_PRIORITIZED_TEXT_FOR_LD=1" ) #enable linker script optimization https://github.com/pytorch/pytorch/pull/121975/files
203+ build_vars = "MAX_JOBS=5 CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000 "
204+ os .system ("cd /pytorch; python setup.py clean" )
206205
207206 override_package_version = os .getenv ("OVERRIDE_PACKAGE_VERSION" )
208207 if override_package_version is not None :
0 commit comments