๐ค Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
|
|
<!--Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
|
All rights reserved.
|
||
|
|
|
||
|
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
|
||
|
|
the License. You may obtain a copy of the License at
|
||
|
|
|
||
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
|
|
||
|
|
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
|
||
|
|
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||
|
|
specific language governing permissions and limitations under the License.
|
||
|
|
|
||
|
|
โ ๏ธ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
|
||
|
|
rendered properly in your Markdown viewer.
|
||
|
|
|
||
|
|
-->
|
||
|
|
|
||
|
|
|
||
|
|
# ExecuTorch [[executorch]]
|
||
|
|
|
||
|
|
[`ExecuTorch`](https://github.com/pytorch/executorch) ๋ ์จ์ด๋ฌ๋ธ, ์๋ฒ ๋๋ ์ฅ์น, ๋ง์ดํฌ๋ก์ปจํธ๋กค๋ฌ๋ฅผ ํฌํจํ ๋ชจ๋ฐ์ผ ๋ฐ ์ฃ์ง ์ฅ์น์์ ์จ๋๋ฐ์ด์ค ์ถ๋ก ๊ธฐ๋ฅ์ ๊ฐ๋ฅํ๊ฒ ํ๋ ์ข
ํฉ ์๋ฃจ์
์
๋๋ค. PyTorch ์ํ๊ณ์ ์ํด์์ผ๋ฉฐ, ์ด์์ฑ, ์์ฐ์ฑ, ์ฑ๋ฅ์ ์ค์ ์ ๋ PyTorch ๋ชจ๋ธ ๋ฐฐํฌ๋ฅผ ์ง์ํฉ๋๋ค.
|
||
|
|
|
||
|
|
ExecuTorch๋ ๋ฐฑ์๋ ์์, ์ฌ์ฉ์ ์ ์ ์ปดํ์ผ๋ฌ ๋ณํ, ๋ฉ๋ชจ๋ฆฌ ๊ณํ ๋ฑ ๋ชจ๋ธ, ์ฅ์น ๋๋ ํน์ ์ ์ฆ์ผ์ด์ค ๋ง์ถค ์ต์ ํ๋ฅผ ์ํํ ์ ์๋ ์ง์
์ ์ ๋ช
ํํ๊ฒ ์ ์ํฉ๋๋ค. ExecuTorch๋ฅผ ์ฌ์ฉํด ์ฃ์ง ์ฅ์น์์ PyTorch ๋ชจ๋ธ์ ์คํํ๋ ์ฒซ ๋ฒ์งธ ๋จ๊ณ๋ ๋ชจ๋ธ์ ์ต์คํฌํธํ๋ ๊ฒ์
๋๋ค. ์ด ์์
์ PyTorch API์ธ [`torch.export`](https://pytorch.org/docs/stable/export.html)๋ฅผ ์ฌ์ฉํ์ฌ ์ํํฉ๋๋ค.
|
||
|
|
|
||
|
|
|
||
|
|
## ExecuTorch ํตํฉ [[transformers.TorchExportableModuleWithStaticCache]]
|
||
|
|
|
||
|
|
`torch.export`๋ฅผ ์ฌ์ฉํ์ฌ ๐ค Transformers๋ฅผ ์ต์คํฌํธ ํ ์ ์๋๋ก ํตํฉ ์ง์ ์ด ๊ฐ๋ฐ๋๊ณ ์์ต๋๋ค. ์ด ํตํฉ์ ๋ชฉํ๋ ์ต์คํฌํธ๋ฟ๋ง ์๋๋ผ, ์ต์คํฌํธํ ์ํฐํฉํธ๊ฐ `ExecuTorch`์์ ํจ์จ์ ์ผ๋ก ์คํ๋ ์ ์๋๋ก ๋ ์ถ์ํ๊ณ ์ต์ ํํ๋ ๊ฒ์
๋๋ค. ํนํ ๋ชจ๋ฐ์ผ ๋ฐ ์ฃ์ง ์ ์ฆ์ผ์ด์ค์ ์ค์ ์ ๋๊ณ ์์ต๋๋ค.
|
||
|
|
|
||
|
|
[[autodoc]] integrations.executorch.TorchExportableModuleWithStaticCache
|
||
|
|
- forward
|
||
|
|
|
||
|
|
[[autodoc]] integrations.executorch.convert_and_export_with_cache
|