Skip to content

Commit

Permalink
Added __HIP_PLATFORM_AMD__=1 for non JIT build (microsoft#4585)
Browse files Browse the repository at this point in the history
This PR is required in addition to
microsoft#4539 to define
HIP_PLATFORM_AMD on ROCm.

This is required for DeepSpeed non-JIT build. For JIT build we have
microsoft#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>
  • Loading branch information
2 people authored and amaurya committed Feb 17, 2024
1 parent 24640b3 commit 607f644
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions op_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ def builder(self):
if not self.build_for_cpu and self.enable_bf16:
compile_args['cxx'].append("-DBF16_AVAILABLE")

if self.is_rocm_pytorch():
compile_args['cxx'].append("-D__HIP_PLATFORM_AMD__=1")

cuda_ext = ExtensionBuilder(name=self.absolute_name(),
sources=self.strip_empty_entries(self.sources()),
include_dirs=self.strip_empty_entries(self.include_paths()),
Expand Down

0 comments on commit 607f644

Please sign in to comment.