NVIDIA DGX Spark と Unsloth を使った LLM ファインチューニング
NVIDIA DGX Spark 上で OpenAI gpt-oss を使ってファインチューニングや強化学習(RL)を行う方法のチュートリアル。




⚡ ステップバイステップチュートリアル
1

2


3


ユニファイドメモリの使用状況


ビデオチュートリアル
最終更新
役に立ちましたか?
NVIDIA DGX Spark 上で OpenAI gpt-oss を使ってファインチューニングや強化学習(RL)を行う方法のチュートリアル。











最終更新
役に立ちましたか?
役に立ちましたか?
sudo apt update && sudo apt install -y wget
wget -O Dockerfile "https://raw.githubusercontent.com/unslothai/notebooks/main/Dockerfile_DGX_Spark"docker build -f Dockerfile -t unsloth-dgx-spark .FROM nvcr.io/nvidia/pytorch:25.09-py3
# CUDAの環境変数を設定
ENV CUDA_HOME=/usr/local/cuda-13.0/
ENV CUDA_PATH=$CUDA_HOME
ENV PATH=$CUDA_HOME/bin:$PATH
ENV LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
ENV C_INCLUDE_PATH=$CUDA_HOME/include:$C_INCLUDE_PATH
ENV CPLUS_INCLUDE_PATH=$CUDA_HOME/include:$CPLUS_INCLUDE_PATH
# 最新のBlackwellサポートのためにソースからtritonをインストール
RUN git clone https://github.com/triton-lang/triton.git && \
cd triton && \
git checkout c5d671f91d90f40900027382f98b17a3e04045f6 && \
pip install -r python/requirements.txt && \
pip install . && \
cd ..
# Blackwellサポートのためにソースからxformersをインストール
RUN git clone --depth=1 https://github.com/facebookresearch/xformers --recursive && \
cd xformers && \
export TORCH_CUDA_ARCH_LIST="12.1" && \
python setup.py install && \
cd ..
# unslothおよびその他の依存関係をインストール
RUN pip install unsloth unsloth_zoo bitsandbytes==0.48.0 transformers==4.56.2 trl==0.22.2
# シェルを起動
CMD ["/bin/bash"]docker run -it \
--gpus=all \
--net=host \
--ipc=host \
--ulimit memlock=-1 \
--ulimit stack=67108864 \
-v $(pwd):$(pwd) \
-v $HOME/.cache/huggingface:/root/.cache/huggingface \
-w $(pwd) \
unsloth-dgx-sparkNOTEBOOK_URL="https://raw.githubusercontent.com/unslothai/notebooks/refs/heads/main/nb/gpt_oss_(20B)_Reinforcement_Learning_2048_Game_DGX_Spark.ipynb"
wget -O "gpt_oss_20B_RL_2048_Game.ipynb" "$NOTEBOOK_URL"
jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser --allow-root