Add MLSS heuristics for gfx1150/gffx1151 archutectures - #83
Draft
urpetkov-amd wants to merge 1 commit into
Draft
Conversation
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.
Add graph-based AMDMLSS auto-selection for Strix Halo
Summary
This change adds conservative, model-name-independent AMDMLSS auto-selection to
the MIGraphX execution provider.
The policy inspects the ONNX graph immediately before MIGraphX compilation and
decides whether convolution operations should be forced through AMDMLSS.
The final behavior is:
gfx1200andgfx1201: preserve the existing behavior and automaticallyrequest AMDMLSS for convolution graphs.
gfx1150andgfx1151: use graph features to decide whether to requestAMDMLSS for convolutions.
mlss_use_specific_opsconfiguration: remains authoritative andbypasses the automatic decision.
Motivation
AMDMLSS can improve convolution performance on Strix Halo, but forcing it for
every model also causes significant regressions.
The objective was to enable useful AMDMLSS coverage while ensuring that all
measured red models remain outside the automatic enable region.
Feature extraction
The offline analysis considered graph features that can also be reproduced
from the
ModelProtoavailable in the execution provider:Weights represented as graph initializers and weights produced by ONNX
Constantnodes are both recognized.The analysis also builds a structural group signature from operator counts,
convolution structure, and tensor types.
StratifiedGroupKFoldkeepsstructurally equivalent model variants in the same fold and reduces leakage
between related input-size or precision variants.
Policy derivation
For
gfx1150andgfx1151, convolution is forced through AMDMLSS only when:19/60(approximately 31.7%) ofall recognized convolutions.
Architecture behavior
gfx1200andgfx1201The existing automatic behavior is preserved. A graph containing a recognized
convolution receives an effective MLSS operation list of
"conv".gfx1150andgfx1151The conservative graph policy described above is applied.
Other architectures
The automatic policy returns false and leaves MIGraphX backend selection
unchanged.
Explicit override
When a user sets:
the explicit value wins on every architecture and for every graph partition.
MIGraphX still retains responsibility for handling unsupported convolution
configurations.
MXR cache correctness
The ONNX graph itself does not change when AMDMLSS is enabled, so graph and
architecture hashes alone cannot distinguish an MXR compiled with
"conv"from one compiled with the default empty operation list.
The MXR prefix now includes a hash of the final per-graph
effective_mlss_use_specific_opsvalue:conv: hash of"conv"."".This effective prefix is used consistently for:
The cache key represents the effective compilation behavior rather than the
source of the decision. An automatic
"conv"decision and an explicit"conv"decision can therefore safely share the same compiled artifact.