Skip to content

Fix sliding window alignment regression in QNN models#1938

Merged
apsonawane merged 2 commits into
mainfrom
asonawane/fix
Jan 8, 2026
Merged

Fix sliding window alignment regression in QNN models#1938
apsonawane merged 2 commits into
mainfrom
asonawane/fix

Conversation

@apsonawane
Copy link
Copy Markdown
Contributor

@apsonawane apsonawane commented Jan 7, 2026

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"

@apsonawane apsonawane enabled auto-merge (squash) January 7, 2026 04:50
Comment thread src/generators.cpp Outdated
@apsonawane apsonawane merged commit 81a7aca into main Jan 8, 2026
15 of 16 checks passed
@apsonawane apsonawane deleted the asonawane/fix branch January 8, 2026 03:08
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.
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