Ver3.0 ๐ GPU ์ปจํ ์ด๋๋ก AI ํ์ตํ๊ฒฝ ๊ตฌ์ถํ๊ธฐ: ์ด๋ณด์๋ ๋ฐ๋ผํ ์ ์๋ ์๋ฒฝ ๊ฐ์ด๋

๐ GPU ์ปจํ ์ด๋๋ก AI ํ์ตํ๊ฒฝ ๊ตฌ์ถํ๊ธฐ: ์ด๋ณด์๋ ๋ฐ๋ผํ ์ ์๋ ์๋ฒฝ ๊ฐ์ด๋
Docker์ Kubernetes๋ก ๋ง๋๋ ๋๋ง์ AI ์ฐ๊ตฌ์ค ๐ฏ
๐ฌ ์์ํ๊ธฐ ์ ์: ์ GPU ์ปจํ ์ด๋๊ฐ ํ์ํ ๊น?
์๋ , ์น๊ตฌ! ๐ ์ค๋์ AI ๊ฐ๋ฐ์๋ผ๋ฉด ๋๊ตฌ๋ ํ ๋ฒ์ฏค ๊ณ ๋ฏผํ๊ฒ ๋๋ GPU ์ปจํ ์ด๋ ํ๊ฒฝ ๊ตฌ์ถ์ ๋ํด ์ด์ผ๊ธฐํด๋ณด๋ ค๊ณ ํด. ์์ฆ ChatGPT, Stable Diffusion ๊ฐ์ AI ๋ชจ๋ธ๋ค์ด ๋์ธ์์? ์ด๋ฐ ๋ชจ๋ธ๋ค์ ํ์ต์ํค๊ฑฐ๋ ํ์ธํ๋ํ๋ ค๋ฉด ์์ฒญ๋ ์ปดํจํ ํ์๊ฐ ํ์ํ๋ฐ, ๋ฐ๋ก ์ฌ๊ธฐ์ GPU๊ฐ ๋ฑ์ฅํ์ง! ๐ฎ
๊ทผ๋ฐ ๋ฌธ์ ๊ฐ ๋ญ๋๋ฉด, GPU ํ๊ฒฝ ์ค์ ์ด ์ง์ง ๊ณจ์น ์ํ๋ค๋ ๊ฑฐ์ผ. CUDA ๋ฒ์ ๋ง์ถ๊ณ , cuDNN ์ค์นํ๊ณ , PyTorch๋ TensorFlow ๋ฒ์ ํธํ์ฑ ์ฒดํฌํ๊ณ ... ํ ๋ฒ ์ธํ ํด๋์ผ๋ฉด "๋ด ์ปดํจํฐ์์๋ ๋๋๋ฐ?"๋ผ๋ ๋ง์ ๋ฌ๊ณ ์ด๊ฒ ๋ผ. ๐
๊ทธ๋์ ๋ฑ์ฅํ ๊ฒ ๋ฐ๋ก ์ปจํ ์ด๋ ๊ธฐ์ ์ด์ผ! Docker๋ฅผ ์ฌ์ฉํ๋ฉด ํ๊ฒฝ์ ํต์งธ๋ก ํจํค์งํ ์ ์์ด์, ์ด๋์๋ ๋๊ฐ์ด ์๋ํ๋ AI ํ์ต ํ๊ฒฝ์ ๋ง๋ค ์ ์๊ฑฐ๋ . ๋ง์น ๋ ๊ณ ๋ธ๋ก์ฒ๋ผ ์กฐ๋ฆฝํ๊ณ ๋ถํดํ๊ณ , ํ์ํ ๋๋ง๋ค ๊บผ๋ด ์ธ ์ ์๋ ๊ฑฐ์ง! ๐งฑ
๐ง ๊ธฐ๋ณธ ๊ฐ๋ : GPU ์ปจํ ์ด๋๊ฐ ๋ญ๋ฐ?
์, ๋ณธ๊ฒฉ์ ์ผ๋ก ๋ค์ด๊ฐ๊ธฐ ์ ์ ๊ธฐ๋ณธ ๊ฐ๋ ๋ถํฐ ํ์คํ ์ก๊ณ ๊ฐ์! ๐ฏ
๐ฆ ์ปจํ ์ด๋๋?
์ปจํ ์ด๋๋ ์ ํ๋ฆฌ์ผ์ด์ ๊ณผ ๊ทธ ์คํ์ ํ์ํ ๋ชจ๋ ๊ฒ(๋ผ์ด๋ธ๋ฌ๋ฆฌ, ์์กด์ฑ, ์ค์ ํ์ผ ๋ฑ)์ ํ๋์ ํจํค์ง๋ก ๋ฌถ์ ๊ฑฐ์ผ. ๊ฐ์๋จธ์ (VM)๊ณผ ๋น์ทํ์ง๋ง ํจ์ฌ ๊ฐ๋ณ๊ณ ๋น ๋ฅด์ง! VM์ ์ ์ฒด OS๋ฅผ ํฌํจํ๋ ๋ฐ๋ฉด, ์ปจํ ์ด๋๋ ํธ์คํธ OS์ ์ปค๋์ ๊ณต์ ํ๋ฉด์ ๊ฒฉ๋ฆฌ๋ ํ๊ฒฝ์ ์ ๊ณตํด. ๐โโ๏ธ
์ปจํ ์ด๋: ํ์ํ ์ง๋ง ๊ฐ๋ฐฉ์ ์ธ์ ์ฎ๊ธฐ๋ ๊ฒ. ๊ฐ๋ณ๊ณ ๋น ๋ฆ!
GPU ์ปจํ ์ด๋: ๊ฑฐ๊ธฐ์ ๊ณ ์ฑ๋ฅ ๊ฒ์๊ธฐ(GPU)๊น์ง ์ฑ๊ฒจ๊ฐ๋ ๊ฒ! ๐ฎ
๐ฎ GPU๋ฅผ ์ปจํ ์ด๋์์ ์ฌ์ฉํ๋ ค๋ฉด?
์ผ๋ฐ ์ปจํ ์ด๋๋ CPU๋ง ์ฌ์ฉํ ์ ์์ด. GPU๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด ํน๋ณํ ์ค์ ์ด ํ์ํ๋ฐ, ๋ฐ๋ก NVIDIA Container Toolkit์ด์ผ! ์ด๊ฒ ์์ด์ผ ์ปจํ ์ด๋ ์์์ GPU๋ฅผ ์ธ์ํ๊ณ ์ฌ์ฉํ ์ ์๊ฑฐ๋ . ๋ง์น USB ๋๋ผ์ด๋ฒ ๊ฐ์ ์ญํ ์ด๋ผ๊ณ ๋ณด๋ฉด ๋ผ. ๐
ํต์ฌ ๊ตฌ์ฑ ์์๋ฅผ ์ ๋ฆฌํ๋ฉด ์ด๋ ๊ฒ ๋ผ:
| ๊ตฌ์ฑ ์์ | ์ญํ | ํ์ ์ฌ๋ถ |
|---|---|---|
| NVIDIA Driver | ํธ์คํธ OS์์ GPU ํ๋์จ์ด ์ ์ด | โ ํ์ |
| Docker Engine | ์ปจํ ์ด๋ ์คํ ํ๊ฒฝ ์ ๊ณต | โ ํ์ |
| NVIDIA Container Toolkit | ์ปจํ ์ด๋์ GPU ์ ๊ทผ ๊ถํ ๋ถ์ฌ | โ ํ์ |
| CUDA | GPU ํ๋ก๊ทธ๋๋ฐ ํ๋ซํผ (์ปจํ ์ด๋ ๋ด๋ถ) | โ ํ์ |
| cuDNN | ๋ฅ๋ฌ๋ ๊ฐ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ | โญ ๊ถ์ฅ |
| Kubernetes | ๋ค์ค ์ปจํ ์ด๋ ์ค์ผ์คํธ๋ ์ด์ | ๐ ์ ํ |
๐ ๏ธ ํ๊ฒฝ ๊ตฌ์ถ Step 1: ํธ์คํธ ์์คํ ์ค๋นํ๊ธฐ
์, ์ด์ ์ค์ ์ด์ผ! ๋จผ์ ํธ์คํธ ์์คํ (์ค์ ๋ฌผ๋ฆฌ ์๋ฒ๋ ์ํฌ์คํ ์ด์ )์ ์ค๋นํด์ผ ํด. ๋๋ Ubuntu 22.04 LTS ๊ธฐ์ค์ผ๋ก ์ค๋ช ํ ๊ฒ. CentOS๋ ๋ค๋ฅธ ๋ฐฐํฌํ๋ ๋น์ทํ๋๊น ๊ฑฑ์ ๋ง! ๐
๐ ์์คํ ์๊ตฌ์ฌํญ ์ฒดํฌ
โข OS: Ubuntu 18.04/20.04/22.04, CentOS 7/8, RHEL 7/8
โข RAM: ์ต์ 16GB (32GB ์ด์ ๊ถ์ฅ)
โข Storage: SSD 100GB ์ด์ (์ปจํ ์ด๋ ์ด๋ฏธ์ง ์ ์ฅ์ฉ)
โข Network: ์ธํฐ๋ท ์ฐ๊ฒฐ (์ด๋ฏธ์ง ๋ค์ด๋ก๋์ฉ)
๐ฏ Step 1-1: NVIDIA Driver ์ค์น
๊ฐ์ฅ ๋จผ์ ํด์ผ ํ ์ผ์ NVIDIA ๋๋ผ์ด๋ฒ ์ค์น์ผ. ์ด๊ฒ ์์ผ๋ฉด GPU ์์ฒด๋ฅผ ์ธ์ ๋ชป ํด! ๐ฑ
# ์์คํ
์
๋ฐ์ดํธ
sudo apt update && sudo apt upgrade -y
# ๊ธฐ์กด NVIDIA ๋๋ผ์ด๋ฒ ์ ๊ฑฐ (๊นจ๋ํ ์ค์น๋ฅผ ์ํด)
sudo apt remove --purge nvidia-* -y
sudo apt autoremove -y
# ์ถ์ฒ ๋๋ผ์ด๋ฒ ํ์ธ
ubuntu-drivers devices
# ์ถ์ฒ ๋๋ผ์ด๋ฒ ์๋ ์ค์น
sudo ubuntu-drivers autoinstall
# ๋๋ ํน์ ๋ฒ์ ์ค์น (์: 535 ๋ฒ์ )
sudo apt install nvidia-driver-535 -y
# ์ฌ๋ถํ
sudo reboot
์ฌ๋ถํ ํ ๋๋ผ์ด๋ฒ๊ฐ ์ ๋๋ก ์ค์น๋๋์ง ํ์ธํด๋ณด์:
# GPU ์ ๋ณด ํ์ธ
nvidia-smi
์ด ๋ช ๋ น์ด๋ฅผ ์คํํ๋ฉด ์ด๋ฐ ํ๋ฉด์ด ๋์์ผ ์ ์์ด์ผ:
+-----------------------------------------------------------------------------+ | NVIDIA-SMI 535.129.03 Driver Version: 535.129.03 CUDA Version: 12.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 NVIDIA GeForce ... Off | 00000000:01:00.0 On | N/A | | 30% 45C P8 25W / 450W | 512MiB / 24564MiB | 0% Default | +-------------------------------+----------------------+----------------------+
๐ณ Step 1-2: Docker ์ค์น
์ด์ Docker๋ฅผ ์ค์นํ ์ฐจ๋ก์ผ! Docker๋ ์ปจํ ์ด๋๋ฅผ ์คํํ๋ ํต์ฌ ์์ง์ด์ง. ๐ข
# Docker ๊ณต์ GPG ํค ์ถ๊ฐ
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Docker ์ ์ฅ์ ์ถ๊ฐ
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Docker ์ค์น
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
# Docker ์๋น์ค ์์ ๋ฐ ์๋ ์์ ์ค์
sudo systemctl start docker
sudo systemctl enable docker
# ํ์ฌ ์ฌ์ฉ์๋ฅผ docker ๊ทธ๋ฃน์ ์ถ๊ฐ (sudo ์์ด docker ๋ช
๋ น ์ฌ์ฉ)
sudo usermod -aG docker $USER
# ๋ณ๊ฒฝ์ฌํญ ์ ์ฉ์ ์ํด ๋ก๊ทธ์์ ํ ์ฌ๋ก๊ทธ์ธ ๋๋
newgrp docker
# Docker ์ค์น ํ์ธ
docker --version
docker run hello-world
docker run hello-world๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์คํ๋๋ฉด Docker๊ฐ ์ ๋๋ก ์ค์น๋ ๊ฑฐ์ผ! ์ด ๋ช
๋ น์ด๋ ๊ฐ๋จํ ํ
์คํธ ์ปจํ
์ด๋๋ฅผ ๋ค์ด๋ก๋ํ๊ณ ์คํํด์ "Hello from Docker!" ๋ฉ์์ง๋ฅผ ์ถ๋ ฅํด์ค. ๐
๐ Step 1-3: NVIDIA Container Toolkit ์ค์น
์, ์ด์ ๊ฐ์ฅ ์ค์ํ ๋ถ๋ถ์ด์ผ! NVIDIA Container Toolkit์ ์ค์นํด์ Docker ์ปจํ ์ด๋๊ฐ GPU๋ฅผ ์ฌ์ฉํ ์ ์๊ฒ ๋ง๋ค์ด๋ณด์. ๐ฏ
# NVIDIA Container Toolkit ์ ์ฅ์ ์ค์
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
# ํจํค์ง ์ค์น
sudo apt update
sudo apt install -y nvidia-container-toolkit
# Docker ๋ฐ๋ชฌ ์ค์ ์
๋ฐ์ดํธ
sudo nvidia-ctk runtime configure --runtime=docker
# Docker ์ฌ์์
sudo systemctl restart docker
# ์ค์น ํ์ธ
docker run --rm --gpus all nvidia/cuda:12.2.0-base-ubuntu22.04 nvidia-smi
๋ง์ง๋ง ๋ช
๋ น์ด๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์คํ๋๊ณ nvidia-smi ์ถ๋ ฅ์ด ๋์ค๋ฉด ์๋ฒฝํ๊ฒ ์ค์ ๋ ๊ฑฐ์ผ! ๐ ์ด์ ์ปจํ
์ด๋ ์์์๋ GPU๋ฅผ ์ฌ์ฉํ ์ ์์ด!
๐จ ํ๊ฒฝ ๊ตฌ์ถ Step 2: AI ํ์ต์ฉ Docker ์ด๋ฏธ์ง ๋ง๋ค๊ธฐ
ํธ์คํธ ์์คํ ์ค๋น๊ฐ ๋๋ฌ์ผ๋, ์ด์ ์ค์ ๋ก AI ํ์ต์ ์ฌ์ฉํ Docker ์ด๋ฏธ์ง๋ฅผ ๋ง๋ค์ด๋ณด์! ์ฌ๊ธฐ์๋ PyTorch ๊ธฐ๋ฐ ์ด๋ฏธ์ง๋ฅผ ์์๋ก ๋ค๊ฒ. TensorFlow๋ ๋น์ทํ ๋ฐฉ์์ผ๋ก ๋ง๋ค ์ ์์ด! ๐จ
๐ Dockerfile ์์ฑํ๊ธฐ
Dockerfile์ ์ปจํ ์ด๋ ์ด๋ฏธ์ง๋ฅผ ๋ง๋๋ ๋ ์ํผ์ผ. ์ด๋ค ๋ฒ ์ด์ค ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํ ์ง, ์ด๋ค ํจํค์ง๋ฅผ ์ค์นํ ์ง ๋ฑ์ ์ ์ํ์ง. ์ค์ ์์ ๋ฐ๋ก ์ธ ์ ์๋ Dockerfile์ ๋ง๋ค์ด๋ณผ๊ฒ! ๐ช
# Dockerfile
FROM nvidia/cuda:12.2.0-cudnn8-devel-ubuntu22.04
# ํ๊ฒฝ ๋ณ์ ์ค์
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV CUDA_HOME=/usr/local/cuda
ENV PATH=${CUDA_HOME}/bin:${PATH}
ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
# ๊ธฐ๋ณธ ํจํค์ง ์ค์น
RUN apt-get update && apt-get install -y \
python3.10 \
python3-pip \
python3-dev \
git \
wget \
curl \
vim \
tmux \
htop \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Python ์ฌ๋ณผ๋ฆญ ๋งํฌ ์์ฑ
RUN ln -s /usr/bin/python3 /usr/bin/python
# pip ์
๊ทธ๋ ์ด๋
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# PyTorch ๋ฐ ์ฃผ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
RUN pip install --no-cache-dir \
torch==2.1.0 \
torchvision==0.16.0 \
torchaudio==2.1.0 \
--index-url https://download.pytorch.org/whl/cu121
# ๋ฐ์ดํฐ ์ฌ์ด์ธ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ
RUN pip install --no-cache-dir \
numpy==1.24.3 \
pandas==2.0.3 \
scikit-learn==1.3.0 \
matplotlib==3.7.2 \
seaborn==0.12.2 \
jupyter==1.0.0 \
jupyterlab==4.0.5 \
ipywidgets==8.1.0
# ๋ฅ๋ฌ๋ ์ ํธ๋ฆฌํฐ
RUN pip install --no-cache-dir \
transformers==4.33.0 \
datasets==2.14.5 \
accelerate==0.23.0 \
tensorboard==2.14.0 \
wandb==0.15.10 \
opencv-python==4.8.0.76 \
albumentations==1.3.1 \
timm==0.9.7
# ์์
๋๋ ํ ๋ฆฌ ์ค์
WORKDIR /workspace
# Jupyter ์ค์
RUN jupyter notebook --generate-config && \
echo "c.NotebookApp.ip = '0.0.0.0'" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.NotebookApp.open_browser = False" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.NotebookApp.token = ''" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.NotebookApp.password = ''" >> ~/.jupyter/jupyter_notebook_config.py
# ํฌํธ ๋
ธ์ถ
EXPOSE 8888 6006
# ์์ ๋ช
๋ น
CMD ["/bin/bash"]
2. Python ํ๊ฒฝ: Python 3.10 ๋ฐ ํ์ ๊ฐ๋ฐ ๋๊ตฌ
3. PyTorch: CUDA 12.1 ํธํ ๋ฒ์ ์ค์น
4. ML/DL ๋ผ์ด๋ธ๋ฌ๋ฆฌ: ์ค๋ฌด์์ ์์ฃผ ์ฐ๋ ํจํค์ง๋ค
5. Jupyter: ์น ๊ธฐ๋ฐ ๊ฐ๋ฐ ํ๊ฒฝ (ํฌํธ 8888)
6. TensorBoard: ํ์ต ๋ชจ๋ํฐ๋ง ๋๊ตฌ (ํฌํธ 6006)
๐๏ธ ์ด๋ฏธ์ง ๋น๋ํ๊ธฐ
Dockerfile์ ์์ฑํ์ผ๋ฉด ์ด์ ์ค์ ์ด๋ฏธ์ง๋ฅผ ๋น๋ํด๋ณด์! ์ฒ์ ๋น๋ํ ๋๋ ์๊ฐ์ด ์ข ๊ฑธ๋ฆด ์ ์์ด. ์ปคํผ ํ ์ ํ๋ฉด์ ๊ธฐ๋ค๋ ค~ โ
# ์ด๋ฏธ์ง ๋น๋ (ํ์ฌ ๋๋ ํ ๋ฆฌ์ Dockerfile์ด ์๋ค๊ณ ๊ฐ์ )
docker build -t ai-pytorch:latest .
# ๋น๋ ๊ณผ์ ์์ ์บ์ ์ฌ์ฉ ์ ํ๊ณ ์ฒ์๋ถํฐ ๋ค์ ๋น๋
docker build --no-cache -t ai-pytorch:latest .
# ๋น๋๋ ์ด๋ฏธ์ง ํ์ธ
docker images
# ์ด๋ฏธ์ง ์์ธ ์ ๋ณด ํ์ธ
docker inspect ai-pytorch:latest
๐ ์ปจํ ์ด๋ ์คํํ๊ธฐ
์ด๋ฏธ์ง๊ฐ ์ค๋น๋์ผ๋ ์ด์ ์ปจํ ์ด๋๋ฅผ ์คํํด๋ณด์! GPU๋ฅผ ์ฌ์ฉํ๋ ์ปจํ ์ด๋๋ฅผ ๋์ฐ๋ ๋ฐฉ๋ฒ์ ์ฌ๋ฌ ๊ฐ์ง๊ฐ ์์ด. ์ํฉ์ ๋ง๊ฒ ๊ณจ๋ผ ์ฐ๋ฉด ๋ผ! ๐ฎ
# ๊ธฐ๋ณธ ์คํ (๋ชจ๋ GPU ์ฌ์ฉ, ์ธํฐ๋ํฐ๋ธ ๋ชจ๋)
docker run --gpus all -it --rm \
--name ai-workspace \
-v $(pwd)/workspace:/workspace \
-p 8888:8888 -p 6006:6006 \
ai-pytorch:latest
# ํน์ GPU๋ง ์ฌ์ฉ (GPU 0๋ฒ๋ง)
docker run --gpus '"device=0"' -it --rm \
--name ai-workspace \
-v $(pwd)/workspace:/workspace \
-p 8888:8888 -p 6006:6006 \
ai-pytorch:latest
# ์ฌ๋ฌ GPU ์ ํ (GPU 0, 2๋ฒ)
docker run --gpus '"device=0,2"' -it --rm \
--name ai-workspace \
-v $(pwd)/workspace:/workspace \
-p 8888:8888 -p 6006:6006 \
ai-pytorch:latest
# ๋ฐฑ๊ทธ๋ผ์ด๋ ์คํ + Jupyter ์๋ ์์
docker run --gpus all -d \
--name ai-workspace \
-v $(pwd)/workspace:/workspace \
-p 8888:8888 -p 6006:6006 \
ai-pytorch:latest \
jupyter lab --allow-root
# ์คํ ์ค์ธ ์ปจํ
์ด๋์ ์ ์
docker exec -it ai-workspace /bin/bash
-it: ์ธํฐ๋ํฐ๋ธ ํฐ๋ฏธ๋ ๋ชจ๋
--rm: ์ปจํ ์ด๋ ์ข ๋ฃ ์ ์๋ ์ญ์
-v: ํธ์คํธ ๋๋ ํ ๋ฆฌ๋ฅผ ์ปจํ ์ด๋์ ๋ง์ดํธ (๋ฐ์ดํฐ ์์์ฑ)
-p: ํฌํธ ํฌ์๋ฉ (ํธ์คํธ:์ปจํ ์ด๋)
-d: ๋ฐฑ๊ทธ๋ผ์ด๋ ์คํ (detached mode)
๐งช GPU ์๋ ํ ์คํธ
์ปจํ ์ด๋๊ฐ ์คํ๋์ผ๋ฉด GPU๊ฐ ์ ๋๋ก ์ธ์๋๋์ง ํ ์คํธํด๋ณด์! Python ์ฝ๋๋ก ๊ฐ๋จํ ํ์ธํ ์ ์์ด. ๐ฌ
# ์ปจํ
์ด๋ ์์์ Python ์คํ
python3
# Python ์ธํฐํ๋ฆฌํฐ์์ ์คํ
import torch
print(f"PyTorch version: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"CUDA version: {torch.version.cuda}")
print(f"Number of GPUs: {torch.cuda.device_count()}")
# GPU ์ ๋ณด ์ถ๋ ฅ
for i in range(torch.cuda.device_count()):
print(f"GPU {i}: {torch.cuda.get_device_name(i)}")
print(f" Memory: {torch.cuda.get_device_properties(i).total_memory / 1024**3:.2f} GB")
# ๊ฐ๋จํ ํ
์ ์ฐ์ฐ ํ
์คํธ
x = torch.rand(1000, 1000).cuda()
y = torch.rand(1000, 1000).cuda()
z = torch.matmul(x, y)
print(f"Matrix multiplication successful on GPU!")
์ด ์ฝ๋๊ฐ ์๋ฌ ์์ด ์คํ๋๊ณ GPU ์ ๋ณด๊ฐ ์ถ๋ ฅ๋๋ฉด ์ฑ๊ณต์ด์ผ! ๐ ์ด์ ๋ณธ๊ฒฉ์ ์ผ๋ก AI ๋ชจ๋ธ์ ํ์ต์ํฌ ์ค๋น๊ฐ ๋ ๊ฑฐ์ง!
๐ฏ ํ๊ฒฝ ๊ตฌ์ถ Step 3: Docker Compose๋ก ๋ฉํฐ ์ปจํ ์ด๋ ๊ด๋ฆฌ
์ค์ ํ๋ก์ ํธ์์๋ ์ฌ๋ฌ ์ปจํ ์ด๋๋ฅผ ๋์์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ๊ฐ ๋ง์. ์๋ฅผ ๋ค์ด ํ์ต์ฉ ์ปจํ ์ด๋, ๋ฐ์ดํฐ๋ฒ ์ด์ค, ๋ชจ๋ํฐ๋ง ๋๊ตฌ ๋ฑ์ ํจ๊ป ๋์์ผ ํ ๋๊ฐ ์์ง. ์ด๋ด ๋ Docker Compose๋ฅผ ์ฌ์ฉํ๋ฉด ์์ฒญ ํธํด! ๐ฆ
๐ docker-compose.yml ์์ฑ
Docker Compose๋ YAML ํ์ผ๋ก ์ฌ๋ฌ ์ปจํ ์ด๋์ ์ค์ ์ ํ ๋ฒ์ ์ ์ํ ์ ์์ด. ์ค๋ฌด์์ ๋ฐ๋ก ์ธ ์ ์๋ ๊ตฌ์ฑ์ ๋ง๋ค์ด๋ณผ๊ฒ! ๐ ๏ธ
# docker-compose.yml
version: '3.8'
services:
# PyTorch ํ์ต ํ๊ฒฝ
pytorch-gpu:
image: ai-pytorch:latest
container_name: pytorch-workspace
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
volumes:
- ./workspace:/workspace
- ./datasets:/datasets
- ./models:/models
ports:
- "8888:8888"
- "6006:6006"
shm_size: '16gb'
stdin_open: true
tty: true
command: jupyter lab --allow-root
networks:
- ai-network
# TensorFlow ํ์ต ํ๊ฒฝ
tensorflow-gpu:
image: tensorflow/tensorflow:2.13.0-gpu-jupyter
container_name: tensorflow-workspace
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
volumes:
- ./workspace-tf:/workspace
- ./datasets:/datasets
- ./models:/models
ports:
- "8889:8888"
- "6007:6006"
shm_size: '16gb'
networks:
- ai-network
# MLflow ์คํ ์ถ์
mlflow:
image: ghcr.io/mlflow/mlflow:v2.7.1
container_name: mlflow-server
ports:
- "5000:5000"
volumes:
- ./mlflow:/mlflow
command: mlflow server --host 0.0.0.0 --port 5000 --backend-store-uri sqlite:///mlflow/mlflow.db --default-artifact-root /mlflow/artifacts
networks:
- ai-network
# PostgreSQL (์คํ ๊ฒฐ๊ณผ ์ ์ฅ์ฉ)
postgres:
image: postgres:15
container_name: ai-postgres
environment:
- POSTGRES_USER=aiuser
- POSTGRES_PASSWORD=aipassword
- POSTGRES_DB=experiments
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- ai-network
# Redis (์บ์ฑ ๋ฐ ํ)
redis:
image: redis:7-alpine
container_name: ai-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- ai-network
volumes:
postgres-data:
redis-data:
networks:
ai-network:
driver: bridge
tensorflow-gpu: TensorFlow ํ์ต ํ๊ฒฝ (Jupyter ํฌํธ 8889)
mlflow: ์คํ ์ถ์ ๋ฐ ๋ชจ๋ธ ๊ด๋ฆฌ (ํฌํธ 5000)
postgres: ์คํ ๊ฒฐ๊ณผ ์ ์ฅ์ฉ ๋ฐ์ดํฐ๋ฒ ์ด์ค
redis: ์บ์ฑ ๋ฐ ์์ ํ ๊ด๋ฆฌ
shm_size: ๊ณต์ ๋ฉ๋ชจ๋ฆฌ ํฌ๊ธฐ (DataLoader ๋ฉํฐํ๋ก์ธ์ฑ์ ํ์)
๐ Docker Compose ์คํ
# ๋ชจ๋ ์๋น์ค ์์
docker-compose up -d
# ํน์ ์๋น์ค๋ง ์์
docker-compose up -d pytorch-gpu mlflow
# ๋ก๊ทธ ํ์ธ
docker-compose logs -f pytorch-gpu
# ์๋น์ค ์ํ ํ์ธ
docker-compose ps
# ํน์ ์ปจํ
์ด๋์ ์ ์
docker-compose exec pytorch-gpu /bin/bash
# ๋ชจ๋ ์๋น์ค ์ค์ง
docker-compose down
# ๋ณผ๋ฅจ๊น์ง ์ญ์ ํ๋ฉฐ ์ค์ง
docker-compose down -v
๐ ์ค์ ํ์ฉ ์์
์ด์ ์ค์ ๋ก ์ด๋ป๊ฒ ์ฌ์ฉํ๋์ง ์์๋ฅผ ๋ณด์ฌ์ค๊ฒ! ๊ฐ๋จํ ์ด๋ฏธ์ง ๋ถ๋ฅ ๋ชจ๋ธ์ ํ์ต์์ผ๋ณด์. ๐ผ๏ธ
# train.py
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets, transforms, models
from torch.utils.data import DataLoader
import mlflow
import mlflow.pytorch
# MLflow ์ค์
mlflow.set_tracking_uri("http://mlflow:5000")
mlflow.set_experiment("image-classification")
# ํ์ดํผํ๋ผ๋ฏธํฐ
BATCH_SIZE = 64
EPOCHS = 10
LEARNING_RATE = 0.001
# ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ
transform = transforms.Compose([
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225])
])
# ๋ฐ์ดํฐ์
๋ก๋
train_dataset = datasets.ImageFolder('/datasets/train', transform=transform)
train_loader = DataLoader(train_dataset, batch_size=BATCH_SIZE,
shuffle=True, num_workers=4, pin_memory=True)
# ๋ชจ๋ธ ์ ์
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
model = models.resnet50(pretrained=True)
model.fc = nn.Linear(model.fc.in_features, len(train_dataset.classes))
model = model.to(device)
# ์์ค ํจ์ ๋ฐ ์ตํฐ๋ง์ด์
criterion = nn.CrossEntropyLoss()
optimizer = optim.Adam(model.parameters(), lr=LEARNING_RATE)
# MLflow ์คํ ์์
with mlflow.start_run():
# ํ์ดํผํ๋ผ๋ฏธํฐ ๋ก๊น
mlflow.log_params({
"batch_size": BATCH_SIZE,
"epochs": EPOCHS,
"learning_rate": LEARNING_RATE,
"model": "resnet50"
})
# ํ์ต ๋ฃจํ
for epoch in range(EPOCHS):
model.train()
running_loss = 0.0
correct = 0
total = 0
for i, (inputs, labels) in enumerate(train_loader):
inputs, labels = inputs.to(device), labels.to(device)
optimizer.zero_grad()
outputs = model(inputs)
loss = criterion(outputs, labels)
loss.backward()
optimizer.step()
running_loss += loss.item()
_, predicted = outputs.max(1)
total += labels.size(0)
correct += predicted.eq(labels).sum().item()
if i % 10 == 0:
print(f'Epoch [{epoch+1}/{EPOCHS}], Step [{i}/{len(train_loader)}], '
f'Loss: {loss.item():.4f}, Acc: {100.*correct/total:.2f}%')
# ์ํญ๋ณ ๋ฉํธ๋ฆญ ๋ก๊น
epoch_loss = running_loss / len(train_loader)
epoch_acc = 100. * correct / total
mlflow.log_metrics({
"train_loss": epoch_loss,
"train_accuracy": epoch_acc
}, step=epoch)
print(f'Epoch [{epoch+1}/{EPOCHS}] completed - Loss: {epoch_loss:.4f}, Acc: {epoch_acc:.2f}%')
# ๋ชจ๋ธ ์ ์ฅ
mlflow.pytorch.log_model(model, "model")
torch.save(model.state_dict(), '/models/resnet50_final.pth')
print("Training completed! ๐")
์ด ์ฝ๋๋ฅผ ์ปจํ ์ด๋ ์์์ ์คํํ๋ฉด:
# ์ปจํ
์ด๋ ์ ์
docker-compose exec pytorch-gpu /bin/bash
# ํ์ต ์คํ
cd /workspace
python train.py
# ๋๋ ๋ฐฑ๊ทธ๋ผ์ด๋ ์คํ
nohup python train.py > train.log 2>&1 &
ํ์ต์ด ์งํ๋๋ ๋์ ๋ธ๋ผ์ฐ์ ์์ http://localhost:5000์ผ๋ก MLflow UI์ ์ ์ํ๋ฉด ์ค์๊ฐ์ผ๋ก ํ์ต ๊ณผ์ ์ ๋ชจ๋ํฐ๋งํ ์ ์์ด! ๐
โธ๏ธ ํ๊ฒฝ ๊ตฌ์ถ Step 4: Kubernetes๋ก ์ค์ผ์ผ ์์ํ๊ธฐ
์ฌ๋ฌ ๋์ ์๋ฒ์์ ๋๊ท๋ชจ ํ์ต์ ๋๋ ค์ผ ํ๋ค๋ฉด? ๋ฐ๋ก Kubernetes์ ์์ญ์ด์ผ! Docker Compose๋ ๋จ์ผ ํธ์คํธ์์๋ง ์๋ํ์ง๋ง, Kubernetes๋ ์ฌ๋ฌ ์๋ฒ๋ฅผ ํด๋ฌ์คํฐ๋ก ๋ฌถ์ด์ ๊ด๋ฆฌํ ์ ์๊ฑฐ๋ . ๐
๐ฏ Kubernetes ํด๋ฌ์คํฐ ๊ตฌ์ฑ
๋จผ์ Kubernetes ํด๋ฌ์คํฐ๋ฅผ ๊ตฌ์ถํด์ผ ํด. ์ฌ๊ธฐ์๋ kubeadm์ ์ฌ์ฉํ ์จํ๋ ๋ฏธ์ค ๊ตฌ์ถ ๋ฐฉ๋ฒ์ ์ค๋ช ํ ๊ฒ. ํด๋ผ์ฐ๋(GKE, EKS, AKS)๋ฅผ ์ฌ์ฉํ๋ค๋ฉด ๋ ๊ฐ๋จํ์ง! โ๏ธ
# ๋ชจ๋ ๋
ธ๋์์ ์คํ (๋ง์คํฐ + ์์ปค)
# 1. ์ค์ ๋นํ์ฑํ
sudo swapoff -a
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
# 2. ์ปค๋ ๋ชจ๋ ๋ก๋
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF
sudo modprobe overlay
sudo modprobe br_netfilter
# 3. ์์คํ
์ค์
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward = 1
EOF
sudo sysctl --system
# 4. containerd ์ค์น
sudo apt-get update
sudo apt-get install -y containerd
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
sudo systemctl restart containerd
sudo systemctl enable containerd
# 5. Kubernetes ํจํค์ง ์ค์น
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl
# 6. ๋ง์คํฐ ๋
ธ๋ ์ด๊ธฐํ (๋ง์คํฐ ๋
ธ๋์์๋ง)
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
# 7. kubectl ์ค์ (๋ง์คํฐ ๋
ธ๋์์๋ง)
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
# 8. CNI ํ๋ฌ๊ทธ์ธ ์ค์น (Flannel)
kubectl apply -f https://raw.githubusercontent.com/flannel-io/flannel/master/Documentation/kube-flannel.yml
# 9. ์์ปค ๋
ธ๋ ์กฐ์ธ (์์ปค ๋
ธ๋์์)
# kubeadm init ์ถ๋ ฅ์ ๋์จ join ๋ช
๋ น์ด ์คํ
sudo kubeadm join <master-ip>:6443 --token <token> --discovery-token-ca-cert-hash sha256:<hash>
๐ฎ NVIDIA GPU Operator ์ค์น
Kubernetes์์ GPU๋ฅผ ์ฌ์ฉํ๋ ค๋ฉด NVIDIA GPU Operator๋ฅผ ์ค์นํด์ผ ํด. ์ด๊ฒ ๊ฐ ๋ ธ๋์ ํ์ํ ๋๋ผ์ด๋ฒ์ ํ๋ฌ๊ทธ์ธ์ ์๋์ผ๋ก ์ค์นํด์ค! ๐
# Helm ์ค์น
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# NVIDIA GPU Operator ์ ์ฅ์ ์ถ๊ฐ
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia
helm repo update
# GPU Operator ์ค์น
helm install --wait --generate-name \
-n gpu-operator --create-namespace \
nvidia/gpu-operator
# ์ค์น ํ์ธ
kubectl get pods -n gpu-operator
kubectl get nodes -o json | jq '.items[].status.allocatable'
๐ GPU ํ์ต Job ๋ฐฐํฌ
์ด์ ์ค์ ๋ก GPU๋ฅผ ์ฌ์ฉํ๋ ํ์ต Job์ Kubernetes์ ๋ฐฐํฌํด๋ณด์! ๐
# pytorch-training-job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: pytorch-training-job
namespace: ai-training
spec:
parallelism: 1
completions: 1
backoffLimit: 3
template:
metadata:
labels:
app: pytorch-training
spec:
restartPolicy: OnFailure
containers:
- name: pytorch-trainer
image: ai-pytorch:latest
command: ["python", "/workspace/train.py"]
resources:
limits:
nvidia.com/gpu: 1 # GPU 1๊ฐ ์์ฒญ
memory: "32Gi"
cpu: "8"
requests:
nvidia.com/gpu: 1
memory: "16Gi"
cpu: "4"
volumeMounts:
- name: workspace
mountPath: /workspace
- name: datasets
mountPath: /datasets
- name: models
mountPath: /models
env:
- name: NVIDIA_VISIBLE_DEVICES
value: "all"
- name: NVIDIA_DRIVER_CAPABILITIES
value: "compute,utility"
volumes:
- name: workspace
persistentVolumeClaim:
claimName: workspace-pvc
- name: datasets
persistentVolumeClaim:
claimName: datasets-pvc
- name: models
persistentVolumeClaim:
claimName: models-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: workspace-pvc
namespace: ai-training
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
storageClassName: nfs-client
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: datasets-pvc
namespace: ai-training
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 500Gi
storageClassName: nfs-client
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: models-pvc
namespace: ai-training
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 200Gi
storageClassName: nfs-client
# Job ๋ฐฐํฌ
kubectl create namespace ai-training
kubectl apply -f pytorch-training-job.yaml
# Job ์ํ ํ์ธ
kubectl get jobs -n ai-training
kubectl get pods -n ai-training
# ๋ก๊ทธ ํ์ธ
kubectl logs -f <pod-name> -n ai-training
# Job ์ญ์
kubectl delete job pytorch-training-job -n ai-training
๐ ๋ถ์ฐ ํ์ต ๊ตฌ์ฑ
์ฌ๋ฌ GPU๋ฅผ ์ฌ์ฉํ ๋ถ์ฐ ํ์ต๋ ๊ฐ๋ฅํด! PyTorch DDP(Distributed Data Parallel)๋ฅผ ์ฌ์ฉํ ์์๋ฅผ ๋ณด์ฌ์ค๊ฒ. ๐ช
# distributed-training-job.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: distributed-training
namespace: ai-training
spec:
parallelism: 4 # 4๊ฐ์ Pod ๋์ ์คํ
completions: 4
template:
metadata:
labels:
app: distributed-training
spec:
restartPolicy: OnFailure
containers:
- name: pytorch-ddp
image: ai-pytorch:latest
command:
- "python"
- "-m"
- "torch.distributed.launch"
- "--nproc_per_node=1"
- "--nnodes=4"
- "--node_rank=$(POD_INDEX)"
- "--master_addr=distributed-training-master"
- "--master_port=29500"
- "/workspace/train_distributed.py"
resources:
limits:
nvidia.com/gpu: 1
memory: "32Gi"
cpu: "8"
env:
- name: POD_INDEX
valueFrom:
fieldRef:
fieldPath: metadata.annotations['batch.kubernetes.io/job-completion-index']
volumeMounts:
- name: workspace
mountPath: /workspace
- name: datasets
mountPath: /datasets
volumes:
- name: workspace
persistentVolumeClaim:
claimName: workspace-pvc
- name: datasets
persistentVolumeClaim:
claimName: datasets-pvc
---
apiVersion: v1
kind: Service
metadata:
name: distributed-training-master
namespace: ai-training
spec:
clusterIP: None
selector:
app: distributed-training
ports:
- port: 29500
targetPort: 29500
๐จ ์ค์ ํ์ฉ: ๋ค์ํ ์๋๋ฆฌ์ค๋ณ ๊ตฌ์ฑ
์ด๋ก ์ ์ถฉ๋ถํ ๋ฐฐ์ ์ผ๋, ์ด์ ์ค์ ์ํฉ์์ ์ด๋ป๊ฒ ํ์ฉํ๋์ง ์์๋ณด์! ์ฌ๋ฌ ์๋๋ฆฌ์ค๋ณ๋ก ์ต์ ์ ๊ตฌ์ฑ์ ์๊ฐํ ๊ฒ. ๐
๐ฏ ์๋๋ฆฌ์ค 1: ๊ฐ์ธ ์ฐ๊ตฌ์ / ์๊ท๋ชจ ํ
โข ๊ฐ๋จํ ๋ชจ๋ธ ์คํ ๋ฐ ํ๋กํ ํ์ดํ
โข ๋น ๋ฅธ ํ๊ฒฝ ์ ํ ํ์
๐ก ์ถ์ฒ ๊ตฌ์ฑ:
โข Docker + Docker Compose
โข Jupyter Notebook ๊ธฐ๋ฐ ๊ฐ๋ฐ
โข ๋ก์ปฌ ์คํ ๋ฆฌ์ง ์ฌ์ฉ
โข MLflow๋ก ์คํ ์ถ์
# ๊ฐ๋จํ docker-compose.yml
version: '3.8'
services:
jupyter:
image: ai-pytorch:latest
runtime: nvidia
environment:
- NVIDIA_VISIBLE_DEVICES=all
volumes:
- ./work:/workspace
ports:
- "8888:8888"
command: jupyter lab --allow-root
mlflow:
image: ghcr.io/mlflow/mlflow:v2.7.1
ports:
- "5000:5000"
volumes:
- ./mlflow:/mlflow
command: mlflow server --host 0.0.0.0 --backend-store-uri sqlite:///mlflow/mlflow.db
๐ข ์๋๋ฆฌ์ค 2: ์ค์ ๊ธฐ์ / ์คํํธ์
โข ์ฌ๋ฌ ํ์์ด ๋์ ์ฌ์ฉ
โข ์คํ ๊ด๋ฆฌ ๋ฐ ํ์ ํ์
โข ๋น์ฉ ํจ์จ์ ์ธ ๋ฆฌ์์ค ํ์ฉ
๐ก ์ถ์ฒ ๊ตฌ์ฑ:
โข Docker + Kubernetes (๋จ์ผ ํด๋ฌ์คํฐ)
โข JupyterHub๋ก ๋ฉํฐ ์ ์ ์ง์
โข NFS ๊ณต์ ์คํ ๋ฆฌ์ง
โข GPU ๋ฆฌ์์ค ์ฟผํฐ ์ค์
โข MLflow + PostgreSQL
# jupyterhub-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: jupyterhub-config
namespace: ai-platform
data:
jupyterhub_config.py: |
c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator'
c.Spawner.default_url = '/lab'
c.Spawner.cpu_limit = 4
c.Spawner.mem_limit = '16G'
c.Spawner.extra_resource_limits = {"nvidia.com/gpu": "1"}
c.Spawner.image = 'ai-pytorch:latest'
c.Spawner.volume_mounts = [
{
'name': 'shared-data',
'mountPath': '/shared'
}
]
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jupyterhub
namespace: ai-platform
spec:
replicas: 1
selector:
matchLabels:
app: jupyterhub
template:
metadata:
labels:
app: jupyterhub
spec:
containers:
- name: jupyterhub
image: jupyterhub/k8s-hub:3.0.0
ports:
- containerPort: 8000
volumeMounts:
- name: config
mountPath: /etc/jupyterhub
- name: shared-data
mountPath: /shared
volumes:
- name: config
configMap:
name: jupyterhub-config
- name: shared-data
persistentVolumeClaim:
claimName: shared-data-pvc
๐ญ ์๋๋ฆฌ์ค 3: ๋๊ธฐ์ / ์ฐ๊ตฌ์
โข ๋๊ท๋ชจ ๋ถ์ฐ ํ์ต
โข ๋์ ๊ฐ์ฉ์ฑ ๋ฐ ์์ ์ฑ
โข ์ธ๋ฐํ ๋ฆฌ์์ค ๊ด๋ฆฌ ๋ฐ ๋ชจ๋ํฐ๋ง
โข ๋ณด์ ๋ฐ ๊ถํ ๊ด๋ฆฌ
๐ก ์ถ์ฒ ๊ตฌ์ฑ:
โข Kubernetes ๋ฉํฐ ํด๋ฌ์คํฐ
โข Kubeflow๋ก ML ํ์ดํ๋ผ์ธ ๊ตฌ์ถ
โข Distributed Storage (Ceph/GlusterFS)
โข Prometheus + Grafana ๋ชจ๋ํฐ๋ง
โข RBAC ๊ธฐ๋ฐ ๊ถํ ๊ด๋ฆฌ
โข CI/CD ํ์ดํ๋ผ์ธ ํตํฉ
# kubeflow-pipeline-example.yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: distributed-training-pipeline-
namespace: kubeflow
spec:
entrypoint: training-pipeline
arguments:
parameters:
- name: learning-rate
value: "0.001"
- name: batch-size
value: "64"
- name: num-gpus
value: "8"
templates:
- name: training-pipeline
steps:
- - name: data-preprocessing
template: preprocess-data
- - name: distributed-training
template: train-model
arguments:
parameters:
- name: learning-rate
value: "{{workflow.parameters.learning-rate}}"
- name: batch-size
value: "{{workflow.parameters.batch-size}}"
- name: num-gpus
value: "{{workflow.parameters.num-gpus}}"
- - name: model-evaluation
template: evaluate-model
- - name: model-deployment
template: deploy-model
- name: preprocess-data
container:
image: ai-pytorch:latest
command: [python]
args: ["/workspace/preprocess.py"]
resources:
limits:
nvidia.com/gpu: 1
memory: 32Gi
- name: train-model
inputs:
parameters:
- name: learning-rate
- name: batch-size
- name: num-gpus
resource:
action: create
manifest: |
apiVersion: "kubeflow.org/v1"
kind: PyTorchJob
metadata:
name: distributed-training
namespace: kubeflow
spec:
pytorchReplicaSpecs:
Master:
replicas: 1
restartPolicy: OnFailure
template:
spec:
containers:
- name: pytorch
image: ai-pytorch:latest
command:
- python
- -m
- torch.distributed.launch
- --nproc_per_node={{inputs.parameters.num-gpus}}
- /workspace/train_distributed.py
- --lr={{inputs.parameters.learning-rate}}
- --batch-size={{inputs.parameters.batch-size}}
resources:
limits:
nvidia.com/gpu: {{inputs.parameters.num-gpus}}
memory: 128Gi
Worker:
replicas: 7
restartPolicy: OnFailure
template:
spec:
containers:
- name: pytorch
image: ai-pytorch:latest
command:
- python
- -m
- torch.distributed.launch
- --nproc_per_node={{inputs.parameters.num-gpus}}
- /workspace/train_distributed.py
- --lr={{inputs.parameters.learning-rate}}
- --batch-size={{inputs.parameters.batch-size}}
resources:
limits:
nvidia.com/gpu: {{inputs.parameters.num-gpus}}
memory: 128Gi
- name: evaluate-model
container:
image: ai-pytorch:latest
command: [python]
args: ["/workspace/evaluate.py"]
resources:
limits:
nvidia.com/gpu: 1
- name: deploy-model
container:
image: ai-pytorch:latest
command: [python]
args: ["/workspace/deploy.py"]
๐ ๋ชจ๋ํฐ๋ง ๋ฐ ์ต์ ํ
GPU ํ๊ฒฝ์ ๊ตฌ์ถํ๋ค๋ฉด, ์ด์ ์ ๋๋ก ํ์ฉํ๊ณ ์๋์ง ๋ชจ๋ํฐ๋งํ๋ ๊ฒ ์ค์ํด! ๋น์ผ GPU๋ฅผ ๋๋ฆฌ๋ฉด ์ ๋์์? ๐
๐ GPU ์ฌ์ฉ๋ฅ ๋ชจ๋ํฐ๋ง
Prometheus์ Grafana๋ฅผ ์ฌ์ฉํด์ GPU ๋ฉํธ๋ฆญ์ ์ค์๊ฐ์ผ๋ก ๋ชจ๋ํฐ๋งํ ์ ์์ด. NVIDIA์์ ์ ๊ณตํ๋ DCGM Exporter๋ฅผ ์ฌ์ฉํ๋ฉด ๋ผ! ๐
# dcgm-exporter ์ค์น (Kubernetes)
helm repo add gpu-helm-charts https://nvidia.github.io/dcgm-exporter/helm-charts
helm repo update
helm install dcgm-exporter gpu-helm-charts/dcgm-exporter \
--namespace monitoring \
--create-namespace
# Prometheus ์ค์ ์ ์ถ๊ฐ
# prometheus-config.yaml
scrape_configs:
- job_name: 'dcgm-exporter'
static_configs:
- targets: ['dcgm-exporter.monitoring.svc:9400']
Grafana ๋์๋ณด๋์์ ํ์ธํ ์ ์๋ ์ฃผ์ ๋ฉํธ๋ฆญ:
| ๋ฉํธ๋ฆญ | ์ค๋ช | ์ต์ ๋ฒ์ |
|---|---|---|
| GPU Utilization | GPU ์ฝ์ด ์ฌ์ฉ๋ฅ | 80% ์ด์ |
| Memory Utilization | GPU ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ฅ | 70-90% |
| Temperature | GPU ์จ๋ | 60-80ยฐC |
| Power Usage | ์ ๋ ฅ ์๋น๋ | TDP์ 80-95% |
| SM Clock | ์คํธ๋ฆฌ๋ฐ ๋ฉํฐํ๋ก์ธ์ ํด๋ญ | ์ต๋ ํด๋ญ ์ ์ง |
| Memory Clock | ๋ฉ๋ชจ๋ฆฌ ํด๋ญ | ์ต๋ ํด๋ญ ์ ์ง |
โก ์ฑ๋ฅ ์ต์ ํ ํ
GPU ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ต๋ํ ํ์ฉํ ์ ์๋ ๋ฐฐ์น ํฌ๊ธฐ๋ฅผ ์ฐพ์์ผ ํด. ๋๋ฌด ์์ผ๋ฉด GPU๊ฐ ๋๊ณ , ๋๋ฌด ํฌ๋ฉด OOM(Out of Memory) ์๋ฌ๊ฐ ๋์ง.
2. Mixed Precision Training
FP16(๋ฐ์ ๋ฐ๋)์ ์ฌ์ฉํ๋ฉด ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋์ ์ค์ด๊ณ ํ์ต ์๋๋ฅผ ๋์ผ ์ ์์ด. PyTorch์ ๊ฒฝ์ฐ
torch.cuda.amp๋ฅผ ์ฌ์ฉํ๋ฉด ๋ผ!3. DataLoader ์ต์ ํ
num_workers๋ฅผ ์ ์ ํ ์ค์ ํด์ ๋ฐ์ดํฐ ๋ก๋ฉ์ด ๋ณ๋ชฉ์ด ๋์ง ์๋๋ก ํด์ผ ํด. ๋ณดํต CPU ์ฝ์ด ์์ ์ ๋ฐ ์ ๋๊ฐ ์ ๋นํด.4. Gradient Accumulation
๋ฉ๋ชจ๋ฆฌ๊ฐ ๋ถ์กฑํ ๋ ์ฌ๋ฌ ์คํ ์ ๊ฑธ์ณ ๊ทธ๋๋์ธํธ๋ฅผ ๋์ ํ๋ฉด ํฐ ๋ฐฐ์น ํฌ๊ธฐ ํจ๊ณผ๋ฅผ ๋ผ ์ ์์ด.
5. Pinned Memory
pin_memory=True ์ต์
์ ์ฌ์ฉํ๋ฉด CPU-GPU ๊ฐ ๋ฐ์ดํฐ ์ ์ก ์๋๊ฐ ๋นจ๋ผ์ ธ.
# ์ต์ ํ๋ ํ์ต ์ฝ๋ ์์
import torch
from torch.cuda.amp import autocast, GradScaler
# Mixed Precision Training ์ค์
scaler = GradScaler()
# DataLoader ์ต์ ํ
train_loader = DataLoader(
dataset,
batch_size=64,
num_workers=8, # CPU ์ฝ์ด ์์ ๋ง๊ฒ ์กฐ์
pin_memory=True, # ๋น ๋ฅธ GPU ์ ์ก
persistent_workers=True # ์์ปค ์ฌ์ฌ์ฉ
)
# Gradient Accumulation ์ค์
accumulation_steps = 4
model.train()
optimizer.zero_grad()
for i, (inputs, labels) in enumerate(train_loader):
inputs, labels = inputs.cuda(), labels.cuda()
# Mixed Precision Forward Pass
with autocast():
outputs = model(inputs)
loss = criterion(outputs, labels) / accumulation_steps
# Backward Pass
scaler.scale(loss).backward()
# Gradient Accumulation
if (i + 1) % accumulation_steps == 0:
scaler.step(optimizer)
scaler.update()
optimizer.zero_grad()
๐ ํธ๋ฌ๋ธ์ํ ๊ฐ์ด๋
์์ธ: ๋ฐฐ์น ํฌ๊ธฐ๊ฐ ๋๋ฌด ํฌ๊ฑฐ๋ ๋ชจ๋ธ์ด ๋๋ฌด ํผ
ํด๊ฒฐ: ๋ฐฐ์น ํฌ๊ธฐ ์ค์ด๊ธฐ, Gradient Checkpointing ์ฌ์ฉ, Mixed Precision Training ์ ์ฉ
๋ฌธ์ 2: GPU ์ฌ์ฉ๋ฅ ์ด ๋ฎ์ (30% ์ดํ)
์์ธ: ๋ฐ์ดํฐ ๋ก๋ฉ์ด ๋ณ๋ชฉ, ๋ฐฐ์น ํฌ๊ธฐ๊ฐ ๋๋ฌด ์์
ํด๊ฒฐ: num_workers ์ฆ๊ฐ, ๋ฐฐ์น ํฌ๊ธฐ ์ฆ๊ฐ, ๋ฐ์ดํฐ ์ ์ฒ๋ฆฌ ์ต์ ํ
๋ฌธ์ 3: "RuntimeError: CUDA error: device-side assert triggered"
์์ธ: ์๋ชป๋ ๋ ์ด๋ธ ์ธ๋ฑ์ค, ํ ์ ํฌ๊ธฐ ๋ถ์ผ์น
ํด๊ฒฐ: ๋ ์ด๋ธ ๋ฒ์ ํ์ธ, ํ ์ shape ๋๋ฒ๊น
๋ฌธ์ 4: ์ปจํ ์ด๋์์ GPU ์ธ์ ์ ๋จ
์์ธ: NVIDIA Container Toolkit ๋ฏธ์ค์น, Docker ์ค์ ์ค๋ฅ
ํด๊ฒฐ: nvidia-ctk runtime configure ์ฌ์คํ, Docker ์ฌ์์
๋ฌธ์ 5: ๋ฉํฐ GPU ํ์ต ์ ์๋๊ฐ ์ ํ์ ์ผ๋ก ์ฆ๊ฐํ์ง ์์
์์ธ: ํต์ ์ค๋ฒํค๋, ๋ฐฐ์น ํฌ๊ธฐ ๋ถ์กฑ
ํด๊ฒฐ: ๋ฐฐ์น ํฌ๊ธฐ ์ฆ๊ฐ, NCCL ์ต์ ํ, ๋ชจ๋ธ ๋ณ๋ ฌํ ๊ณ ๋ ค
๐ ๋ณด์ ๋ฐ ๋ฒ ์คํธ ํ๋ํฐ์ค
GPU ํ๊ฒฝ์ ๋น์ฉ์ด ๋ง์ด ๋ค๊ธฐ ๋๋ฌธ์ ๋ณด์๊ณผ ๋ฆฌ์์ค ๊ด๋ฆฌ๊ฐ ์ ๋ง ์ค์ํด! ์ค์๋ก ๋๊ตฐ๊ฐ ๋ฌดํ ๋ฃจํ๋ฅผ ๋๋ฆฌ๊ฑฐ๋ ํ๋ฉด... ๐ฑ
๐ก๏ธ ๋ณด์ ์ฒดํฌ๋ฆฌ์คํธ
โข ๋ฐฉํ๋ฒฝ ์ค์ ์ผ๋ก ํ์ํ ํฌํธ๋ง ๊ฐ๋ฐฉ
โข VPN ๋๋ Private Network ์ฌ์ฉ
โข Kubernetes NetworkPolicy๋ก Pod ๊ฐ ํต์ ์ ํ
2. ์ธ์ฆ ๋ฐ ๊ถํ ๊ด๋ฆฌ
โข Jupyter ๋น๋ฐ๋ฒํธ ์ค์ ํ์
โข RBAC(Role-Based Access Control) ๊ตฌ์ฑ
โข SSH ํค ๊ธฐ๋ฐ ์ธ์ฆ ์ฌ์ฉ
โข ์ ๊ธฐ์ ์ธ ๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ
3. ๋ฆฌ์์ค ์ฟผํฐ
โข Kubernetes ResourceQuota๋ก ๋ค์์คํ์ด์ค๋ณ ์ ํ
โข LimitRange๋ก Pod๋ณ ์ต๋ ๋ฆฌ์์ค ์ค์
โข GPU ์ฌ์ฉ ์๊ฐ ๋ชจ๋ํฐ๋ง ๋ฐ ์๋ฆผ
4. ์ปจํ ์ด๋ ๋ณด์
โข ์ต์ ๊ถํ ์์น (non-root ์ฌ์ฉ์)
โข ์ด๋ฏธ์ง ์ทจ์ฝ์ ์ค์บ (Trivy, Clair)
โข ์ ๋ขฐํ ์ ์๋ ๋ฒ ์ด์ค ์ด๋ฏธ์ง ์ฌ์ฉ
โข ์ ๊ธฐ์ ์ธ ์ด๋ฏธ์ง ์ ๋ฐ์ดํธ
5. ๋ฐ์ดํฐ ๋ณดํธ
โข ์ค์ ๋ฐ์ดํฐ ์ํธํ
โข ์ ๊ธฐ์ ์ธ ๋ฐฑ์
โข ์ ๊ทผ ๋ก๊ทธ ๊ธฐ๋ก ๋ฐ ๊ฐ์ฌ
# Kubernetes ResourceQuota ์์
apiVersion: v1
kind: ResourceQuota
metadata:
name: gpu-quota
namespace: ai-team-a
spec:
hard:
requests.nvidia.com/gpu: "4" # ์ต๋ 4๊ฐ GPU
limits.nvidia.com/gpu: "4"
requests.memory: "128Gi"
limits.memory: "256Gi"
requests.cpu: "32"
limits.cpu: "64"
---
apiVersion: v1
kind: LimitRange
metadata:
name: gpu-limit-range
namespace: ai-team-a
spec:
limits:
- max:
nvidia.com/gpu: "2" # Pod๋น ์ต๋ 2๊ฐ GPU
memory: "64Gi"
cpu: "16"
min:
memory: "1Gi"
cpu: "1"
type: Container
๐ ์ด์ ๋ฒ ์คํธ ํ๋ํฐ์ค
โข ๊ณตํต ๋ฒ ์ด์ค ์ด๋ฏธ์ง ๋ง๋ค์ด์ ์ฌ์ฌ์ฉ
โข ๋ฒ์ ํ๊ทธ ๋ช ํํ ๊ด๋ฆฌ (latest ํ๊ทธ ์ง์)
โข Private Registry ์ด์ (Harbor, GitLab Registry)
โข ๋ถํ์ํ ์ด๋ฏธ์ง ์ ๊ธฐ์ ์ผ๋ก ์ ๋ฆฌ
2. ์คํ ๊ด๋ฆฌ
โข MLflow, Weights & Biases ๋ฑ์ผ๋ก ์คํ ์ถ์
โข Git์ผ๋ก ์ฝ๋ ๋ฒ์ ๊ด๋ฆฌ
โข DVC๋ก ๋ฐ์ดํฐ์ ๋ฒ์ ๊ด๋ฆฌ
โข ์ฌํ ๊ฐ๋ฅํ ํ๊ฒฝ ๊ตฌ์ฑ (requirements.txt, environment.yml)
3. ๋น์ฉ ์ต์ ํ
โข Spot Instance ํ์ฉ (ํด๋ผ์ฐ๋)
โข ์๋ ์ค์ผ์ผ๋ง ์ค์
โข ๋ฏธ์ฌ์ฉ ๋ฆฌ์์ค ์๋ ์ ๋ฆฌ
โข GPU ๊ณต์ (MIG, Time-slicing)
4. ํ์ ํ๊ฒฝ
โข ๊ณต์ ๋ฐ์ดํฐ์ ๋๋ ํ ๋ฆฌ ๊ตฌ์ฑ
โข ๋ชจ๋ธ ์ฒดํฌํฌ์ธํธ ์ค์ ์ ์ฅ์
โข ๋ฌธ์ํ ๋ฐ ์ํค ์ด์
โข ์ ๊ธฐ์ ์ธ ํ ๋ฆฌ๋ทฐ ๋ฐ ์ง์ ๊ณต์
5. ์ฅ์ ๋์
โข ์๋ ์ฌ์์ ์ ์ฑ ์ค์
โข ์ฒดํฌํฌ์ธํธ ์ ๊ธฐ ์ ์ฅ
โข ์๋ฆผ ์์คํ ๊ตฌ์ถ (Slack, Email)
โข ์ฅ์ ๋์ ๋งค๋ด์ผ ์์ฑ
๐ ํ์ต ๋ฆฌ์์ค ๋ฐ ์ปค๋ฎค๋ํฐ
GPU ์ปจํ ์ด๋ ํ๊ฒฝ ๊ตฌ์ถ์ ๊ณ์ ๋ฐ์ ํ๋ ๋ถ์ผ์ผ. ์ต์ ์ ๋ณด๋ฅผ ๋ฐ๋ผ๊ฐ๊ณ ๋ฌธ์ ํด๊ฒฐ์ ์ํด ์ข์ ๋ฆฌ์์ค๋ค์ ์๊ฐํ ๊ฒ! ๐
๐ ๊ณต์ ๋ฌธ์
โข NVIDIA Container Toolkit: https://docs.nvidia.com/datacenter/cloud-native/
โข CUDA Documentation: https://docs.nvidia.com/cuda/
โข NVIDIA GPU Operator: https://docs.nvidia.com/datacenter/cloud-native/gpu-operator/
Docker ๊ด๋ จ
โข Docker Documentation: https://docs.docker.com/
โข Docker Compose: https://docs.docker.com/compose/
Kubernetes ๊ด๋ จ
โข Kubernetes Documentation: https://kubernetes.io/docs/
โข Kubeflow: https://www.kubeflow.org/docs/
โข KubeVirt: https://kubevirt.io/
ML/DL ํ๋ ์์ํฌ
โข PyTorch: https://pytorch.org/docs/
โข TensorFlow: https://www.tensorflow.org/guide
โข Hugging Face: https://huggingface.co/docs
๐ฅ ์ปค๋ฎค๋ํฐ ๋ฐ ํฌ๋ผ
๋งํ๋ ๋ถ๋ถ์ด ์์ ๋ ๋์์ ๋ฐ์ ์ ์๋ ๊ณณ๋ค์ด์ผ:
| ํ๋ซํผ | ํน์ง | ์ถ์ฒ ๋์ |
|---|---|---|
| Stack Overflow | ๊ธฐ์ ์ ์ง๋ฌธ ๋ฐ ๋ต๋ณ | ๊ตฌ์ฒด์ ์ธ ์๋ฌ ํด๊ฒฐ |
| GitHub Issues | ์คํ์์ค ํ๋ก์ ํธ ์ด์ | ๋ฒ๊ทธ ๋ฆฌํฌํธ, ๊ธฐ๋ฅ ์์ฒญ |
| Reddit (r/MachineLearning) | ์ต์ ํธ๋ ๋ ๋ฐ ๋ ผ์ | ์ ๊ณ ๋ํฅ ํ์ |
| Discord (AI/ML ์๋ฒ๋ค) | ์ค์๊ฐ ์ฑํ ๋ฐ ํ์ | ๋น ๋ฅธ ํผ๋๋ฐฑ |
| NVIDIA Developer Forums | NVIDIA ์ ํ ๊ด๋ จ | GPU ํนํ ๋ฌธ์ |
| Kubernetes Slack | K8s ์ปค๋ฎค๋ํฐ | ์ค์ผ์คํธ๋ ์ด์ ๊ด๋ จ |
๐ฏ ๋ง๋ฌด๋ฆฌํ๋ฉฐ
์, ์ฌ๊ธฐ๊น์ง GPU ์ปจํ ์ด๋ ํ๊ฒฝ ๊ตฌ์ถ์ ๋ํด ์์๋ดค์ด! ์ฒ์์๋ ๋ณต์กํด ๋ณด์ผ ์ ์์ง๋ง, ํ ๋ฒ ์ ๋๋ก ๊ตฌ์ถํด๋๋ฉด ์ ๋ง ํธํ๊ฒ AI ๊ฐ๋ฐ์ ํ ์ ์์ด. ๐
ํต์ฌ ๋ด์ฉ์ ๋ค์ ํ๋ฒ ์ ๋ฆฌํด๋ณผ๊ฒ:
โข NVIDIA Driver + Docker + NVIDIA Container Toolkit
โข ์ด 3๊ฐ์ง๋ง ์์ผ๋ฉด ๊ธฐ๋ณธ์ ์ธ GPU ์ปจํ ์ด๋ ์คํ ๊ฐ๋ฅ
2. ๊ฐ๋ฐ ํ๊ฒฝ
โข Dockerfile๋ก ์ฌํ ๊ฐ๋ฅํ ํ๊ฒฝ ๊ตฌ์ฑ
โข Docker Compose๋ก ๋ฉํฐ ์ปจํ ์ด๋ ๊ด๋ฆฌ
โข Jupyter Notebook์ผ๋ก ์ธํฐ๋ํฐ๋ธ ๊ฐ๋ฐ
3. ํ๋ก๋์ ํ๊ฒฝ
โข Kubernetes๋ก ๋๊ท๋ชจ ํด๋ฌ์คํฐ ๊ด๋ฆฌ
โข GPU Operator๋ก ์๋ํ๋ GPU ๊ด๋ฆฌ
โข MLflow, Kubeflow๋ก ML ํ์ดํ๋ผ์ธ ๊ตฌ์ถ
4. ์ต์ ํ
โข Mixed Precision Training์ผ๋ก ์๋ ํฅ์
โข ์ ์ ํ ๋ฐฐ์น ํฌ๊ธฐ์ DataLoader ์ค์
โข ๋ชจ๋ํฐ๋ง์ผ๋ก ๋ฆฌ์์ค ํ์ฉ๋ฅ ์ถ์
5. ๋ณด์ ๋ฐ ์ด์
โข ๋ฆฌ์์ค ์ฟผํฐ๋ก ๊ณต์ ํ ๋ถ๋ฐฐ
โข ์ ๊ธฐ์ ์ธ ๋ฐฑ์ ๋ฐ ์ ๋ฐ์ดํธ
โข ๋ฌธ์ํ ๋ฐ ํ ํ์ ์ฒด๊ณ ๊ตฌ์ถ
GPU ํ๊ฒฝ ๊ตฌ์ถ์ ํ ๋ฒ์ ์๋ฒฝํ๊ฒ ํ๊ธฐ ์ด๋ ค์. ์ฒ์์๋ ๊ฐ๋จํ๊ฒ ์์ํด์ ํ์์ ๋ฐ๋ผ ์ ์ง์ ์ผ๋ก ํ์ฅํ๋ ๊ฒ ์ข์. Docker๋ง์ผ๋ก ์์ํ๋ค๊ฐ ํ์ด ์ปค์ง๋ฉด Kubernetes๋ฅผ ๋์ ํ๊ณ , ์คํ์ด ๋ง์์ง๋ฉด MLflow๋ฅผ ์ถ๊ฐํ๋ ์์ผ๋ก ๋ง์ด์ผ! ๐
๊ทธ๋ฆฌ๊ณ ๊ฐ์ฅ ์ค์ํ ๊ฑด, ์ค์ ๋ก ํด๋ณด๋ ๊ฒ์ด์ผ! ์ด ๊ธ์ ์ฝ๋ ๊ฒ๋ง์ผ๋ก๋ ๋ถ์กฑํด. ์ง์ ์๋ฒ์ ์ ์ํด์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํ๊ณ , ์๋ฌ๋ฅผ ๋ง๋๊ณ , ํด๊ฒฐํ๋ฉด์ ๋ฐฐ์ฐ๋ ๊ฑฐ์ง. ์ฒ์์๋ ์ค์๋ ๋ง์ด ํ๊ณ ์๊ฐ๋ ์ค๋ ๊ฑธ๋ฆฌ๊ฒ ์ง๋ง, ๊ทธ๊ฒ ๋ค ๊ฒฝํ์ด ๋๋ ๊ฑฐ์ผ! ๐ช
ํน์ ๋งํ๋ ๋ถ๋ถ์ด ์๊ฑฐ๋ ๋์์ด ํ์ํ๋ฉด ์ปค๋ฎค๋ํฐ์ ์ง๋ฌธํ๊ฑฐ๋, ์ฌ๋ฅ๋ท ๊ฐ์ ํ๋ซํผ์์ ์ ๋ฌธ๊ฐ์ ๋์์ ๋ฐ๋ ๊ฒ๋ ์ข์ ๋ฐฉ๋ฒ์ด์ผ. ํผ์ ๋๋๋๋ฉด์ ์ผ์ฃผ์ผ ๊ฑธ๋ฆด ์ผ์ ์ ๋ฌธ๊ฐ์ ํจ๊ปํ๋ฉด ํ๋ฃจ ๋ง์ ํด๊ฒฐํ ์๋ ์๊ฑฐ๋ ! ๐
์, ์ด์ ๋น์ ์ GPU ์ปจํ ์ด๋ ํ๊ฒฝ์ ๊ตฌ์ถํ ์ฐจ๋ก์ผ! ํ์ดํ ! ๐โจ
๐ Happy GPU Computing! ๐
์ด ๊ธ์ด ๋์์ด ๋์๋ค๋ฉด, ๋น์ ์ AI ํ๋ก์ ํธ๊ฐ ์ฑ๊ณตํ๊ธฐ๋ฅผ ์์ํด!
๊ถ๊ธํ ์ ์ด ์๋ค๋ฉด ์ธ์ ๋ ์ปค๋ฎค๋ํฐ์ ์ง๋ฌธํ๊ฑฐ๋
์ฌ๋ฅ๋ท์์ ์ ๋ฌธ๊ฐ์ ๋์์ ๋ฐ์๋ณด์ธ์! ๐ก
๊ด๋ จ ํค์๋
๋๊ธ ์์ฑ
์ด ๊ธ์ ๋ํ ์ฌ๋ฌ๋ถ์ ์๊ฐ์ ๋ค๋ ค์ฃผ์ธ์
๋ก๊ทธ์ธ์ด ํ์ํฉ๋๋ค
๋๊ธ์ ์์ฑํ๋ ค๋ฉด ๋จผ์ ๋ก๊ทธ์ธํด์ฃผ์ธ์.
๋๊ธ 0
์ง์์ธ์ ์ฒ - ์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
- ์ ์๊ถ ๋ฐ ์์ ๊ถ: ๋ณธ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ๋ ์ AI ๊ธฐ์ ๋ก ์์ฑ๋์์ผ๋ฉฐ, ๋ํ๋ฏผ๊ตญ ์ ์๊ถ๋ฒ ๋ฐ ๊ตญ์ ์ ์๊ถ ํ์ฝ์ ์ํด ๋ณดํธ๋ฉ๋๋ค.
- AI ์์ฑ ์ปจํ ์ธ ์ ๋ฒ์ ์ง์: ๋ณธ AI ์์ฑ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ์ง์ ์ฐฝ์๋ฌผ๋ก ์ธ์ ๋๋ฉฐ, ๊ด๋ จ ๋ฒ๊ท์ ๋ฐ๋ผ ์ ์๊ถ ๋ณดํธ๋ฅผ ๋ฐ์ต๋๋ค.
- ์ฌ์ฉ ์ ํ: ์ฌ๋ฅ๋ท์ ๋ช ์์ ์๋ฉด ๋์ ์์ด ๋ณธ ์ปจํ ์ธ ๋ฅผ ๋ณต์ , ์์ , ๋ฐฐํฌ, ๋๋ ์์ ์ ์ผ๋ก ํ์ฉํ๋ ํ์๋ ์๊ฒฉํ ๊ธ์ง๋ฉ๋๋ค.
- ๋ฐ์ดํฐ ์์ง ๊ธ์ง: ๋ณธ ์ปจํ ์ธ ์ ๋ํ ๋ฌด๋จ ์คํฌ๋ํ, ํฌ๋กค๋ง, ๋ฐ ์๋ํ๋ ๋ฐ์ดํฐ ์์ง์ ๋ฒ์ ์ ์ฌ์ ๋์์ด ๋ฉ๋๋ค.
- AI ํ์ต ์ ํ: ์ฌ๋ฅ๋ท์ AI ์์ฑ ์ปจํ ์ธ ๋ฅผ ํ AI ๋ชจ๋ธ ํ์ต์ ๋ฌด๋จ ์ฌ์ฉํ๋ ํ์๋ ๊ธ์ง๋๋ฉฐ, ์ด๋ ์ง์ ์ฌ์ฐ๊ถ ์นจํด๋ก ๊ฐ์ฃผ๋ฉ๋๋ค.
์์ง ๋๊ธ์ด ์์ต๋๋ค.