-
Notifications
You must be signed in to change notification settings - Fork 553
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
Reland "[spirv] Switch to use common target description" #17699
Conversation
This relands iree-org#17623. This commit switches SPIR-V side to use the common `#iree_gpu.target` to describe the GPU characteristics. With it we can now remove the ad-hoc Vulkan attributes and dialects and unify how GPU are described across various GPU compiler backends in IREE. SPIR-V has some additional requirements that we need to account for: We have many vendors and APIs to handle there so this commit adds various AMD/ARM/NVIDIA/Qualcomm targets for development purposes so that we can specify them with a shorthand. In order to be extensible, leverage the `feature` field in `#iree_gpu.target` to specify additional capabilities with `cap:` prefix and extensions with `ext:` prefix. We also use the `feature` field to specify what SPIR-V version to target with the `spirv:v1.x` format. Right now the `SPIRVConvertGPUTarget` pass is invoked immediately before configuration. This is to stage the changes. As a next step we need to move it immediately before `ConvertToSPIRV` pass. `--iree-vulkan-target-env` is dropped given now we removed the whole Vulkan dialect and cannot control with a `#vk.target_env` attribute anymore. The default `--iree-vulkan-target-triple` now becomes `vp_android_baseline_2022`, which is a a good lowest common denominator to guarantee the generated SPIR-V is widely accepted. We are not considering SwiftShader now anymore like previously due to testing purposes. The `--iree-vulkan-target-triple` should be renamed given it's not a triple anymore--that will happen later together with other GPU backends (i.e., cuda/hip) to be consistent. In order to support cooperative matrix conversion, we added `WMMA_F16_16x16x16_F16`. For NVIDIA GPUs we are abusing it right now without considering the concrete explicit layout--that is fine given in Vulkan they are opaque anyway. But this need to be fixed if we are targeting WMMA in CUDA. We now contruct a `#iree_gpu.target` to specify the target to drive SPIR-V CodeGen. Progress towards iree-org#16341 ci-extra: test_nvidia_gpu,test_nvidia_a100,test_amd_mi250, build_test_all_macos_arm64,build_and_test_android Signed-off-by: Lei Zhang <antiagainst@gmail.com>
Signed-off-by: Lei Zhang <antiagainst@gmail.com>
498521f
to
efaeead
Compare
Abbreviated Benchmark Summary@ commit 8291dfe5797d4cc41a29cfc2c8ac1c701e05be7c (vs. base 7c410492bdcbfdd4972de827d995bfb8482841a5) Regressed Latencies 🚩
No improved or regressed compilation metrics 🏖️ For more information: |
Signed-off-by: Lei Zhang <antiagainst@gmail.com>
Signed-off-by: Lei Zhang <antiagainst@gmail.com>
f96bc7d
to
13328fb
Compare
(typo in PR title |
This reverts commit 13328fb. Signed-off-by: Lei Zhang <antiagainst@gmail.com>
Signed-off-by: Lei Zhang <antiagainst@gmail.com>
4037a1e
to
7c310ec
Compare
@ScottTodd @kuhar this should be good now--android tests and benchmarks are fixed. |
This reverts commit e1d881f. Signed-off-by: Lei Zhang <antiagainst@gmail.com>
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 comment, otherwise LGTM
Signed-off-by: Lei Zhang <antiagainst@gmail.com>
Looks |
That runner went offline for maintenance yeah. |
This relands #17623.
This commit switches SPIR-V side to use the common
#iree_gpu.target
to describe the GPU characteristics. With it we can now remove the ad-hoc Vulkan attributes and dialects and unify how GPU are described across various GPU compiler backends in IREE.SPIR-V has some additional requirements that we need to account for:
We have many vendors and APIs to handle there so this commit adds various AMD/ARM/NVIDIA/Qualcomm targets for
development purposes so that we can specify them with a shorthand.
In order to be extensible, leverage the
feature
field in#iree_gpu.target
to specify additional capabilities withcap:
prefix and extensions withext:
prefix. We also use thefeature
field to specify what SPIR-V version to target with thespirv:v1.x
format.Right now the
SPIRVConvertGPUTarget
pass isinvoked immediately before configuration. This is to stage the changes. As a next step we need to move
it immediately before
ConvertToSPIRV
pass.--iree-vulkan-target-env
is dropped given now we removed the whole Vulkan dialect and cannot control with a#vk.target_env
attribute anymore.The default
--iree-vulkan-target-triple
now becomesvp_android_baseline_2022
, which is a a good lowest common denominator to guarantee the generated SPIR-V is widely accepted. We are not considering SwiftShader now anymore like previously due to testing purposes.The
--iree-vulkan-target-triple
should be renamed given it's not a triple anymore--that will happen later together with other GPU backends (i.e., cuda/hip) to be consistent.In order to support cooperative matrix conversion, we added
WMMA_F16_16x16x16_F16
. For NVIDIA GPUswe are abusing it right now without considering the concrete explicit layout--that is fine given in Vulkan they are opaque anyway. But this need to be fixed if we are targeting WMMA in CUDA.
We now contruct a
#iree_gpu.target
to specifythe target to drive SPIR-V CodeGen.
Progress towards #16341
ci-extra: test_nvidia_gpu,test_nvidia_a100,test_amd_mi250, build_test_all_macos_arm64,build_and_test_android,test_on_moto-edge-x30