Google Colab
Install
!pip install uv
!uv pip install transformers
Run
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("bert-base-uncased")
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)
print(outputs.last_hidden_state.shape)
GPU models
TPU models
GPU์ TPU ๋น๊ตํ
| ํน์ฑ | GPU | TPU | 
| ์๋ ์ฉ๋ | ๊ฒ์ ๊ทธ๋ํฝ ์ฒ๋ฆฌ | ์ธ๊ณต์ง๋ฅ ์ฐ์ฐ ์ ์ฉ | 
| ๋ง๋  ํ์ฌ | NVIDIA, AMD ๋ฑ | Google | 
| ํน์ง | ๋ค์ํ ์์
 ๊ฐ๋ฅ | AI ์์
 ์ ์ฉ | 
| ๊ฐ๊ฒฉ | ์ค๊ฐ~๋น์ | ๋น์ (ํด๋ผ์ฐ๋๋ก ๋์ฌ) | 
| ์๋ | ๋น ๋ฆ | AI ์์
์์ ๋งค์ฐ ๋น ๋ฆ | 
| ์ ๋ ฅ ํจ์จ | ๋ณดํต | ๋งค์ฐ ์ข์ | 
| ์ฌ์ฉ ๋์ด๋ | ๋น๊ต์  ์ฌ์ | ์ฝ๊ฐ ์ด๋ ค์ | 
| ์ฌ์ฉ ์ฅ์ | ๊ฐ์ธ ์ปดํจํฐ, ํด๋ผ์ฐ๋ | ์ฃผ๋ก Google ํด๋ผ์ฐ๋ | 
| LLM ํ์ต | ๊ฐ๋ฅํ์ง๋ง ๋๋ฆผ | ๋น ๋ฅด๊ณ  ํจ์จ์  | 
| ์ฌ์ฉ ์์ | ๊ฒ์, ์์ํธ์ง, AI ํ์ต | ๋๊ท๋ชจ AI ๋ชจ๋ธ ํ์ต | 
๋น์ ๋ก ์ดํดํ๊ธฐ
- GPU: ์ฌ๋ฌ ๊ณผ๋ชฉ์ ๊ฐ๋ฅด์น  ์ ์๋ ๋ค์ฌ๋ค๋ฅํ ์ ์๋
- TPU: ์ํ๋ง ๊ฐ๋ฅด์น์ง๋ง ์ต๊ณ ์ ์ํ ๊ฐ์ฌ