Repository navigation
Guard XNNPACK reinplace against accumulating index_put - #1
Open
JakeStevens wants to merge 1 commit into
Open
JakeStevens wants to merge 1 commit into
JakeStevens wants to merge 1 commit into
Conversation
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.
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).