-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename AMD GPU architectures #6266
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the change, and I think the arch name works well (and is more descriptive than what we currently have)
Makefile.kokkos
Outdated
@@ -13,7 +13,7 @@ KOKKOS_DEVICES ?= "Threads" | |||
# NVIDIA: Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal60,Pascal61,Volta70,Volta72,Turing75,Ampere80,Ampere86,Ada89,Hopper90 | |||
# ARM: ARMv80,ARMv81,ARMv8-ThunderX,ARMv8-TX2,A64FX | |||
# IBM: BGQ,Power7,Power8,Power9 | |||
# AMD-GPUS: Vega906,Vega908,Vega90A,Navi1030 | |||
# AMD-GPUS: Gfx906,Gfx908,Gfx90A,Gfx1030 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for these to not be fully capitalized? I guess the rest in the list here aren't, but AFAICT this is the only case where they're not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, I'll change this.
Will this change break any existing build scripts if a user had manually specified a kokkos arch (i.e. |
No this will be backward compatible once I fix the export of the macros. |
Per the meeting, this will need the docs updated. @dalg24 suggested to put a |
3fa8a0b
to
ce1d065
Compare
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMD_GFX906), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GFX906") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GPU") | ||
KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx906 | ||
endif | ||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VEGA908), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA908") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA") | ||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMD_GFX908), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GFX908") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GPU") | ||
KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx908 | ||
endif | ||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VEGA90A), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA90A") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA") | ||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMD_GFX90A), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GFX90A") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GPU") | ||
KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx90a | ||
endif | ||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_NAVI1030), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_NAVI1030") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_NAVI") | ||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMD_GFX1030), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GFX1030") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GPU") | ||
KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx1030 | ||
endif | ||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_NAVI1100), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_NAVI1100") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_NAVI") | ||
ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMD_GFX1100), 1) | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GFX1100") | ||
tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_GPU") | ||
KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx1100 | ||
endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means we don't set the old macros anymore when using Makefiles but we do for CMake
? Shouldn't we be consistent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more reason to switch to cmake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you plan any replacement for the VEGA and NAVI macros (regroup family of similar architectures)
#cmakedefine KOKKOS_ARCH_AMD_GFX90A | ||
#cmakedefine KOKKOS_ARCH_AMD_GFX1030 | ||
#cmakedefine KOKKOS_ARCH_AMD_GFX1100 | ||
#cmakedefine KOKKOS_ARCH_AMD_GPU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NVIDIA equivalent macro is an impl only (KOKKOS_IMPL_ARCH_NVIDIA_GPU
)
while we have KOKKOS_ARCH_INTEL_GPU
.
Please confirm you don't want it to be KOKKOS_IMPL_ARCH_AMD_GPU
and if so explain why in a few words.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure that there is a good consistent value to be set for AMD which actually implies growing capability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please confirm you don't want it to be KOKKOS_IMPL_ARCH_AMD_GPU and if so explain why in a few words.
My idea was to have a macro for user to do sanity check or to use in their code if they want to do something special on AMD GPU.
not sure that there is a good consistent value to be set for AMD which actually implies growing capability?
No, I don't think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gfxarch ID does at least indicate a card's capabilities as according to the compiler: https://llvm.org/docs/AMDGPUUsage.html#processors, though I agree that it won't necessarily align to 'growing capabilities'.
Edit: note that most of these are things a user code does not have to care about, with the large exception of Wave32 vs Wave64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add // deprecated
on the old macros
No I don't. Right now, the difference between VEGA and NAVI is that VEGA is using a wave front of 64 and NAVI use 32. However on some NAVI architectures, you can switch the wavefront to use 64. The current division VEGA/NAVI does not make sense and I don't feel confident introducing a new 32/64 wavefront macro, since we don't have any NAVI hardware to test the different configurations. |
I'm also a bit dubious of Wave64 support on Navi. Yes, it's supposed to work, but... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stanmoore1 make sure you see this
We might need to be more cautious with that change.
Although I tend to agree with Bruno's sentiment https://github.com/kokkos/kokkos/pull/6266/files#r1263934282 but we need to protect downstream users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the note. Maintaining backwards compatibility for Makefiles would be nice, or at least put it into a deprecation cycle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the note. Maintaining backwards compatibility for Makefiles would be nice, or at least put it into a deprecation cycle.
The HIP old architecture names or the whole makefiles shenanigans?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarification, what changes is not the configuration keyword, these we will continue to honor.
In the current form of the PR we would not define the KOKKOS_ARCH_VEGA*
macros which Bruno actually looked for in LAMMPS and they are not used.
Sorry about the confusion.
KOKKOS_INTERNAL_USE_ARCH_VEGA908 := $(call kokkos_has_string,$(KOKKOS_ARCH),Vega908) | ||
KOKKOS_INTERNAL_USE_ARCH_VEGA90A := $(call kokkos_has_string,$(KOKKOS_ARCH),Vega90A) | ||
KOKKOS_INTERNAL_USE_ARCH_NAVI1030 := $(call kokkos_has_string,$(KOKKOS_ARCH),Navi1030) | ||
KOKKOS_INTERNAL_USE_ARCH_AMD_GFX906 := $(or $(call kokkos_has_string,$(KOKKOS_ARCH),VEGA906),$(call kokkos_has_string,$(KOKKOS_ARCH),AMD_GFX906)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to change the case? Vega906 -> VEGA906
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs fixing though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change it back but it makes no difference because kokkos_has_string
converts the lower case to upper case.
There is a problem with the architecture auto-detection. I am working on fixing the issue. |
It should be good now. I just had to move function to a different place. I also updated the OpenACC and OpenMPTarget backends to use the new macros. |
Can we get this merged? I think @arghdos is waiting on this to be merged before creating a PR for MI300 |
This is a proposal to rename the AMD architectures in Kokkos. Currently to enable an AMD GPU we need to use names like
Kokkos_ARCH_VEGA90A
, i.e.VEGA
+ the GFX flag orNAVI
+ the GFX flag. This works pretty well for the NAVI cards but it's terrible for the VEGA cards. The code name Vega corresponds to the MI50/60 cards. The code name for MI100 is Arcturus and the code name for the MI200 series is Aldebaran. Every year the Vega name becomes more and more obsolete, so we need a new name. At first, I was thinking about using MI50, MI100, etc. The problem is that an MI50 and an MI60 are identical from our point of view. There is a similar issue with the MI200 series. CMake also has support for AMD GPU and they simply useGFX90A
. We could mimic what they are doing and useKokkos_ARCH_GFX90A
. I don't find it obvious that we are compiling for an AMD gpu. Instead, inspired by what we are doing for Intel, I propose that we useKokkos_ARCH_AMD_GFX90A
. This makes it clear that we are using an AMD GPU and the GFX flag matches what we are giving to the compiler. I also propose to drop our VEGA and NAVI macros that were rarely used and instead introduce an AMD_GPU macro similar to what we do for Intel. Users can keep using the current names but new GPU will only support the new naming conventions.This PR is a draft until we agree on the new naming convention.
Still missing in the PR: setting
Kokkos_ARCH_AMD_GFX90A
should define bothKOKKOS_ARCH_AMD_GFX90A
andKOKKOS_ARCH_VEGA90A
and vice versa.cc: @arghdos