-
Notifications
You must be signed in to change notification settings - Fork 22
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
Enable dpnp build on AMD GPU #2302
base: master
Are you sure you want to change the base?
Conversation
Array API standard conformance tests for dpnp=0.17.0dev6=py312he4f9c94_10 ran successfully. |
View rendered docs @ https://intelpython.github.io/dpnp/pull/2302/index.html |
@@ -38,12 +38,12 @@ if(_dpnp_sycl_targets) | |||
target_compile_options( | |||
${python_module_name} | |||
PRIVATE | |||
-fsycl-targets=${_dpnp_sycl_targets} | |||
${_dpnp_sycl_target_compile_options} |
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.
Should we do the same for each CMakeList.txt per every extension?
if not arch: | ||
raise ValueError("--arch is required when --target=hip") | ||
cmake_args += [ | ||
"-DDPNP_TARGET_HIP=ON", |
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.
For what do we need to define two variables? Can it be combined in a single one, like in dpctl: -DDPNP_TARGET_HIP={arch}
?
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.
Additionally, --target=cuda
is current dpnp approach, but:
- dpctl and dpnp should consider supporting targeting specific CUDA architectures
--target=hip
means that there is no way to build simultaneously for HIP and CUDA (which is very, very much an edge case, but should be considered)
For these reasons, I think it is most sensible to move away from --target=
universal approach to --target-cuda=
and --target-hip=
or something to that effect
@@ -104,6 +105,16 @@ def run( | |||
# Always builds using oneMKL interfaces for the cuda target | |||
onemkl_interfaces = True | |||
|
|||
if target == "hip": |
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.
What is about documentation updates?
We need to describe and provide an example how to enable build for HIP target.
This PR updates
СMakeLists
files andbuild_locally.py
to enable building dpnp for AMD targets.To build dpnp on AMD:
--arch
is a required argument whentarget=hip
.where `arch`` is the architecture of the AMD GPU.
To find the architecture, use