fix(ck): Stream-K Tile Engine GPU Query Fix - #8086
Conversation
ed06956 to
643cb67
Compare
…xplicit parameter from CMake
cb9ab37 to
d2907e1
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes build-time GPU hardware probing (rocminfo) from the Stream-K tile engine validation path and instead threads the configured GPU target(s) from CMake into the Python validation/generation utilities, enabling builds on CPU-only nodes.
Changes:
- Removed runtime GPU detection and made validation functions accept an explicit
gpu_target. - Added per-GPU validation data for warp configuration and LDS capacity budgeting.
- Updated CMake/Python instance generation plumbing to pass
--gpu_targets, and added a small pytest file to validate LDS sizing behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| projects/composablekernel/tile_engine/ops/gemm_streamk/test_lds_capacity.py | Adds pytest coverage for GPU-aware LDS capacity validation. |
| projects/composablekernel/tile_engine/ops/gemm_streamk/gemm_streamk_validation_utils.py | Removes rocminfo querying and makes validation GPU-target-driven (warp + LDS). |
| projects/composablekernel/tile_engine/ops/gemm_streamk/gemm_streamk_instance_builder.py | Passes configured GPU targets into validation instead of probing hardware. |
| projects/composablekernel/tile_engine/ops/gemm_streamk/CMakeLists.txt | Updates custom commands to pass --gpu_targets to the instance builder. |
Comments suppressed due to low confidence (1)
projects/composablekernel/tile_engine/ops/gemm_streamk/gemm_streamk_validation_utils.py:265
validate_warp_tile_combinationlooks upWARP_TILE_SUPPORTED_COMBINATIONSusing the rawgpu_name. If callers pass full targets likegfx942:xnack+, the lookup misses and the function becomes permissive (and emits warnings). Normalize the GPU name similarly tovalidate_lds_capacityby stripping any:...suffix before the lookup/logging.
"""Validate warp tile combination against GPU-specific supported combinations."""
# Construct the key for looking up supported combinations
warp_tile_key = f"{a_datatype}_{b_datatype}_{c_datatype}"
current_combination = [warp_tile_m, warp_tile_n, warp_tile_k]
# Check if we have GPU-specific combinations
gpu_warp_tile_combinations = WARP_TILE_SUPPORTED_COMBINATIONS.get(gpu_name, {})
if not gpu_warp_tile_combinations:
# If GPU not recognized, try to be permissive but log warning
logging.warning(f"No warp tile combinations found for GPU: {gpu_name}")
return True, ""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d2907e1 to
2f42c5d
Compare
2f42c5d to
eedd197
Compare
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
tenpercent
left a comment
There was a problem hiding this comment.
comments were addressed and ci is passing. thanks!
fix(ck): Stream-K Tile Engine GPU Query Fix ## Motivation The Stream-K tile engine validation utilities call rocminfo at build time to detect the GPU architecture, which prevents building on CPU-only nodes. The GPU target is already known from CMake's SUPPORTED_GPU_TARGETS, so runtime hardware detection is unnecessary during code generation. ## Technical Details The gemm_streamk_validation_utils.py file used subprocess.check_output(["rocminfo"]) to query GPU hardware at CMake configure time. This call originated from get_gpu_name_by_id() and used during tile configuration validation. On CPU-only build nodes, this fails because rocminfo either doesn't exist or returns no GPU devices. The main changes are as follows: - Removed runtime GPU detection infrastructure: deleted get_gpu_name_by_id(), set_gpu_targets(), get_configured_gpu_targets(), the _configured_gpu_targets module variable, and the GPU_NAME_PATTERN regex. - Added gpu_target as an explicit parameter. is_tile_config_valid(), validate_gemm(), validate_warp_tile_combination(), validate_warp_configuration(), and validate_lds_capacity() now accept gpu_target as a required parameter instead of querying hardware internally. The corresponding changes were also made in gemm_streamk_instance_builder.py and CMakeLists.txt - Added WARP_SUPPORTED_COMBINATIONS for per-GPU warp config validation, and LDS_SIZE_MAP / DEFAULT_LDS_SIZE for GPU-aware LDS capacity checks. ## Test Plan The benchmarks were compiled and run on a GPU as well as a CPU only node to verify correctness. ## Test Result All tests passed ## Related JIRA ID : AICK-1635 ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
## Motivation The Stream-K tile engine validation utilities call rocminfo at build time to detect the GPU architecture, which prevents building on CPU-only nodes. The GPU target is already known from CMake's SUPPORTED_GPU_TARGETS, so runtime hardware detection is unnecessary during code generation. ## Technical Details The gemm_streamk_validation_utils.py file used subprocess.check_output(["rocminfo"]) to query GPU hardware at CMake configure time. This call originated from get_gpu_name_by_id() and used during tile configuration validation. On CPU-only build nodes, this fails because rocminfo either doesn't exist or returns no GPU devices. The main changes are as follows: - Removed runtime GPU detection infrastructure: deleted get_gpu_name_by_id(), set_gpu_targets(), get_configured_gpu_targets(), the _configured_gpu_targets module variable, and the GPU_NAME_PATTERN regex. - Added gpu_target as an explicit parameter. is_tile_config_valid(), validate_gemm(), validate_warp_tile_combination(), validate_warp_configuration(), and validate_lds_capacity() now accept gpu_target as a required parameter instead of querying hardware internally. The corresponding changes were also made in gemm_streamk_instance_builder.py and CMakeLists.txt - Added WARP_SUPPORTED_COMBINATIONS for per-GPU warp config validation, and LDS_SIZE_MAP / DEFAULT_LDS_SIZE for GPU-aware LDS capacity checks. ## Test Plan The benchmarks were compiled and run on a GPU as well as a CPU only node to verify correctness. ## Test Result All tests passed ## Related JIRA ID : AICK-1635 ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. --------- Co-authored-by: Maksim (Max) Podkorytov <Maksim.Podkorytov@amd.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fix(ck): Stream-K Tile Engine GPU Query Fix ## Motivation The Stream-K tile engine validation utilities call rocminfo at build time to detect the GPU architecture, which prevents building on CPU-only nodes. The GPU target is already known from CMake's SUPPORTED_GPU_TARGETS, so runtime hardware detection is unnecessary during code generation. ## Technical Details The gemm_streamk_validation_utils.py file used subprocess.check_output(["rocminfo"]) to query GPU hardware at CMake configure time. This call originated from get_gpu_name_by_id() and used during tile configuration validation. On CPU-only build nodes, this fails because rocminfo either doesn't exist or returns no GPU devices. The main changes are as follows: - Removed runtime GPU detection infrastructure: deleted get_gpu_name_by_id(), set_gpu_targets(), get_configured_gpu_targets(), the _configured_gpu_targets module variable, and the GPU_NAME_PATTERN regex. - Added gpu_target as an explicit parameter. is_tile_config_valid(), validate_gemm(), validate_warp_tile_combination(), validate_warp_configuration(), and validate_lds_capacity() now accept gpu_target as a required parameter instead of querying hardware internally. The corresponding changes were also made in gemm_streamk_instance_builder.py and CMakeLists.txt - Added WARP_SUPPORTED_COMBINATIONS for per-GPU warp config validation, and LDS_SIZE_MAP / DEFAULT_LDS_SIZE for GPU-aware LDS capacity checks. ## Test Plan The benchmarks were compiled and run on a GPU as well as a CPU only node to verify correctness. ## Test Result All tests passed ## Related JIRA ID : AICK-1635 ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. --------- Co-authored-by: Maksim (Max) Podkorytov <Maksim.Podkorytov@amd.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Motivation
The Stream-K tile engine validation utilities call rocminfo at build time to detect the GPU architecture, which prevents building on CPU-only nodes. The GPU target is already known from CMake's SUPPORTED_GPU_TARGETS, so runtime hardware detection is unnecessary during code generation.
Technical Details
The gemm_streamk_validation_utils.py file used subprocess.check_output(["rocminfo"]) to query GPU hardware at CMake configure time. This call originated from get_gpu_name_by_id() and used during tile configuration validation. On CPU-only build nodes, this fails because rocminfo either doesn't exist or returns no GPU devices. The main changes are as follows:
Test Plan
The benchmarks were compiled and run on a GPU as well as a CPU only node to verify correctness.
Test Result
All tests passed
Related
JIRA ID : AICK-1635
Submission Checklist