@@ -321,6 +321,40 @@ def build_torchvision(host: RemoteHost, *,
321
321
return vision_wheel_name
322
322
323
323
324
+ def build_torchdata (host : RemoteHost , * ,
325
+ branch : str = "master" ,
326
+ use_conda : bool = True ,
327
+ git_clone_flags : str = "" ) -> str :
328
+ print ('Checking out TorchData repo' )
329
+ git_clone_flags += " --recurse-submodules"
330
+ build_version = checkout_repo (host ,
331
+ branch = branch ,
332
+ url = "https://github.com/pytorch/data" ,
333
+ git_clone_flags = git_clone_flags ,
334
+ mapping = {
335
+ "v1.13.1" : ("0.5.1" , "" ),
336
+ })
337
+ print ('Building TorchData wheel' )
338
+ build_vars = ""
339
+ if branch == 'nightly' :
340
+ version = host .check_output (["if [ -f data/version.txt ]; then cat data/version.txt; fi" ]).strip ()
341
+ build_date = host .check_output ("cd pytorch ; git log --pretty=format:%s -1" ).strip ().split ()[0 ].replace ("-" , "" )
342
+ build_vars += f"BUILD_VERSION={ version } .dev{ build_date } "
343
+ elif build_version is not None :
344
+ build_vars += f"BUILD_VERSION={ build_version } "
345
+ if host .using_docker ():
346
+ build_vars += " CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000"
347
+
348
+ host .run_cmd (f"cd data; { build_vars } python3 setup.py bdist_wheel" )
349
+ wheel_name = host .list_dir ("data/dist" )[0 ]
350
+ embed_libgomp (host , use_conda , os .path .join ('data' , 'dist' , wheel_name ))
351
+
352
+ print ('Copying TorchData wheel' )
353
+ host .download_wheel (os .path .join ('data' , 'dist' , wheel_name ))
354
+
355
+ return wheel_name
356
+
357
+
324
358
def build_torchtext (host : RemoteHost , * ,
325
359
branch : str = "master" ,
326
360
use_conda : bool = True ,
@@ -512,6 +546,7 @@ def start_build(host: RemoteHost, *,
512
546
vision_wheel_name = build_torchvision (host , branch = branch , use_conda = use_conda , git_clone_flags = git_clone_flags )
513
547
build_torchaudio (host , branch = branch , use_conda = use_conda , git_clone_flags = git_clone_flags )
514
548
build_torchtext (host , branch = branch , use_conda = use_conda , git_clone_flags = git_clone_flags )
549
+ build_torchdata (host , branch = branch , use_conda = use_conda , git_clone_flags = git_clone_flags )
515
550
516
551
return pytorch_wheel_name , vision_wheel_name
517
552
0 commit comments