Skip to content

Commit 0daf7f2

Browse files
rraminenloadams
andauthored
Added __HIP_PLATFORM_AMD__=1 for non JIT build (#4585)
This PR is required in addition to #4539 to define HIP_PLATFORM_AMD on ROCm. This is required for DeepSpeed non-JIT build. For JIT build we have #4570. This is required for DeepSpeed extensions build in those docker images with PyTorch built before pytorch/pytorch#111975. cc: @jeffdaily @jithunnair-amd Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
1 parent c2074b3 commit 0daf7f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

op_builder/builder.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,9 @@ def builder(self):
616616
if not self.build_for_cpu and self.enable_bf16:
617617
compile_args['cxx'].append("-DBF16_AVAILABLE")
618618

619+
if self.is_rocm_pytorch():
620+
compile_args['cxx'].append("-D__HIP_PLATFORM_AMD__=1")
621+
619622
cuda_ext = ExtensionBuilder(name=self.absolute_name(),
620623
sources=self.strip_empty_entries(self.sources()),
621624
include_dirs=self.strip_empty_entries(self.include_paths()),

0 commit comments

Comments
 (0)