1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Apptainer(旧 Singularity)を使って簡単にOllamaでローカルLLMを動かす方法

Last updated at Posted at 2024-07-26

はじめに

スパコンやクラスタ環境ではApptainerが標準的に使用されています。ApptainerとOllamaを使うことで簡単にローカルLLMを動かすことができたので、手順を残します。TSUBAMEなどのスパコンを使う場合はインタラクティブキューを使用しましょう。

準備

  • Apptainerが導入されたマシンにログインします
  • メモリ容量の多いGPUマシンがいいです
  • 2セッション以上同時にログインできた方がいいです(tmuxでも可)

実行(Apptainerを使う場合)

  1. Ollamaのコンテナをダウンロードしてollama_latest.sifを取得します
    cd /your/working/directory/
    apptainer pull docker://ollama/ollama
    
  2. Ollamaのサーバーを起動します(GPUを使用する場合は--nvが必要です)
    apptainer run --nv ./ollama_latest.sif
    
  3. 新しいセッションでログインして、Ollamaを実行します。ここから好きなモデルを選びます
    cd /your/working/directory/
    ./ollama_latest.sif run llama3.1
    

おわり

以上の手順でApptainerとOllamaを使って簡単にローカルLLMが実行できます。Ollamaは複数GPUに自動でモデルを分散してくれるので、8GPU環境などでllama3.1:405bを動かすことも簡単にできます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?