Skip to content

Replace .norm() with decomposed version for CLIP executorch export#32887

Merged
qubvel merged 2 commits intohuggingface:mainfrom
qubvel:executorch-clip-decompose-norm
Aug 20, 2024
Merged

Replace .norm() with decomposed version for CLIP executorch export#32887
qubvel merged 2 commits intohuggingface:mainfrom
qubvel:executorch-clip-decompose-norm

Conversation

@qubvel
Copy link
Copy Markdown
Contributor

@qubvel qubvel commented Aug 19, 2024

What does this PR do?

At the moment export of the CLIP model fails with torch._export.verifier.SpecViolationError: Operator torch._ops.aten.linalg_vector_norm.default is not Aten Canonical error.

This PR replaces .norm() operation with a decomposed version to make the CLIPModel model executorch exportable.

Related export error issue:

Related issue:

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Copy Markdown
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! We should just have a quick run on the slow tests in case this results in some small numerical differences

@qubvel qubvel merged commit 078d5a8 into huggingface:main Aug 20, 2024
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
…xport (huggingface#32887)

* Replace .norm() with decomposed version for executorch export

* [run_slow] clip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants