Add toggle for wavefront size to cross compilation options - #5065
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an explicit wavefront-size override to MIGraphX GPU cross-compilation configuration, enabling users to force wave32/wave64 behavior during cross-compilation rather than relying only on architecture-based inference.
Changes:
- Plumbed a new
gpu_wavefront_sizetarget option through GPU cross-compile context creation and synthetichipDeviceProp_tgeneration. - Added
--gpu-wavefront-sizeandwavefront_sizesupport in--gpu-arch-paramsformigraphx-driver. - Updated tests, developer documentation, and changelog to cover the new option.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/targets/gpu/include/migraphx/gpu/target.hpp |
Adds gpu_wavefront_size to the GPU target’s reflected/serialized options. |
src/targets/gpu/target.cpp |
Passes gpu_wavefront_size into cross-compile context creation. |
src/targets/gpu/include/migraphx/gpu/context.hpp |
Extends cross-compile hip_device/context constructors to accept a wavefront-size override. |
src/targets/gpu/include/migraphx/gpu/cross_compile_device.hpp |
Extends the cross-compile device-props API with a wavefront_size parameter. |
src/targets/gpu/cross_compile_device.cpp |
Validates and applies the wavefront-size override when populating synthetic HIP device properties. |
src/driver/main.cpp |
Adds --gpu-wavefront-size and JSON key mapping to pass wavefront size into GPU cross-compilation options. |
test/gpu/jit.cpp |
Adds coverage for default vs overridden wavefront size in cross-compile device props. |
test/gpu/target_serialize.cpp |
Adds serialization round-trip coverage for gpu_wavefront_size. |
docs/dev/cross_compilation.rst |
Documents wavefront-size inference and explicit override mechanisms for cross-compilation. |
CHANGELOG.md |
Adds an entry describing the new cross-compile wavefront size configuration. |
kahmed10
reviewed
Jul 15, 2026
Regressions detected 🔴 |
|
pfultz2
approved these changes
Jul 15, 2026
kahmed10
approved these changes
Jul 15, 2026
bdevorem
force-pushed
the
bdevorem/wavefront_size_cross_compilation
branch
from
July 15, 2026 21:32
4d62f6f to
31a4cde
Compare
ikalinic
approved these changes
Jul 16, 2026
bdevorem
force-pushed
the
bdevorem/wavefront_size_cross_compilation
branch
from
July 16, 2026 16:10
31a4cde to
d85196b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5065 +/- ##
===========================================
+ Coverage 92.89% 92.90% +0.01%
===========================================
Files 603 603
Lines 32448 32526 +78
===========================================
+ Hits 30140 30217 +77
- Misses 2308 2309 +1 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
For cross compiling, we want to be able to toggle the wavefront size for architectures instead of just letting the decision be made strictly on whether or not the arch is
gfx11orgfx12.Technical Details
This PR adds wavefront size as a toggle, which can be directly set via JSON object with the driver
--gpu-arch-paramsoption, or directly with a CLI flag--gpu-wavefront-size, or the various language APIs:--gpu-arch-paramsJSON (primary, matches other toggles)Same as
--gpu-num-cusstyle.--gpu-arch-paramsoverrides this if both are set (same precedence pattern as the other params).Works automatically via
reflect()ongpu::targetList was generated by cursor.
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot ApplicableFollow the LLVM AI Tool Use Policy for contributions using AI.