@@ -128,6 +128,8 @@ LLVM_BRANCHES = {
128128 LLVM_RELEASE_20 : VersionedBranch (ref = "llvmorg-20.1.8" , version = Version (20 , 1 , 8 )),
129129}
130130
131+ BITS = 64
132+
131133# WORKERS
132134
133135# The 'workers' list defines the set of recognized build workers. Each element
@@ -144,13 +146,13 @@ class HalideWorker(Worker):
144146
145147
146148c ["workers" ] = [
147- HalideWorker ("linux-worker-1" , max_builds = 4 , arch = "x86" , bits = [ 64 ] , os = "linux" ),
148- HalideWorker ("linux-worker-4" , max_builds = 4 , arch = "x86" , bits = [ 64 ] , os = "linux" ),
149- HalideWorker ("mac-arm-worker-1" , max_builds = 2 , arch = "arm" , bits = [ 64 ] , os = "osx" ),
150- HalideWorker ("mac-x86-worker-2" , max_builds = 2 , arch = "x86" , bits = [ 64 ] , os = "osx" ),
151- HalideWorker ("mac-x86-worker-3" , max_builds = 2 , arch = "x86" , bits = [ 64 ] , os = "osx" ),
152- HalideWorker ("win-worker-3" , max_builds = 1 , arch = "x86" , bits = [ 64 ] , os = "windows" ),
153- HalideWorker ("win-worker-4" , max_builds = 1 , arch = "x86" , bits = [ 64 ] , os = "windows" ),
149+ HalideWorker ("linux-worker-1" , max_builds = 4 , arch = "x86" , bits = BITS , os = "linux" ),
150+ HalideWorker ("linux-worker-4" , max_builds = 4 , arch = "x86" , bits = BITS , os = "linux" ),
151+ HalideWorker ("mac-arm-worker-1" , max_builds = 2 , arch = "arm" , bits = BITS , os = "osx" ),
152+ HalideWorker ("mac-x86-worker-2" , max_builds = 2 , arch = "x86" , bits = BITS , os = "osx" ),
153+ HalideWorker ("mac-x86-worker-3" , max_builds = 2 , arch = "x86" , bits = BITS , os = "osx" ),
154+ HalideWorker ("win-worker-3" , max_builds = 1 , arch = "x86" , bits = BITS , os = "windows" ),
155+ HalideWorker ("win-worker-4" , max_builds = 1 , arch = "x86" , bits = BITS , os = "windows" ),
154156]
155157
156158_SANITIZERS = [
@@ -193,7 +195,7 @@ class HalideBuilder(BuilderConfig):
193195
194196 def __init__ (self , arch , bits , os , llvm_branch , sanitizer = None ):
195197 assert arch in ["arm" , "x86" ]
196- assert bits in [ 32 , 64 ]
198+ assert bits == BITS
197199 assert os in ["linux" , "windows" , "osx" ]
198200 assert llvm_branch in LLVM_BRANCHES , f"{ llvm_branch } not recognized"
199201
@@ -215,23 +217,16 @@ class HalideBuilder(BuilderConfig):
215217 tags = self .builder_tags (),
216218 )
217219
218- # We don't support the Python bindings on 32-bit at all.
219220 def handles_python (self ):
220- if self .bits == 32 :
221- return False
222-
223- if self .sanitizer_preset () is not None :
224- return False
225-
226- return True
221+ return self .sanitizer_preset () is None
227222
228223 # Serialization-via-JIT testing could run anywhere, but we limit it
229224 # to x64-linux to avoid redundancy.
230225 def handles_serialization_jit_testing (self ):
231- return self .arch == "x86" and self .bits == 64 and self . os == "linux" and self .llvm_branch == LLVM_MAIN
226+ return self .arch == "x86" and self .os == "linux" and self .llvm_branch == LLVM_MAIN
232227
233228 def handles_sanitizers (self ):
234- return self .arch == "x86" and self .bits == 64 and self . os == "linux" and self .llvm_branch == LLVM_MAIN
229+ return self .arch == "x86" and self .os == "linux" and self .llvm_branch == LLVM_MAIN
235230
236231 def sanitizer_preset (self ):
237232 if self .handles_sanitizers ():
@@ -243,26 +238,21 @@ class HalideBuilder(BuilderConfig):
243238 return None
244239
245240 def handles_hexagon (self ):
246- return self .arch == "x86" and self .bits == 64 and self . os == "linux" and self .llvm_branch == LLVM_MAIN
241+ return self .arch == "x86" and self .os == "linux" and self .llvm_branch == LLVM_MAIN
247242
248243 def handles_wasm (self ):
249- is_linux_x64 = self .arch == "x86" and self .bits == 64 and self .os == "linux"
250-
251- return self .llvm_branch == LLVM_MAIN and (is_linux_x64 or self .os == "osx" )
252-
253- def handles_wasm_wabt (self ):
254- return self .handles_wasm ()
244+ return self .llvm_branch == LLVM_MAIN and ((self .arch == "x86" and self .os == "linux" ) or self .os == "osx" )
255245
256246 def handles_wasm_v8 (self ):
257247 # OSX machines don't have V8 installed
258248 return self .handles_wasm () and self .os == "linux"
259249
260250 def has_nvidia (self ):
261- return self .arch == "x86" and self .bits == 64 and self . os in ["windows" , "linux" ]
251+ return self .arch == "x86" and self .os in ["windows" , "linux" ]
262252
263253 def handles_vulkan (self ):
264254 # Stick with Windows on x86-64 for now. Others TBD.
265- return self .arch == "x86" and self .bits == 64 and self . os == "windows"
255+ return self .arch == "x86" and self .os == "windows"
266256
267257 def handles_webgpu (self ):
268258 # At the moment, the WebGPU team recommends the OSX versions of Dawn/Node
@@ -272,11 +262,7 @@ class HalideBuilder(BuilderConfig):
272262 return self .os == "osx"
273263
274264 def has_tflite (self ):
275- if self .arch == "x86" and self .bits == 64 and self .os == "linux" :
276- return True
277- if self .arch == "arm" and self .bits == 64 and self .os == "osx" :
278- return True
279- return False
265+ return (self .arch == "x86" and self .os == "linux" ) or (self .arch == "arm" and self .os == "osx" )
280266
281267 def has_ccache (self ):
282268 return self .os in ["osx" , "linux" ]
@@ -296,7 +282,7 @@ class HalideBuilder(BuilderConfig):
296282 return self .builder_label ().split ("-" )
297283
298284 def is_compatible_with (self , worker ):
299- return self .arch == worker .arch and self .bits in worker .bits and self .os == worker .os
285+ return self .arch == worker .arch and self .bits == worker .bits and self .os == worker .os
300286
301287 def __str__ (self ):
302288 return self .halide_target ()
@@ -400,10 +386,6 @@ def save_environment(prop, allowlist):
400386
401387
402388def get_msvc_config_steps (factory , builder_type ):
403- # ensure that we use the x64 host compiler, not the x86 host compiler
404- arch_for_bits = {32 : "x64_x86" , 64 : "x64" }
405- vcvarsall = f"vcvarsall.bat { arch_for_bits [builder_type .bits ]} && set"
406-
407389 # TODO: surely there is a better way of locating vcvarsall
408390 # vcvarsdir = "c:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Auxiliary/Build"
409391 vcvarsdir = "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build"
@@ -418,7 +400,7 @@ def get_msvc_config_steps(factory, builder_type):
418400 workdir = vcvarsdir ,
419401 locks = [performance_lock .access ("counting" )],
420402 haltOnFailure = True ,
421- command = vcvarsall ,
403+ command = " vcvarsall.bat x64 && set" ,
422404 extract_fn = save_environment ("env" , VCVARSALL_ENV_VARS ),
423405 )
424406 )
@@ -444,8 +426,8 @@ def get_ctest_options(builder_type):
444426 # at test time (just at configure time).
445427 # return {'preset': builder_type.sanitizer_preset(), 'test_dir': build_dir}
446428 return {"build_config" : builder_type .sanitizer_preset ()}
447- else :
448- return {"build_config" : "Release" }
429+
430+ return {"build_config" : "Release" }
449431
450432
451433def get_cmake_definitions (builder_type , halide_target = "host" , wasm_jit = "wabt" , extra_cmake_defs = None ):
@@ -511,9 +493,7 @@ def get_build_command(build_dir, targets=None):
511493
512494def add_create_venv_step (factory , builder_type ):
513495 llvm_ver = LLVM_BRANCHES [builder_type .llvm_branch ].short_version
514- platform_tag = _PIP_PLATFORM_TAGS [(builder_type .arch , builder_type .bits , builder_type .os )]
515-
516- group = f"ci-llvm-{ llvm_ver } " if platform_tag is None else "ci-base"
496+ group = f"ci-llvm-{ llvm_ver } "
517497
518498 if builder_type .os == "windows" :
519499 activate = r'"%UV_PROJECT_ENVIRONMENT%\Scripts\activate"'
@@ -543,128 +523,38 @@ def add_create_venv_step(factory, builder_type):
543523 )
544524 )
545525
546-
547- _PIP_PLATFORM_TAGS = {
548- # (arch, bits, os) -> pip --platform tag; None means native (no flag needed)
549- ("x86" , 64 , "linux" ): None ,
550- ("x86" , 32 , "linux" ): "manylinux_2_28_i686" ,
551- ("x86" , 64 , "osx" ): None ,
552- ("arm" , 64 , "osx" ): None ,
553- ("x86" , 64 , "windows" ): None ,
554- ("x86" , 32 , "windows" ): "win32" ,
555- }
556-
557-
558- def add_install_llvm_step (factory , builder_type ):
559- llvm = LLVM_BRANCHES [builder_type .llvm_branch ].short_version
560- platform_tag = _PIP_PLATFORM_TAGS [(builder_type .arch , builder_type .bits , builder_type .os )]
561-
562- if platform_tag is None :
563- # Native-install: halide-llvm was already installed by uv sync
564- factory .addStep (
565- SetPropertyFromCommand (
566- name = f"Get LLVM { llvm } prefix" ,
567- locks = [performance_lock .access ("counting" )],
568- workdir = get_source_path (),
569- haltOnFailure = True ,
570- env = Property ("env" ),
571- command = "halide-llvm --prefix" ,
572- property = "HALIDE_LLVM_ROOT" ,
573- )
574- )
575- else :
576- # Cross-install: use pip to install halide-llvm for a foreign platform
577- extra_index = "https://pypi.halide-lang.org/simple/"
578- target_dir = get_builddir_subpath ("halide-llvm-cross" )
579-
580- factory .addStep (
581- ShellCommand (
582- name = "Install pip" ,
583- locks = [performance_lock .access ("counting" )],
584- workdir = get_source_path (),
585- haltOnFailure = True ,
586- env = Property ("env" ),
587- command = "uv pip install pip" ,
588- )
589- )
590-
591- factory .addStep (
592- SetPropertyFromCommand (
593- name = f"Get halide-llvm { llvm } version" ,
594- locks = [performance_lock .access ("counting" )],
595- workdir = get_source_path (),
596- haltOnFailure = True ,
597- command = (
598- f"uv export --group ci-llvm-{ llvm } --format requirements.txt "
599- "--no-hashes --no-annotate --no-header --no-emit-project"
600- ),
601- extract_fn = lambda _rc , stdout , _stderr : {
602- "HALIDE_LLVM_PIP_VERSION" : re .search (r"^halide-llvm==.+$" , stdout , re .M ).group () # type: ignore[union-attr]
603- },
604- )
605- )
606-
607- factory .addStep (
608- RemoveDirectory (
609- name = f"Remove old halide-llvm { llvm } cross dir" ,
610- locks = [performance_lock .access ("counting" )],
611- dir = target_dir ,
612- haltOnFailure = False ,
613- )
614- )
615-
616- factory .addStep (
617- ShellCommand (
618- name = f"Install halide-llvm { llvm } ({ platform_tag } )" ,
619- locks = [performance_lock .access ("counting" )],
620- workdir = get_source_path (),
621- haltOnFailure = True ,
622- env = Property ("env" ),
623- command = Interpolate ("python -m pip install --pre --target " )
624- + target_dir
625- + Interpolate (
626- f" --platform { platform_tag } --only-binary=:all: "
627- '"%(prop:HALIDE_LLVM_PIP_VERSION)s" '
628- f"--extra-index-url { extra_index } "
629- ),
630- )
631- )
632-
633- # The prefix is the data directory inside the installed package
634- llvm_root = get_builddir_subpath ("halide-llvm-cross/halide_llvm/data" )
635- factory .addStep (
636- SetProperties (
637- name = f"Set LLVM { llvm } prefix (cross)" ,
638- properties = {"HALIDE_LLVM_ROOT" : llvm_root },
639- )
526+ factory .addStep (
527+ SetPropertyFromCommand (
528+ name = f"Get LLVM { llvm_ver } prefix" ,
529+ locks = [performance_lock .access ("counting" )],
530+ workdir = get_source_path (),
531+ haltOnFailure = True ,
532+ env = Property ("env" ),
533+ command = "halide-llvm --prefix" ,
534+ property = "HALIDE_LLVM_ROOT" ,
640535 )
536+ )
641537
642538
643539def add_env_setup_step (factory , builder_type ):
644540 if builder_type .os == "windows" :
645541 # do this first because the SetPropertyFromCommand step isn't smart enough to merge
646542 get_msvc_config_steps (factory , builder_type )
647543
648- cxx = "c++"
649- cc = "cc"
650- ld = "ld"
651-
652544 if builder_type .os == "linux" :
653545 cc = "gcc-9"
654546 cxx = "g++-9"
655- ld = "ld"
656- if builder_type .arch == "x86" and builder_type .bits == 32 :
657- cxx += " -m32"
658- cc += " -m32"
659- ld += " -melf_i386"
660547 elif builder_type .os == "windows" :
661548 cxx = "cl.exe"
662549 cc = "cl.exe"
550+ else :
551+ cxx = "c++"
552+ cc = "cc"
663553
664554 env : dict [str , Renderable ] = {
665555 "CC" : cc ,
666556 "CXX" : cxx ,
667- "LD" : ld ,
557+ "LD" : "ld" ,
668558 }
669559
670560 factory .addStep (
@@ -913,9 +803,8 @@ def get_test_labels(builder_type):
913803 if builder_type .arch == "x86" :
914804 t = f"x86-{ builder_type .bits } -{ builder_type .os } "
915805 targets [t ].extend (["correctness" ])
916- # on x86-64, also test with SSE4.1 (but nothing else that 'host' might sniff)
917- if builder_type .bits == 64 :
918- targets [f"{ t } -sse41" ].extend (["correctness" ])
806+ # Also test with SSE4.1 (but nothing else that 'host' might sniff).
807+ targets [f"{ t } -sse41" ].extend (["correctness" ])
919808
920809 # Test a subset of things on GPU/DSP targets, as appropriate
921810 for t , is_simulator in get_gpu_dsp_targets (builder_type ):
@@ -944,17 +833,12 @@ def get_test_labels(builder_type):
944833 )
945834
946835 if builder_type .handles_wasm ():
947- if builder_type .handles_wasm_wabt ():
948- # TODO: this is a horrid hack. For now, we want to test JIT with both WABT and V8.
949- # Add as a horrible wart on the target string.
950- targets ["wasm-32-wasmrt-wasm_simd128/wabt" ].extend (
951- ["internal" , "correctness" , "generator" , "error" , "warning" ]
952- )
836+ # TODO: this is a horrid hack. For now, we want to test JIT with both WABT and V8.
837+ # Add as a horrible wart on the target string.
838+ targets ["wasm-32-wasmrt-wasm_simd128/wabt" ].extend (["internal" , "correctness" , "generator" , "error" , "warning" ])
953839
954- # Do at least some testing with "baseline-only" wasm
955- targets ["wasm-32-wasmrt-wasm_mvponly/wabt" ].extend (
956- ["internal" , "correctness" , "generator" , "error" , "warning" ]
957- )
840+ # Do at least some testing with "baseline-only" wasm
841+ targets ["wasm-32-wasmrt-wasm_mvponly/wabt" ].extend (["internal" , "correctness" , "generator" , "error" , "warning" ])
958842
959843 if builder_type .handles_wasm_v8 ():
960844 # TODO: this is a horrid hack. For now, we want to test JIT with both WABT and V8.
@@ -1102,17 +986,17 @@ def add_test_steps(factory, builder_type):
1102986 exclude_tests .append ("lens_blur" )
1103987 exclude_tests .append ("unsharp" )
1104988
1105- if builder_type .os == "linux" or builder_type . bits == 32 :
1106- # TODO: disable tutorial_lesson_12_using_the_gpu (both C++ and python) on linux and 32-bit
989+ if builder_type .os == "linux" :
990+ # TODO: disable tutorial_lesson_12_using_the_gpu (both C++ and python) on linux
1107991 exclude_tests .append ("tutorial_lesson_12" )
1108992
1109993 if builder_type .sanitizer == "asan" :
1110994 # lesson 19 can trigger memory leaks in some of the GPU device drivers,
1111995 # so just exclude it when doing ASAN
1112996 exclude_tests .append ("tutorial_lesson_19" )
1113997
1114- if builder_type .arch == "arm" or builder_type . bits == 32 :
1115- # TODO: disable lesson_19 on ARM and 32-bit targets
998+ if builder_type .arch == "arm" :
999+ # TODO: disable lesson_19 on ARM targets
11161000 # https://github.com/halide/Halide/issues/5224
11171001 exclude_tests .append ("tutorial_lesson_19" )
11181002
@@ -1228,7 +1112,6 @@ def create_build_factory(builder_type):
12281112 add_env_setup_step (factory , builder_type )
12291113 add_get_source_steps (factory )
12301114 add_create_venv_step (factory , builder_type )
1231- add_install_llvm_step (factory , builder_type )
12321115 add_build_steps (factory , builder_type )
12331116 add_test_steps (factory , builder_type )
12341117 return factory
@@ -1243,7 +1126,7 @@ def get_interesting_targets():
12431126 if arch == "arm" and os == "linux" :
12441127 # ARM Linux builds run on GitHub Actions instead.
12451128 continue
1246- yield arch , 64 , os
1129+ yield arch , BITS , os
12471130
12481131
12491132def create_builder (arch , bits , os , llvm_branch ):
@@ -1269,7 +1152,7 @@ def create_builders():
12691152 # Test pull requests for Halide master against the current and previous LLVM, for at least one target.
12701153 for llvm_branch in LLVM_BRANCHES :
12711154 if llvm_branch != LLVM_MAIN :
1272- yield from create_builder ("x86" , 64 , "linux" , llvm_branch )
1155+ yield from create_builder ("x86" , BITS , "linux" , llvm_branch )
12731156
12741157
12751158c ["builders" ] = list (create_builders ())
0 commit comments