-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
92 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
diff --git a/megatron/fused_kernels/scaled_masked_softmax_cuda.cu b/megatron/fused_kernels/scaled_masked_softmax_cuda.cu | ||
index 76086de..1533648 100644 | ||
--- a/megatron/fused_kernels/scaled_masked_softmax_cuda.cu | ||
+++ b/megatron/fused_kernels/scaled_masked_softmax_cuda.cu | ||
@@ -4,7 +4,7 @@ | ||
#include <cuda.h> | ||
#include <cuda_runtime.h> | ||
#include <cuda_fp16.h> | ||
-#ifndef __HIP_PLATFORM_HCC__ | ||
+#ifndef __HIP_PLATFORM_AMD__ | ||
#include <cuda_profiler_api.h> | ||
#endif | ||
#include <ATen/cuda/CUDAContext.h> | ||
diff --git a/megatron/fused_kernels/scaled_softmax_cuda.cu b/megatron/fused_kernels/scaled_softmax_cuda.cu | ||
index 90e1c9f..d217aec 100644 | ||
--- a/megatron/fused_kernels/scaled_softmax_cuda.cu | ||
+++ b/megatron/fused_kernels/scaled_softmax_cuda.cu | ||
@@ -4,7 +4,7 @@ | ||
#include <cuda.h> | ||
#include <cuda_runtime.h> | ||
#include <cuda_fp16.h> | ||
-#ifndef __HIP_PLATFORM_HCC__ | ||
+#ifndef __HIP_PLATFORM_AMD__ | ||
#include <cuda_profiler_api.h> | ||
#endif | ||
#include <ATen/cuda/CUDAContext.h> | ||
diff --git a/megatron/fused_kernels/scaled_upper_triang_masked_softmax_cuda.cu b/megatron/fused_kernels/scaled_upper_triang_masked_softmax_cuda.cu | ||
index 74c9f3d..03b5fc8 100644 | ||
--- a/megatron/fused_kernels/scaled_upper_triang_masked_softmax_cuda.cu | ||
+++ b/megatron/fused_kernels/scaled_upper_triang_masked_softmax_cuda.cu | ||
@@ -4,7 +4,7 @@ | ||
#include <cuda.h> | ||
#include <cuda_runtime.h> | ||
#include <cuda_fp16.h> | ||
-#ifndef __HIP_PLATFORM_HCC__ | ||
+#ifndef __HIP_PLATFORM_AMD__ | ||
#include <cuda_profiler_api.h> | ||
#endif | ||
#include <ATen/cuda/CUDAContext.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
diff --git a/configure.ac b/configure.ac | ||
index 20eceda..5b5c5ab 100755 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -237,13 +237,13 @@ AC_ARG_WITH([rocm], | ||
], | ||
[AS_CASE([$with_rocm], | ||
[yes|no], [], | ||
- [CPPFLAGS="-I$with_rocm/include $CPPFLAGS" | ||
+ [CPPFLAGS="-I$with_rocm/include -D__HIP_PLATFORM_AMD__=1 $CPPFLAGS" | ||
LDFLAGS="-L$with_rocm/lib64 -Wl,-rpath=$with_rocm/lib64 -L$with_rocm/lib -Wl,-rpath=$with_rocm/lib -lamdhip64 $LDFLAGS"]) | ||
]) | ||
|
||
AS_IF([test "x$enable_rocm" = xyes], [ | ||
AC_DEFINE([__HIP_PLATFORM_HCC__], [1], [Enable ROCm]) | ||
- AC_CHECK_HEADERS([hip/hip_runtime_api.h], [], | ||
+ AC_CHECK_HEADERS([/opt/rocm/include/hip/hip_runtime_api.h], [], | ||
[AC_MSG_ERROR([cannot include hip/hip_runtime_api.h])]) | ||
AC_SEARCH_LIBS([hipFree], [amdhip64], [], | ||
[AC_MSG_ERROR([cannot link with -lamdhip64])]) | ||
diff --git a/src/rocm_memory.c b/src/rocm_memory.c | ||
index e9a9136..cc028c9 100644 | ||
--- a/src/rocm_memory.c | ||
+++ b/src/rocm_memory.c | ||
@@ -44,8 +44,8 @@ static int init_rocm(int device_id) { | ||
|
||
hipDeviceProp_t prop = {0}; | ||
ROCM_CHECK(hipGetDeviceProperties(&prop, device_id)); | ||
- printf("Using ROCm Device with ID: %d, Name: %s, PCI Bus ID: 0x%x, GCN Arch: %d\n", | ||
- device_id, prop.name, prop.pciBusID, prop.gcnArch); | ||
+ printf("Using ROCm Device with ID: %d, Name: %s, PCI Bus ID: 0x%x, GCN Arch: %s\n", | ||
+ device_id, prop.name, prop.pciBusID, prop.gcnArchName); | ||
|
||
return SUCCESS; | ||
} |