Pitagora / Workflow Meetup Japan
サーバtazro.ohta [at] chiba-u.jp
途中参加、途中退出は自由です。初めて参加される方はぜひ 過ごし方ガイド をご覧ください。
Time | |
---|---|
13:00-13:15 | 今日の作業確認 |
13:15-17:00 | 開発とディスカッション |
17:00-18:00 | ラップアップ |
18:00- | 有識者会議 |
transformers
on Jupyter Notebook in Docker container on a local machine with NVIDIA GPU をやる
$ nvidia-smi
Wed Jan 10 23:29:35 2024
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.05 Driver Version: 525.85.05 CUDA Version: 12.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA RTX 6000... On | 00000000:2D:00.0 Off | Off |
| 30% 27C P8 3W / 300W | 82MiB / 49140MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1333 G /usr/lib/xorg/Xorg 63MiB |
| 0 N/A N/A 1480 G /usr/bin/gnome-shell 16MiB |
+-----------------------------------------------------------------------------+
$ sudo apt update -y && apt install -y curl
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh ./get-docker.sh
$ sudo usermod -aG docker $USER
$ docker info
$ 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/stable/deb/nvidia-container-toolkit.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-get update -y
$ sudo apt-get install -y nvidia-container-toolkit
$ sudo docker run --rm --gpus all nvidia/cuda:12.0.0-base-ubuntu20.04 nvidia-smi
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
$ sudo service docker restart
$ docker run --rm --gpus all quay.io/jupyter/pytorch-notebook:2024-01-08 nvidia-smi
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.05 Driver Version: 525.85.05 CUDA Version: 12.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA RTX 6000... On | 00000000:2D:00.0 Off | Off |
| 30% 27C P8 2W / 300W | 82MiB / 49140MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
+-----------------------------------------------------------------------------+
$ docker run -d --name nb -p 8888:8888 --rm --gpus all quay.io/jupyter/pytorch-notebook:2024-01-08
$ docker run --rm -it --gpus all quay.io/jupyter/pytorch-notebook:2024-01-08 bash
$ python3
>>> import torch; torch.cuda.is_available()
False
$ cat Dockerfile
FROM nvidia/cuda:12.0.0-base-ubuntu20.04
USER root
COPY ./requirements.txt /tmp
WORKDIR /code
RUN apt update -y && apt upgrade -y && apt install -y curl python3 python3-distutils
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py
RUN pip install -r /tmp/requirements.txt
$ cat requirements.txt
jupyter
jupyterlab
numpy
pandas
matplotlib
scikit-learn
scikit-image
scipy
torch
torchvision
transformers
$ docker build . -t gpu-notebook:20240111
$ docker run --rm -it --gpus all gpu-notebook:20240111 bash
$ python3
>>> import torch; torch.cuda.is_available()
True
todo
python -c "import torch; print(torch.cuda.is_available()); print(torch.cuda.current_device()); print(torch.cuda.device_count())"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/koki/anaconda3/envs/pytorch/lib/python3.11/site-packages/torch/cuda/__init__.py", line 769, in current_device
_lazy_init()
File "/home/koki/anaconda3/envs/pytorch/lib/python3.11/site-packages/torch/cuda/__init__.py", line 289, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
mamba
、もしくはvirtualenv
)nvidia-smi
Thu Jan 11 14:17:21 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.86.10 Driver Version: 535.86.10 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
...
nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Jun_13_19:16:58_PDT_2023
Cuda compilation tools, release 12.2, V12.2.91
Build cuda_12.2.r12.2/compiler.32965470_0
mamba create
でまとめてツールをインストールしようとすると1日がかり(チャンネル数が多いせい?キャッシュが溜まってる?)
mamba create -n pytorch python=3.11 pytorch torchvision torchaudio tensorboard pandas matplotlib jupyterlab python-graphviz pot -c conda-forge -c anaconda -c pytorch -c nvidia -y
mamba create -n test pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia -y
Could not solve for environment specs
The following package could not be installed
└─ pytorch-cuda 12.2** does not exist (perhaps a typo or a missing channel).
mamba create
→ その中でmamba install
の方が早い
conda activate test
mamba install -c conda-forge tensorboard -y
mamba install -c conda-forge pandas -y
mamba install -c conda-forge matplotlib -y
mamba install -c anaconda jupyterlab -y
mamba install -c conda-forge python-graphviz -y
mamba install -c conda-forge pot -y
apache sparkをクラスター上で実行するため
超高速なファイルシステムがあれば、HDFSを利用しなくても共有ファイルに対してsparkを実行すればよいよ(遺伝研ではそうしている[丹生])
tataki
: バイオインフォマティクス関連ファイルのファイル形式を判定するコマンドラインツール。(i.e. hoge.fa
は本当にFASTAなのか、を調べる)
tataki
の仕様をdiscussionした
tataki.conf
) の書き方EDAM_1.25.csv
を改変してtataki
側に組み込む際のライセンスを確認。CC BY-SA 4.0 DEED
のShareAlike
あるけど引用をちゃんと記述すれば大丈夫そう。論文の構成を考えていた