[lammps] GPU(KOKKOS/CUDA)ビルドモード追加・arch 可変(kugui A100 検証済み) - #202
Open
k-yoshimi wants to merge 2 commits into
Open
[lammps] GPU(KOKKOS/CUDA)ビルドモード追加・arch 可変(kugui A100 検証済み)#202k-yoshimi wants to merge 2 commits into
k-yoshimi wants to merge 2 commits into
Conversation
New config/gpu mode builds LAMMPS with the KOKKOS package and the CUDA backend, using the same package set as the default build. The target GPU architecture is a tunable: set KOKKOS_ARCH (e.g. AMPERE80 for A100, VOLTA70 for V100, HOPPER90 for H100, TURING75, ADA89, PASCAL60) so the same mode works across machines (kugui A100, clavius, ...). There is no default arch on purpose - a wrong arch yields binaries that will not run on the GPU - so the preprocess fails fast with a clear message when KOKKOS_ARCH is unset. Requires nvcc (a CUDA toolkit) and a CUDA-aware MPI on PATH; uses the nvcc_wrapper shipped with LAMMPS as the C++ compiler. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QaWKJsSQqCakkMEKZpJcvP
- install.sh: fail fast (before download/extract) when mode=gpu and KOKKOS_ARCH is unset, instead of only hitting the guard in preprocess after setup (Antigravity workflow risk) - config/gpu/preprocess.sh: reject a KOKKOS_ARCH with characters outside [A-Za-z0-9_] before it is spliced into the -DKokkos_ARCH_<NAME> option (Codex), and quote the nvcc_wrapper path; point the comment at the Kokkos configuration guide - document the gpu mode + the required KOKKOS_ARCH (and the wrong-arch runtime-failure caveat) in the en/ja README and the Sphinx appendix, for consistency with the espresso gpu mode Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QaWKJsSQqCakkMEKZpJcvP
Collaborator
Author
AI レビューサイクル結果(Codex + Antigravity)Phase 1 — Codex(コード correctness)
Phase 2 — Antigravity(ドキュメント / ワークフロー)
検証物性研 kugui(A100 cc80)で must_fix 系は無し/指摘は対応済み。収束と判断します。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
apps/lammps(stable_29Aug2024_update1, CMake)に GPU ビルドモードconfig/gpuを追加します。KOKKOS パッケージ + CUDA バックエンドで GPU 版lmpをビルドします。default と同じパッケージ集合(all_on + nolib)を GPU 加速する構成です。GPU arch を可変に(重要)
GPU の compute capability はマシンごとに異なるため(kugui=A100, clavius=別 arch 等)、
KOKKOS_ARCHを config.txt のチューナブル変数にしました:config/gpu/preprocess.shは-DKokkos_ARCH_${KOKKOS_ARCH}=ONを使用。${VAR:?...}で即座に分かりやすく失敗し、代表値(AMPERE80=A100,VOLTA70=V100,HOPPER90=H100,TURING75,ADA89,PASCAL60)を案内。KOKKOS_ARCHを変えるだけで対応可能。nvcc(CUDA toolkit)と CUDA-aware MPI が PATH 上に必要。LAMMPS 同梱の
nvcc_wrapperを C++ コンパイラに使用。stand-alone の GPU パッケージは無効化し KOKKOS を単一の GPU バックエンドに。検証(物性研 kugui, NVIDIA A100 cc80, PBS GPU ノード)
KOKKOS_ARCH=AMPERE80で configure 成功(Kokkos 4.3.1, Architecture AMPERE80, Backends OPENMP;CUDA, CUDA 12.4)。lmpがlibcudartにリンク。lmp -k on g 1 -sf kk -in bench/in.lj):KOKKOS mode ... will use up to 1 GPU(s) per node,attributes: ... kokkos_device, 5133 timesteps/s(exit 0)。留意点
all_onの MESONT パッケージが configure 時に行うポテンシャル DL は計算ノードで失敗する(configure はネットのあるノードで実施)。これは default ビルドと共通の既存挙動で GPU 固有ではない。🤖 Generated with Claude Code