Spaces:
No application file
No application file
<!--Copyright 2023 The HuggingFace Team. 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. | |
--> | |
# xFormers ์ค์นํ๊ธฐ | |
์ถ๋ก ๊ณผ ํ์ต ๋ชจ๋์ [xFormers](https://github.com/facebookresearch/xformers)๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด ์ข์ต๋๋ค. | |
์์ฒด ํ ์คํธ๋ก ์ดํ ์ ๋ธ๋ก์์ ์ํ๋ ์ต์ ํ๊ฐ ๋ ๋น ๋ฅธ ์๋์ ์ ์ ๋ฉ๋ชจ๋ฆฌ ์๋น๋ฅผ ํ์ธํ์ต๋๋ค. | |
2023๋ 1์์ ์ถ์๋ xFormers ๋ฒ์ '0.0.16'๋ถํฐ ์ฌ์ ๋น๋๋ pip wheel์ ์ฌ์ฉํ์ฌ ์ฝ๊ฒ ์ค์นํ ์ ์์ต๋๋ค: | |
```bash | |
pip install xformers | |
``` | |
<Tip> | |
xFormers PIP ํจํค์ง์๋ ์ต์ ๋ฒ์ ์ PyTorch(xFormers 0.0.16์ 1.13.1)๊ฐ ํ์ํฉ๋๋ค. ์ด์ ๋ฒ์ ์ PyTorch๋ฅผ ์ฌ์ฉํด์ผ ํ๋ ๊ฒฝ์ฐ [ํ๋ก์ ํธ ์ง์นจ](https://github.com/facebookresearch/xformers#installing-xformers)์ ์์ค๋ฅผ ์ฌ์ฉํด xFormers๋ฅผ ์ค์นํ๋ ๊ฒ์ด ์ข์ต๋๋ค. | |
</Tip> | |
xFormers๋ฅผ ์ค์นํ๋ฉด, [์ฌ๊ธฐ](fp16#memory-efficient-attention)์ ์ค๋ช ํ ๊ฒ์ฒ๋ผ 'enable_xformers_memory_efficient_attention()'์ ์ฌ์ฉํ์ฌ ์ถ๋ก ์๋๋ฅผ ๋์ด๊ณ ๋ฉ๋ชจ๋ฆฌ ์๋น๋ฅผ ์ค์ผ ์ ์์ต๋๋ค. | |
<Tip warning={true}> | |
[์ด ์ด์](https://github.com/huggingface/diffusers/issues/2234#issuecomment-1416931212)์ ๋ฐ๋ฅด๋ฉด xFormers `v0.0.16`์์ GPU๋ฅผ ์ฌ์ฉํ ํ์ต(ํ์ธ ํ๋ ๋๋ Dreambooth)์ ํ ์ ์์ต๋๋ค. ํด๋น ๋ฌธ์ ๊ฐ ๋ฐ๊ฒฌ๋๋ฉด. ํด๋น ์ฝ๋ฉํธ๋ฅผ ์ฐธ๊ณ ํด development ๋ฒ์ ์ ์ค์นํ์ธ์. | |
</Tip> | |