Skip to content

Adapt ifdefs to generic architectures #1624

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

mkuron
Copy link

@mkuron mkuron commented May 24, 2025

I was thinking about building with e.g. GPU_TARGETS="gfx9-4-generic;gfx11-generic" (see https://rocm.docs.amd.com/projects/llvm-project/en/develop/conceptual/code-portability.html#generic-code-objects) to reduce compile time and binary size while still being able to run on all architectures relevant to me. This led me to a few #ifdefs that explicitly checked for specific architecture, which this pull request adapts to also support generic architectures.

@mkuron
Copy link
Author

mkuron commented Jun 5, 2025

Could one of the reviewers please take a look?

Copy link
Contributor

@TorreZuk TorreZuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkuron can you tell me what is the gfx of the hardware you are building for? Something like this will likely be acceptable in the very near future. However it currently doesn't work with our default build options of compressed offload and released stack. We want to see all tests pass before making these changes so it can be a standardized rollout of this feature and work by default.

@mkuron
Copy link
Author

mkuron commented Jun 6, 2025

Indeed you need to override a few build options (BUILD_OFFLOAD_COMPRESS, GPU_TARGETS) to actually use this change. My goal was to just upstream the required C++ changes now so generic architectures can be used in custom builds and leave it up to you to decide what you want to do with the default build.

@TorreZuk
Copy link
Contributor

TorreZuk commented Jun 9, 2025

@mkuron I still would like to know if you can tell me what is the gfx of the hardware you will run on; as I want to clarify what this gfx generic adds support for over existing gfx942 ?

@mkuron
Copy link
Author

mkuron commented Jun 10, 2025

When I build for gfx11-generic, the resulting binary will be compatible with gfx1100, gfx1101, and gfx1151. So this isn‘t about adding support for new hardware, but about supporting hardware without building for every single model. In the case of gfx9-4-generic, the resulting binary is supposed to also run on the upcoming gfx950.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants