[llvm] [lld] [flang] [clang] [AMDGPU] Introduce GFX9/10.1/10.3/11 Generic Targets (PR #76955)
https://github.com/cgmb approved this pull request. https://github.com/llvm/llvm-project/pull/76955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[llvm] [clang] [lld] [flang] [AMDGPU] Introduce GFX9/10.1/10.3/11 Generic Targets (PR #76955)
@@ -520,6 +520,106 @@ Every processor supports every OS ABI (see :ref:`amdgpu-os`) with the following === === = = === === == +Generic processors also exist. They group multiple processors into one, +allowing to build code once and run it on multiple targets at the cost +of less features being available. + +Generic processors are only available on Code Object V6 and up. + + .. table:: AMDGPU Generic Processors + :name: amdgpu-generic-processor-table + + == = = + Processor TargetSupported Target + TripleProcessorsFeatures + ArchitectureRestrictions + + + + + + + + + == = = + ``gfx9-generic`` ``amdgcn`` - ``gfx900`` - ``v_mad_mix`` instructions + - ``gfx902``are not available on + - ``gfx904````gfx900``, ``gfx902``, + - ``gfx906````gfx909``, ``gfx90c`` + - ``gfx909`` - ``v_fma_mix`` instructions + - ``gfx90c``are not available on ``gfx904`` + - sramecc is not available on + ``gfx906`` + - The following instructions + are not available on ``gfx906``: + + - ``v_fmac_f32`` + - ``v_xnor_b32`` + - ``v_dot4_i32_i8`` + - ``v_dot8_i32_i4`` + - ``v_dot2_i32_i16`` + - ``v_dot2_u32_u16`` + - ``v_dot4_u32_u8`` + - ``v_dot8_u32_u4`` + - ``v_dot2_f32_f16`` + + + ``gfx10.1-generic`` ``amdgcn`` - ``gfx1010`` - The following instructions are + - ``gfx1011`` not available on ``gfx1011`` + - ``gfx1012`` and ``gfx1012`` + - ``gfx1013`` + - ``v_dot4_i32_i8`` cgmb wrote: This wording seems to imply that gfx1012 supports the following instructions but gfx1010 does not. I had thought that gfx1012 was identical to gfx1010, but if I was mistaken then I am very pleased that this documentation has corrected my misapprehension. https://github.com/llvm/llvm-project/pull/76955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[flang] [lld] [llvm] [clang] [AMDGPU] Introduce GFX9/10.1/10.3/11 Generic Targets (PR #76955)
@@ -520,6 +520,106 @@ Every processor supports every OS ABI (see :ref:`amdgpu-os`) with the following === === = = === === == +Generic processors also exist. They group multiple processors into one, +allowing to build code once and run it on multiple targets at the cost +of less features being available. + +Generic processors are only available on Code Object V6 and up. + + .. table:: AMDGPU Generic Processors + :name: amdgpu-generic-processor-table + + == = = + Processor TargetSupported Target + TripleProcessorsFeatures + ArchitectureRestrictions + + + + + + + + + == = = + ``gfx9-generic`` ``amdgcn`` - ``gfx900`` - ``v_mad_mix`` instructions + - ``gfx902``are not available on + - ``gfx904````gfx900``, ``gfx902``, + - ``gfx906````gfx909``, ``gfx90c`` + - ``gfx909`` - ``v_fma_mix`` instructions + - ``gfx90c``are not available on ``gfx904`` + - sramecc is not available on + ``gfx906`` + - The following instructions + are not available on ``gfx906``: + + - ``v_fmac_f32`` + - ``v_xnor_b32`` + - ``v_dot4_i32_i8`` + - ``v_dot8_i32_i4`` + - ``v_dot2_i32_i16`` + - ``v_dot2_u32_u16`` + - ``v_dot4_u32_u8`` + - ``v_dot8_u32_u4`` + - ``v_dot2_f32_f16`` + + + ``gfx10.1-generic`` ``amdgcn`` - ``gfx1010`` - The following instructions are + - ``gfx1011`` not available on ``gfx1011`` + - ``gfx1012`` and ``gfx1012`` + - ``gfx1013`` + - ``v_dot4_i32_i8`` + - ``v_dot8_i32_i4`` + - ``v_dot2_i32_i16`` + - ``v_dot2_u32_u16`` + - ``v_dot2c_f32_f16`` + - ``v_dot4c_i32_i8`` + - ``v_dot4_u32_u8`` + - ``v_dot8_u32_u4`` + - ``v_dot2_f32_f16`` + + - BVH Ray Tracing instructions + are not available on + ``gfx1013`` + + + ``gfx10.3-generic`` ``amdgcn`` - ``gfx1030`` No restrictions. + - ``gfx1031`` + - ``gfx1032`` + - ``gfx1033`` + - ``gfx1034`` + - ``gfx1035`` + - ``gfx1036`` cgmb wrote: Should gfx1037 be included in this list? https://github.com/llvm/llvm-project/pull/76955 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang] [HIP] change default offload archs (PR #139281)
https://github.com/cgmb commented: Thanks @yxsamliu! To add a bit more context, this was my original email that raised the topic: > I wonder if we should consider revisiting the decision to default clang to > gfx906 [1]. I came across how that decision was made shortly after it was > implemented, and at the time I thought it was silly not to default to > `native`. The decision was made to change the default from gfx803 to gfx906 > because the former wasn’t supported, but AMD dropped support for the latter > shortly thereafter. Using the same criteria as that previous decision, we > should be changing the default again to something newer. > > However, the default of "some random GPU architecture that changes every few > releases" is just plain bad. If a user tries to run a program that was built > for gfx906 only because nothing else was specified, the most likely result > will be that the program doesn’t work on their machine. I’m not sure what the > current behaviour of the HIP Runtime is, but historically, running a program > built for a different GPU than your own would result in a crash that might > not even include an error message. > > My workstations all have gfx906 GPUs, but this is arguably worse! It means > that when I work on build scripts, if I make a mistake and fail to specify > the target architecture somewhere, the built result will still work on my > machine! This hides errors in my build scripts, which then become a problem > when I share those scripts with others working on different hardware. Even > for my own work, I wouldn’t want to depend on gfx906 being the default > target. My scripts would all break when I update clang to some future version. > > I would suggest that we should either (a) change the default GPU target to > `native` and make the failure to detect the user’s GPU into a hard compiler > error, or (b) change the default GPU target to SPIR-V so that it works on > every machine. > > [1]: > https://discourse.llvm.org/t/rfc-let-clang-use-system-gpu-as-default-offload-arch-for-hip/66950/5 https://github.com/llvm/llvm-project/pull/139281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits