Fix sliding window alignment regression in QNN models#1938
Merged
Conversation
baijumeswani
reviewed
Jan 7, 2026
baijumeswani
approved these changes
Jan 8, 2026
kunal-vaishnavi
approved these changes
Jan 8, 2026
baijumeswani
pushed a commit
that referenced
this pull request
Jan 15, 2026
## Summary Fixes gibberish output in QNN models with sliding window attention (e.g., DeepSeek) by reverting to v0.11.2 padding behavior while maintaining FARA model compatibility. Problem The v0.11.3 refactor (commit 542fb69) attempted to fix alignment semantics in [AllocateInputIdsOnDevice()](vscode-file://vscode-app/c:/Users/asonawane/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/workbench/workbench.html) but inadvertently broke existing QNN models: Before v0.11.3: ``` Used std::copy_backward() which produced inverted alignment semantics alignment="left" → RIGHT-aligned output (data first, padding last) alignment="right" → LEFT-aligned output (padding first, data last) ``` v0.11.3 changes: ``` Replaced std::copy_backward() with conditional logic to "correct" semantics Made alignment config match actual output behavior Broke existing QNN models (e.g., DeepSeek) that relied on inverted behavior ``` Always produce RIGHT-aligned output (data first, padding last) regardless of the alignment config value.
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.
Revert back the alignment logic to the original way it was in 0.11.2 since it works for all the models.
For FARA model we will update the genai_config alignment value to "left"