Skip to content

Refactor to use a device_description instead of using the hipDeviceProps struct - #5102

Open
pfultz2 wants to merge 4 commits into
developfrom
device_desc
Open

Refactor to use a device_description instead of using the hipDeviceProps struct#5102
pfultz2 wants to merge 4 commits into
developfrom
device_desc

Conversation

@pfultz2

@pfultz2 pfultz2 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Motivation

This simplifies the context constructor so that it can be more easily extended in the future.

Technical Details

Changelog Category

Add a CHANGELOG.md entry for any option other than Not Applicable

    • Added: New functionality.
    • Changed: Changes to existing functionality.
    • Removed: Functionality or support that has been removed. (Compared to a previous release)
    • Optimized: Component performance that has been optimized or improved.
    • Resolved Issues: Known issues from a previous version that have been resolved.
    • Not Applicable: This PR is not to be included in the changelog.

Follow the LLVM AI Tool Use Policy for contributions using AI.

Copilot AI review requested due to automatic review settings July 29, 2026 22:32
@pfultz2
pfultz2 requested review from a team and causten as code owners July 29, 2026 22:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the GPU cross-compilation plumbing to use a dedicated migraphx::gpu::device_description abstraction instead of synthesizing/depending on hipDeviceProp_t, simplifying gpu::context construction and making the “compile-only” device properties easier to extend.

Changes:

  • Introduces device_description with from_device() and normalize() to represent the minimal device properties needed for compilation.
  • Updates GPU context/hip_device and gpu::target to flow cross-compile parameters via device_description.
  • Updates unit tests, build sources, and cross-compilation documentation accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/gpu/jit.cpp Updates cross-compile tests to construct gpu::context from device_description and validate wavefront normalization.
src/targets/gpu/target.cpp Switches cross-compile target::get_context() to build a context from the stored device_description.
src/targets/gpu/include/migraphx/gpu/target.hpp Replaces individual cross-compile fields with a single device_description while keeping reflected field names stable.
src/targets/gpu/include/migraphx/gpu/device_description.hpp Adds the device_description API used for local-query and cross-compile scenarios.
src/targets/gpu/include/migraphx/gpu/context.hpp Refactors hip_device and context cross-compile construction to use device_description.
src/targets/gpu/device_description.cpp Implements device_description::from_device() and device_description::normalize().
src/targets/gpu/CMakeLists.txt Replaces cross_compile_device.cpp with device_description.cpp in the GPU target sources.
docs/dev/cross_compilation.rst Updates developer docs to describe the new device_description-based flow.

Comment thread src/targets/gpu/include/migraphx/gpu/context.hpp
pfultz2 and others added 2 commits July 29, 2026 17:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gh-app-migraphx-bot-pr-write

gh-app-migraphx-bot-pr-write Bot commented Jul 30, 2026

Copy link
Copy Markdown
Test Batch New Rate (8ca3b9) Old Rate (3a503c)* Diff Status
torchvision-resnet50 64 2,281.45 3,264.92 -30.12% 🔴
torchvision-resnet50_fp16 64 6,257.39 7,548.67 -17.11% 🔴
torchvision-densenet121 32 2,491.18 2,483.99 0.29%
torchvision-densenet121_fp16 32 5,040.70 5,004.24 0.73%
torchvision-inceptionv3 32 637.70 2,058.51 -69.02% 🔴
torchvision-inceptionv3_fp16 32 1,103.32 4,416.99 -75.02% 🔴
cadene-inceptionv4 16 272.27 820.61 -66.82% 🔴
cadene-resnext64x4 16 312.81 782.78 -60.04% 🔴
slim-mobilenet 64 5,160.21 8,386.36 -38.47% 🔴
slim-nasnetalarge 64 60.56 228.86 -73.54% 🔴
slim-resnet50v2 64 927.99 3,180.91 -70.83% 🔴
bert-mrpc-onnx 8 158.03 1,168.84 -86.48% 🔴
bert-mrpc-tf 1 58.07 498.63 -88.35% 🔴
pytorch-examples-wlang-gru 1 84.80 473.35 -82.09% 🔴
pytorch-examples-wlang-lstm 1 68.30 384.83 -82.25% 🔴
torchvision-resnet50_1 1 1,062.42 1,046.63 1.51%
cadene-dpn92_1 1 156.05 437.32 -64.32% 🔴
cadene-resnext101_1 1 294.91 365.89 -19.40% 🔴
onnx-taau-downsample 1 845.49 844.09 0.17%
dlrm-criteoterabyte 1 22.70 32.42 -29.97% 🔴
dlrm-criteoterabyte_fp16 1 44.37 51.80 -14.36% 🔴
agentmodel 1 9,849.79 9,209.12 6.96% 🔆
unet_fp16 2 43.55 58.80 -25.93% 🔴
resnet50v1_fp16 1 1,389.41 1,366.11 1.70%
resnet50v1_int8 1 1,927.37 1,883.96 2.30%
bert_base_cased_fp16 64 755.46 1,098.16 -31.21% 🔴
bert_large_uncased_fp16 32 202.83 345.59 -41.31% 🔴
bert_large_fp16 1 36.65 206.59 -82.26% 🔴
distilgpt2_fp16 16 2,085.44 2,092.89 -0.36%
yolov5s 1 108.98 558.33 -80.48% 🔴
tinyllama 1 19.14 45.83 -58.24% 🔴
vicuna-fastchat 1 21.30 44.20 -51.81% 🔴
whisper-tiny-encoder 1 173.48 411.87 -57.88% 🔴
whisper-tiny-decoder 1 210.84 408.48 -48.39% 🔴
llama2_7b 1 20.86 20.84 0.11%
qwen1.5-7b 1 6.05 23.58 -74.36% 🔴
phi3-3.8b 1 14.58 26.72 -45.43% 🔴
llama3-8b 1 13.82 21.80 -36.60% 🔴
whisper-large-encoder 1 7.42 10.18 -27.12% 🔴
whisper-large-decoder 1 13.70 105.30 -86.99% 🔴
mistral-7b 1 23.76 23.78 -0.06%
FLUX.1-schnell 1 746.89 755.22 -1.10%

Regressions detected 🔴

* No develop baseline was found for this PR's branch point; compared against the latest available develop run instead.

@gh-app-migraphx-bot-pr-write

gh-app-migraphx-bot-pr-write Bot commented Jul 30, 2026

Copy link
Copy Markdown
Test Status Result
bert-mrpc-onnx PASSED: MIGraphX meets tolerance
bert-mrpc-tf PASSED: MIGraphX meets tolerance
pytorch-examples-wlang-gru PASSED: MIGraphX meets tolerance
pytorch-examples-wlang-lstm PASSED: MIGraphX meets tolerance
dlrm-criteoterabyte PASSED: MIGraphX meets tolerance
agentmodel PASSED: MIGraphX meets tolerance
unet PASSED: MIGraphX meets tolerance
resnet50v1 PASSED: MIGraphX meets tolerance
bert_base_cased_fp16 PASSED: MIGraphX meets tolerance
bert_large_uncased_fp16 🔴 FAILED: MIGraphX is not within tolerance - check verbose output
bert_large PASSED: MIGraphX meets tolerance
yolov5s PASSED: MIGraphX meets tolerance
tinyllama PASSED: MIGraphX meets tolerance
vicuna-fastchat PASSED: MIGraphX meets tolerance
whisper-tiny-encoder PASSED: MIGraphX meets tolerance
whisper-tiny-decoder PASSED: MIGraphX meets tolerance
distilgpt2_fp16 🔴 FAILED: MIGraphX is not within tolerance - check verbose output
llama2_7b PASSED: MIGraphX meets tolerance
qwen1.5-7b PASSED: MIGraphX meets tolerance
phi3-3.8b PASSED: MIGraphX meets tolerance
llama3-8b PASSED: MIGraphX meets tolerance
whisper-large-encoder PASSED: MIGraphX meets tolerance
whisper-large-decoder PASSED: MIGraphX meets tolerance
mistral-7b PASSED: MIGraphX meets tolerance
FLUX.1-schnell PASSED: MIGraphX meets tolerance

@pfultz2
pfultz2 requested a review from kahmed10 July 31, 2026 16:41
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.

3 participants