fix(promote-strided): include hip.npi_* ops in strided-input promotion - #625
Draft
kirankumarmatam-amd wants to merge 2 commits into
Draft
fix(promote-strided): include hip.npi_* ops in strided-input promotion#625kirankumarmatam-amd wants to merge 2 commits into
kirankumarmatam-amd wants to merge 2 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
|
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 |
L2 Accuracy Results (EP vs CPU)
Threshold: 0.01 | Run: 3535 - Commit: |
MorphiZen EP Performance Results
EPContext Export Performance
EPContext Import Performance
OGA Benchmark Results
OGA Wheel Smoke (Python benchmark_e2e.py)
Run: 3535 - Commit: |
Collapse the duplicate comment block into a single coherent explanation and restore the blank line between the copy-materialization loop and the dealloc-emission comment that was inadvertently removed. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem
PromoteStridedHipOperandsfiltered ops usingop->getDialect() == HipDialect.NPI plugin ops (
hip.npi_quantize,hip.npi_dequantize, etc.) are registeredin
NpiDialect— a separate dialect object — even though their op names startwith
hip.and they use the same contiguous-pointer kernel ABI. The dialectcheck therefore excluded them, so strided
memref.subviewinputs (e.g. Q/K/Vslices produced by
onnx.Split) were passed directly to NPI kernels that readthem as flat contiguous arrays, producing silently wrong values. On Qwen 7B VLM
(gfx1151) this caused cosine similarity to drop from ~1.0 to ~0.36.
Fix
Replace the dialect-object check with an op-name prefix check
(
fullOpName.starts_with("hip.")), which covers bothHipDialectops andhip.npi_*ops regardless of which dialect object owns them.Testing
Verified on gfx1151 (Strix Halo, Windows D3D12 HMM): cosine similarity for
Qwen 7B VLM restored to ~1.0 after this fix.