Colossal-AI 설치 — 요구사항과 설치 방법

Colossal-AI 설치

Colossal-AI를 설치하기 전에 요구사항을 확인하는 것이 좋아요. 설치 도중 문제가 생기면 저장소 이슈를 열어 해결할 수 있어요.

출처: https://colossalai.org/docs/get_started/installation/

요구사항

  • PyTorch >= 2.1
  • Python >= 3.7
  • CUDA >= 11.0
  • NVIDIA GPU Compute Capability >= 7.0 (V100/RTX20 이상)
  • Linux OS

현재는 Linux만 지원하니 주의해요.

pip 설치

pip install colossalai

PyTorch 확장을 설치 중에 빌드하려면 BUILD_EXT=1을 붙여요. 그렇지 않으면 확장은 런타임에 빌드돼요.

BUILD_EXT=1 pip install colossalai

소스에서 설치

git clone https://github.com/hpcaitech/ColossalAI.git
cd ColossalAI
# 의존성 설치
pip install -r requirements/requirements.txt
# colossalai 설치
BUILD_EXT=1 pip install .

CUDA 커널 퓨전을 활성화하지 않으려면(fused optimizer 사용 시 필수) BUILD_EXT를 지정하지 않아요.

pip install .

CUDA 10.2 사용자는 소스에서 빌드할 때 cub 라이브러리를 직접 다운로드해 복사해야 해요.

git clone https://github.com/hpcaitech/ColossalAI.git
cd ColossalAI
wget https://github.com/NVIDIA/cub/archive/refs/tags/1.8.0.zip
unzip 1.8.0.zip
cp -r cub-1.8.0/cub/ colossalai/kernel/cuda_native/csrc/kernels/include/
BUILD_EXT=1 pip install .

더 알아보기