Skip to content
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

Remove COMPILING_TARGETS from CMakeLists.txt #1533

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

Conversation

sohaibnd
Copy link

@sohaibnd sohaibnd commented Feb 5, 2025

COMPILING_TARGETS is not actually used for --offload-arch option, instead GPU_TARGETS is being used implicitly when we call
find_package(hip REQUIRED) (See hip-config-amd.cmake)

Details

Do not mention proprietary info or link to internal work items in this PR.

Work item: #1509

What were the changes?
Remove COMPILING_TARGETS from CMakeLists.txt

Why were the changes made?
COMPILING_TARGETS is not actually used for --offload-arch option, instead GPU_TARGETS is being used implicitly when we call
find_package(hip REQUIRED) (See hip-config-amd.cmake)

Approval Checklist

Do not approve until these items are satisfied.

  • Verify the CHANGELOG has been updated, if
    • there are any NCCL API version changes,
    • any changes impact library users, and/or
    • any changes impact any other ROCm library.

@@ -83,7 +85,7 @@ if (BUILD_ADDRESS_SANITIZER)
endif()
endif()
endforeach()
SET(GPU_TARGETS "${amdgpu_targets}" CACHE STRING "Modified GPU list for Address-Sanitizer enabled build." FORCE)
SET(GPU_TARGETS "${amdgpu_targets}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need FORCE here to override the default list of GPU_TARGETS with xnack+ appended values if not specified

Copy link
Author

@sohaibnd sohaibnd Feb 7, 2025

Choose a reason for hiding this comment

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

I've changed it to a normal variable instead of a cache variable (CACHE keyword removed) which does't need FORCE (reference: https://cmake.org/cmake/help/latest/command/set.html). Another advantage is that since normal variables won't be cached, if the user specifies BUILD_ADDRESS_SANITIZER OFF after previously specifying ON, the xnack+ will no longer be appended which is what you expect.

Copy link
Collaborator

Choose a reason for hiding this comment

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

does not work as intended

Copy link
Author

Choose a reason for hiding this comment

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

There is a set(GPU_TARGETS...CACHE) which gets called in hip-config-amd.cmake and leads to the normal variable being unset because of CMP0126, so I changed line 71 back to a set(CACHE), it should work now. I also got rid of COMPILING_TARGETS since it is not actually used to set --offload-arch option.

@sohaibnd sohaibnd changed the title Set GPU_TARGETS and COMPILING_TARGETS as normal variables in CMakeLis… Remove COMPILING_TARGETS from CMakeLists.txt Feb 10, 2025
COMPILING_TARGETS is not actually used for --offload-arch option,
instead GPU_TARGETS is being used implicitly when we call
find_package(hip REQUIRED) (See hip-config-amd.cmake).
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