File size: 1,708 Bytes
ef4d689
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!--Copyright 2024 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.
-->

# κ°œμš”

λ…Έμ΄μ¦ˆκ°€ λ§Žμ€ 좜λ ₯μ—μ„œ 적은 좜λ ₯으둜 λ§Œλ“œλŠ” κ³Όμ •μœΌλ‘œ κ³ ν’ˆμ§ˆ 생성 λͺ¨λΈμ˜ 좜λ ₯을 λ§Œλ“œλŠ” 각각의 λ°˜λ³΅λ˜λŠ” μŠ€ν…μ€ λ§Žμ€ 계산이 ν•„μš”ν•©λ‹ˆλ‹€. 🧨 Diffuser의 λͺ©ν‘œ 쀑 ν•˜λ‚˜λŠ” λͺ¨λ“  μ‚¬λžŒμ΄ 이 κΈ°μˆ μ„ 널리 μ΄μš©ν•  수 μžˆλ„λ‘ ν•˜λŠ” 것이며, μ—¬κΈ°μ—λŠ” μ†ŒλΉ„μž 및 특수 ν•˜λ“œμ›¨μ–΄μ—μ„œ λΉ λ₯Έ 좔둠을 κ°€λŠ₯ν•˜κ²Œ ν•˜λŠ” 것을 ν¬ν•¨ν•©λ‹ˆλ‹€. 

이 μ„Ήμ…˜μ—μ„œλŠ” μΆ”λ‘  속도λ₯Ό μ΅œμ ν™”ν•˜κ³  λ©”λͺ¨λ¦¬ μ†ŒλΉ„λ₯Ό 쀄이기 μœ„ν•œ λ°˜μ •λ°€(half-precision) κ°€μ€‘μΉ˜ 및 sliced attentionκ³Ό 같은 팁과 μš”λ Ήμ„ λ‹€λ£Ήλ‹ˆλ‹€. λ˜ν•œ [`torch.compile`](https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html) λ˜λŠ” [ONNX Runtime](https://onnxruntime.ai/docs/)을 μ‚¬μš©ν•˜μ—¬ PyTorch μ½”λ“œμ˜ 속도λ₯Ό 높이고, [xFormers](https://facebookresearch.github.io/xformers/)λ₯Ό μ‚¬μš©ν•˜μ—¬ memory-efficient attention을 ν™œμ„±ν™”ν•˜λŠ” 방법을 배울 수 μžˆμŠ΅λ‹ˆλ‹€. Apple Silicon, Intel λ˜λŠ” Habana ν”„λ‘œμ„Έμ„œμ™€ 같은 νŠΉμ • ν•˜λ“œμ›¨μ–΄μ—μ„œ 좔둠을 μ‹€ν–‰ν•˜κΈ° μœ„ν•œ κ°€μ΄λ“œλ„ μžˆμŠ΅λ‹ˆλ‹€.