Skip to content

Guard XNNPACK reinplace against accumulating index_put - #1

Open
JakeStevens wants to merge 1 commit into
perf/enable-xnnpack-reinplace-whisperfrom
fix/guard-xnnpack-reinplace-accumulate
Open

JakeStevens wants to merge 1 commit into
perf/enable-xnnpack-reinplace-whisperfrom
fix/guard-xnnpack-reinplace-accumulate

Conversation

@JakeStevens

Copy link
Copy Markdown
Owner

Stacked follow-up to huggingface#254. This targets the feature branch so huggingface#254 stays unchanged until reviewed.

The stable mobilevit2 failure on huggingface#254 is caused by three index_put calls with accumulate=True. With re-inplace enabled they become index_put_, but the portable in-place kernel rejects accumulation and returns 0x12. This change keeps re-inplace enabled for supported graphs such as Whisper Tiny and disables it for an export containing unsupported accumulating index_put calls. Because the backend config covers all methods in an export, the guard conservatively skips the pass for that whole export.

Verified off/on mobilevit2 PTEs differed by three index_put -> index_put_ rewrites before the guard; the guarded PTE is byte-identical to the working off export. The mobilevit2 and Whisper Tiny integration tests passed with the guard; five focused guard tests, Black and Ruff pass.

The independent nightly-install fix is huggingface#255 (41 nightly CI jobs passed). Once this guard is reviewed, merge this stacked PR into the huggingface#254 branch and merge huggingface#255 into main so huggingface#254 can rerun with both fixes.

Authored with assistance from Codex (OpenAI AI assistant).

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.

1 participant