Skip to content

Conversation

@ecamartins
Copy link
Collaborator

@ecamartins ecamartins commented Jan 27, 2026

Proposed changes

Currently, Stream-K's unit tests are manual gtests. That said, these tests are difficult to scale due to needing to manually create testing types and individual cpp files for each testing variant. Instead, we are moving to tile engine tests to help us scale up our unit testing. PR #3514 laid out the initial Stream-K tile engine test setup. The main purpose of this PR is to add the configs necessary to replicate our smoke tests. Future work will extend our smoke tests to test more instances, tile sizes, etc.

Since our smoke test m, n, and k sizes often rely on the number of compute units (CUs) on a device, static config files are not feasible. Hence, this PR opts to generate various config files at configuration time; these configs are stored in the build directory and are then used by the existing tile engine infrastructure to generate our tests.

The main changes this PR makes are as follows:

  • Generate config files at configuration time (storing them in the build directory) such that the instances in the config files match the existing Stream-K smoke tests
  • Removal of redundant stream-k smoke tests in test/ck_tile/gemm_streamk
  • Update the stream-k tile engine test's reference GEMM to be computed on the device to help reduce test verification time on CI
  • Update Stream-K's tile engine interface such that num_wgs_per_tile is propagated out and can be used to calculate the relative and absolute tolerance instead of split-k. Split-k is not a correct metric as for Stream-K split-k is always 1 even if there are >1 WGs per tile.

Note:

  • Padding is not yet supported in Stream-K tile engine, so the generated configs have all padding set to false. But, a future PR will add support for padding in tile engine for Stream-K.

Checklist

Please put an x into the boxes that apply. You can also fill these out after creating the PR. If you're not sure, please don't hesitate to ask.

  • I have added tests relevant to the introduced functionality, and the unit tests are passing locally
  • I have added the test to REGRESSION_TESTS list defined at the top of CMakeLists.txt in tests/CMakeLists.txt, IF the test takes more than 30 seconds to run.
  • I have added inline documentation which enables the maintainers with understanding the motivation
  • I have removed the stale documentation which is no longer relevant after this pull request
  • (If this change is user-facing) I have added release notes which provide the end users with a brief summary of the improvement from this pull request
  • I have run clang-format on all changed files
  • Any dependent changes have been merged

This change converts the stream-k smoke tests to use tile engine. Since
the m, n, and k values dependent on the CU count of a device, the
configs are generated during the Configuration Phase.
Removing redundant tests that are now run via tile engine.
This change updates the Stream-K tile engine interface to ensure that
num_wgs_per_tile is propaged and passed into the compare_results
function to calculate the rel and abs tolerance. Before, split-k was
used, which is incorrect for Stream-K since the split-k value is
always 1.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds generation of Stream-K Tile Engine test configuration files during CMake configure-time so Stream-K “smoke test” coverage can scale (and depend on device CU count) without manually maintained gtests.

Changes:

  • Generate Stream-K Tile Engine JSON configs at configure time (in the build directory) using a CU-count query helper.
  • Update Stream-K Tile Engine kernel interface to return (time, num_wgs_per_tile) and use num_wgs_per_tile for verification tolerances.
  • Remove redundant legacy Stream-K smoke gtests/configs and update the Tile Engine Stream-K test to use GPU reference GEMM.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tile_engine/ops/gemm_streamk/gemm_streamk_profiler.hpp Propagates num_wgs_per_tile into verification path.
tile_engine/ops/gemm_streamk/gemm_streamk_instance_builder.py Makes generated kernels return (time, num_wgs_per_tile) from launch().
test/ck_tile/gemm_streamk_tile_engine/test_gemm_streamk_simple.cpp Uses GPU reference GEMM and uses num_wgs_per_tile for tolerance.
test/ck_tile/gemm_streamk_tile_engine/generate_configs.py New Python generator for CU-dependent Stream-K configs.
test/ck_tile/gemm_streamk_tile_engine/generate_configs.cmake New CMake helpers to query CU count + generate configs at configure time.
test/ck_tile/gemm_streamk_tile_engine/cu_count.cpp HIP helper executable to query CU count.
test/ck_tile/gemm_streamk_tile_engine/configs/simple_test_config.json Removes static config (replaced by generated configs).
test/ck_tile/gemm_streamk_tile_engine/README.md Documents new config generation flow and CU_COUNT usage.
test/ck_tile/gemm_streamk_tile_engine/CMakeLists.txt Integrates configure-time generation + expands smoke test datatype coverage.
test/ck_tile/gemm_streamk/test_gemm_streamk_types.hpp Removes unused reduction type list.
test/ck_tile/gemm_streamk/test_gemm_streamk_smoke_cases.inc Removes legacy smoke case definitions.
test/ck_tile/gemm_streamk/test_gemm_streamk_reduction_cases.inc Removes legacy reduction case definitions.
test/ck_tile/gemm_streamk/smoke_tests/* Removes redundant legacy smoke test translation units.
test/ck_tile/gemm_streamk/CMakeLists.txt Stops building removed legacy smoke/reduction test executables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This commit makes the following changes:
- Uses Typing module for nested type hints
- Uses quotes around cu_count_arg argument in generate_configs.cmake in
  if statements
- Adds explicit include for tuple in test_gemm_streamk_simple.cpp
- Adds a type for the tiles argument in argparser to check argument
  validity
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