fix(use-output-allocator): report graph-output rank for reshaped-view outputs - #557
Draft
anilmartha wants to merge 3 commits into
Draft
fix(use-output-allocator): report graph-output rank for reshaped-view outputs#557anilmartha wants to merge 3 commits into
anilmartha wants to merge 3 commits into
Conversation
… outputs (fixes DETR Invalid rank for output: logits)
|
Thanks for opening a PR! This project follows LLVM's incremental-development and AI-tool-use Before requesting review, please check that:
Reviewers are assigned through |
Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
|
#533 is fixing on it. cc @amd-genmingz |
Co-authored-by: Cursor <cursoragent@cursor.com>
L2 Accuracy Results (EP vs CPU)
Threshold: 0.01 | Run: 3271 - Commit: |
MorphiZen EP Performance Results
EPContext Export Performance
EPContext Import Performance
OGA Benchmark Results
OGA Wheel Smoke (Python benchmark_e2e.py)
Run: 3271 - Commit: |
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.
Summary
UseOutputAllocatorrewrote a graph-outputmemref.allocintohip.alloc_outputusing the producer alloc's type. When the returned value is a reshaping view of that alloc (e.g. a rank-2 Gemm resultexpand_shape'd to rank-3 with no trailing op — DETR'sclass_labels_classifierlogitshead), the EP registered the alloc's rank with ORT instead of the declared graph-output rank, so ORT rejected the output:Outputs with a trailing op (e.g.
pred_boxes'sigmoid, whose alloc is already at the output rank) were unaffected — which is why onlylogitsfailed.Fix
hip.alloc_outputat thefunc.returnoperand type (the graph-output shape).cast/expand_shape/collapse_shape, static output) so the producer keeps writing into the same EP-owned buffer viewed as its original type — no extra copy.subviewor dynamic-shaped outputs fall back to the legacy behavior, so no existing case regresses.Applies to both the
LLVM_IRandNATIVEartifact paths.Test plan
facebook/detr-resnet-50(fp16):logitsnow returns{1,100,92};onnxruntime_perf_testruns clean.