本家様 https://bturo.pages.mpcdf.de/gapstop_tm/
git https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm
GPU Accelerated Python Stopgap for Template Matching
gapstop is able to leverage the power of GPU accelerated multi-node HPC
systems to be efficiently used for template matching. It speeds up template
matching by using an MPI-parallel layout and offloading the compute-heavy
correlation kernel to one or more accelerator devices per MPI-process
using JAX.
(google様翻訳:
GPU アクセラレーションによるテンプレート マッチングのための Python の暫定的な解決策,
gapstop は、GPU アクセラレーション マルチノード HPC システムのパワーを活用して、テンプレート マッチングに効率的に使用できます。
MPI 並列レイアウトを使用し、JAX を使用して計算負荷の高い相関カーネルを MPI プロセスごとに 1 つ以上のアクセラレータ デバイスにオフロードすることで、テンプレート マッチングを高速化します。
)
pyenv/anacondaで作ってます
まずconda環境を読み込みます
source /apps/pyenv/versions/anaconda3-2024.10-1/etc/profile.d/conda.sh
もしまだconda環境を作ってないなら
git clone https://github.com/yyuu/pyenv.git /apps/pyenv
export PYENV_ROOT=/apps/pyenv
export PATH=$PYENV_ROOT/bin:$PATH
pyenv install anaconda3-2024.10-1
source /apps/pyenv/versions/anaconda3-2024.10-1/etc/profile.d/conda.sh
として構築開始
[root@rockylinux9 ~]# dnf install environment-modules openmpi-devel
[root@rockylinux9 ~]# source /etc/profile.d/modules.sh
[root@rockylinux9 ~]# module load mpi/openmpi-x86_64 <-- mpi4pyのコンパイルのために環境をロードしておきます
[root@rockylinux9 ~]# conda create -n GAPSTOP_TM pip -c conda-forge
[root@rockylinux9 ~]# conda activate GAPSTOP_TM
(GAPSTOP_TM) [root@rockylinux9 ~]# pip install "gapstop @ git+https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm.git"
Collecting gapstop@ git+https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm.git
Cloning https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm.git to /tmp/pip-install-qeplj5d9/gapstop_0501ddf738c64c0bb42c4ee239975d2d
Running command git clone --filter=blob:none --quiet https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm.git /tmp/pip-install-qeplj5d9/gapstop_0501ddf738c64c0bb42c4ee239975d2d
Resolved https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm.git to commit a7463559ed716c6b71028d546675a3caa5089f4d
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
WARNING: Generating metadata for package gapstop produced metadata for project name gapstop-tm. Fix your #egg=gapstop fragments.
Discarding git+https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm.git: Requested gapstop-tm from git+https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm.git has inconsistent name: expected 'gapstop', but metadata has 'gapstop-tm'
ERROR: Could not find a version that satisfies the requirement gapstop (unavailable) (from versions: none)
ERROR: No matching distribution found for gapstop (unavailable)
(GAPSTOP_TM) [root@rockylinux9 ~]#
とエラーになってしまった.
なので、gitを拾ってそこで作ってみた.
(GAPSTOP_TM) [root@rockylinux9 ~]# cd /apps/src
(GAPSTOP_TM) [root@rockylinux9 src]# git clone https://gitlab.mpcdf.mpg.de/bturo/gapstop_tm
(GAPSTOP_TM) [root@rockylinux9 src]# cd gapstop_tm
(GAPSTOP_TM) [root@rockylinux9 gapstop_tm]# pip install -e .[cuda12] あるいは pip install -e .[cpu]
(GAPSTOP_TM) [root@rockylinux9 gapstop_tm]# conda deactivate
[root@rockylinux9 gapstop_tm]#
「/apps/modulefiles/GAPSTOP_TM」
#%Module1.0
set root /apps/pyenv/versions/anaconda3-2024.02-1/envs/GAPSTOP_TM
prepend-path PATH $root/bin
prepend-path LD_LIBRARY_PATH $root/lib
cuda12にすれば、jaxが入っているようでその確認をします
[root@rockylinux9 ~]# module load GAPSTOP_TM
[root@rockylinux9 ~]# python
Python 3.13.2 | packaged by conda-forge | (main, Feb 17 2025, 14:10:22) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import jax
cpuにAVXが含まれていないとエラーになる...