Skip to content

Check hipSPARSELt for supported architectures#342

Open
zichguan-amd wants to merge 2 commits into
amd-stagingfrom
zichguan/hipsparselt-asic
Open

Check hipSPARSELt for supported architectures#342
zichguan-amd wants to merge 2 commits into
amd-stagingfrom
zichguan/hipsparselt-asic

Conversation

@zichguan-amd

Copy link
Copy Markdown
Collaborator

Motivation

Use hipSPARSELt's CMake fucntion to determine hipSPARSELt supported architectures. Do not build examples on unsupported architectures.

Technical Details

hipsparselt_validate_gpu_targets throws a fatal error which is not what we want, consult hipSPARSELt for supported ASICs with hipsparselt_get_supported_architectures and emits a warning and skip the examples from building on unsupported ASICs.

Test Plan

Azure CI gfx90a run

Test Result

Submission Checklist

@zichguan-amd zichguan-amd requested a review from a team as a code owner November 3, 2025 20:20
@zichguan-amd zichguan-amd force-pushed the zichguan/hipsparselt-asic branch from 59c3370 to f93a593 Compare November 3, 2025 20:21
sshi-amd added a commit to sshi-amd/rocm-examples that referenced this pull request Mar 10, 2026
…f hardcoding

Replace hardcoded GPU architecture lists with runtime queries to the
upstream libraries' CMake functions:

- hipSPARSELt: Use hipsparselt_get_supported_architectures() plus the
  shared filter_hip_architectures() utility to check arch support.
  Removes hardcoded gfx942/gfx950 list and changes FATAL_ERROR to
  WARNING+return() in standalone builds for graceful skipping.

- hipTensor: Use hiptensor_is_supported_architecture() to validate each
  arch at configure time. Moves find_package(hiptensor) earlier so the
  function is available. Removes hardcoded gfx908/gfx90a/gfx942/gfx950
  list from all 20 leaf CMakeLists. Changes FATAL_ERROR to WARNING+return()
  and upgrades "Linux only" message from STATUS to WARNING.

This ensures examples stay in sync with upstream library support
automatically, without needing manual updates when architectures change.

Resolves ROCm#342, ROCm#333

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zjin-lcf

zjin-lcf commented May 5, 2026

Copy link
Copy Markdown

@zichguan-amd

May I ask which architectures are not supported ? It does not seem mentioned in https://github.com/ROCm/rocm-libraries/tree/develop/projects/hipblaslt

@zichguan-amd

Copy link
Copy Markdown
Collaborator Author

@zjin-lcf

zjin-lcf commented May 6, 2026

Copy link
Copy Markdown

Sorry, I confused the two. Thanks.

@mapatel-amd mapatel-amd self-assigned this May 15, 2026
Signed-off-by: zichguan-amd <zichuan.guan@amd.com>
@mapatel-amd mapatel-amd force-pushed the zichguan/hipsparselt-asic branch from f93a593 to 9c23211 Compare May 16, 2026 23:01
@mapatel-amd mapatel-amd marked this pull request as draft May 17, 2026 00:09
@mapatel-amd mapatel-amd force-pushed the zichguan/hipsparselt-asic branch from 9c23211 to a453cfc Compare May 19, 2026 17:41
@mapatel-amd mapatel-amd marked this pull request as ready for review May 19, 2026 18:06
find_package(hipsparselt REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/../../../Common/FilterHIPArchitectures.cmake")
filter_hip_architectures("hipSPARSELt" "gfx942;gfx950" SHOULD_SKIP)

@zichguan-amd zichguan-amd May 20, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Could we get these archs from hipSPARSELt so we don't need to maintain the list here?

@mapatel-amd mapatel-amd force-pushed the zichguan/hipsparselt-asic branch from 3fb3566 to a453cfc Compare May 28, 2026 21:07
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.

4 participants