サブロウ丸

Sabrou-mal サブロウ丸

主にプログラミングと数学

PyTorchでプロファイルを取得する。torch.profiler.profile

torch.profiler.profileの機能を使ってプロファイルを取ることができる。プロファイルとは要するにどの関数や処理でどれほどの時間を要しているのかを計測すること。 計測 # profiler setting if config.profile: prof = torch.profiler.profile( activities…

PytorchのDeviceMesh

DeviceMeshはGPUなどのリソースグループを管理するツールで、これを使えば分散学習に割り当てるGPUリソースを柔軟に割り当てられる。 分散並列手法にはいくつかの種類があり、大まかにデータ並列とモデル並列の二つがある。LLMのようなパラメータ数が多いモ…

NVIDIA SHARP; Error event recieved: event: RDMA_CM_EVENT_ROUTE_ERROR, error: -22; Local Port validation failed. error

NVIDIA SHARPを利用してreduce-scatterを実行しようとすると次のエラー。 [snail03:1:40413 unique id 139630260094914][2025-04-22 13:45:47] DEBUG collect_ports_data: found valid device (device mlx5_2 port 1) in at index 0 [snail02][Apr 22 13:45:…

マルチサーバ、マルチコンテナ(Docker)環境でのMPIプログラム実行

本稿ではホストネットワークを用いてマルチサーバーでマルチコンテナ環境でのMPI プログラムを実行する環境の作成を行います。 Docker Swarm ネットワークを用いた環境構築はこちら↓ コンテナの作成 準備 Dockerfile コンテナの起動 SSH 鍵の共有 実行 コン…

Pytorchにおける分散処理に関する情報のまとめ

Writing Distributed Applications with PyTorch — PyTorch Tutorials 2.6.0+cu124 documentation UCC-backend(ProcessGroupUCC)について ProcessGroupへの追加。Feb, 2022 [RFC] UCC integration in ProcessGroupNCCL · Issue #70654 · pytorch/pytorch ·…

Reduce_scatter と Reduce_scatter_block

OpenMPIにはReduce_scatterとReduce_scatter_blockの2種類の集団通信が定義されています。 Reduce_scatter MPI_Reduce_scatter(3) man page (version 4.1.8) それぞれのプロセスが持つデータを集約し、その結果を直和に配布します。 int MPI_Ireduce_scatter…

CUDA-aware OpenMPIのビルド

OpenMPIはCUDA-awareをサポートしている。 すなわち、集団通信実行の際に、(ホストメモリでなく)CUDA上のメモリポインタを渡してもそのまま動作するというもの。 https://www.open-mpi.org/faq/?category=runcuda#mpi-cuda-aware-support のコードを実行す…

NVIDIA GPU の Compute Capability 一覧

Compute Capability (CC) アーキテクチャ 代表的な GPU 主な特徴 compute_52 / sm_52 Maxwell GTX 970, GTX 980, GTX 980 Ti FP16 サポートなし compute_60 / sm_60 Pascal Tesla P100, GTX 1080 初の Pascal 世代、FP16 サポート compute_61 / sm_61 Pascal…

HCOLL

HCOLLはNVIDIA HPC-X Software Toolkitに内包されている、MPIの集団通信のためのコレクション。 ソースは公開されていない。 OpenMPIとの関係 OpenMPIからHCOLLで実装されている集団通信を呼び出すことができる。 OpenMPIとの関係性は図のようになっており、…

InfiniBand まとめ

都度更新 参考 とりあえず、まずこれを読む。 勉強 「InfiniBand vs. イーサネット: 両者は何か?」を読む - Sabrou-mal サブロウ丸 Verbsサンプルコード InfiniBand -- RC(Reliable Connection)でのpingpongサンプルコード - Sabrou-mal サブロウ丸

「InfiniBand vs. イーサネット: 両者は何か?」を読む

元記事: 知らない or 理解していないところを補填しながら読んでいきます。 10Gを超える高速ネットワークトラフィックの場合、すべてのパケットをアンパックすると、多くのリソースを消費することになります。第一世代のSDR InfiniBandは10Gbpsのレートで動…

InfiniBand -- RC(Reliable Connection)でのpingpongサンプルコード

コード test_rc.cpp · GitHub 概要 ここでは二つのプロセス (SenderとReceiver) を作成し、InfiniBandを介してデータを送信するコードを紹介します。 InfiniBand VerbsではQueryPair (QP)を使って、データの送受信を行う。このQPの状態をRESET → INIT → RT…

OpenMPIのコンパイル

MPI

本項ではOpenMPIの依存関係を含めてビルドを行う方法を OpenMPIの依存関係のグラフ Makefile 事前設定 依存関係のビルド libevent hwloc OpenPMIX PRRTE 通信ライブラリのビルド UCXのビルド UCCのビルド OpenMPI のビルド そのほか 事後処理 関連 参考 Open…

UCC(Unified Communication X)を使ってみる

UCCとは、集合通信操作APIであり、例えばOpenMPIから呼び出すことができます。 構成 OpenMPIから呼び出す どの通信レイヤ(Transport Layer)が使用されるか? 通信レイヤのスコア変更 参考 構成 ./src |-- coll_patterns ----- 集団通信パターンの実装(例:…

論文紹介: Congestion control in machine learning clusters (2022, Hot Topics in Networks)

紹介する論文 Rajasekaran, S., Ghobadi, M., Kumar, G., & Akella, A. (2022, November). Congestion control in machine learning clusters. In Proceedings of the 21st ACM Workshop on Hot Topics in Networks (pp. 235-242). まとめ モチベーション 先…

Compile error when compiling NCCL with debug mode.

I encountered the following error when I compiled NCCL project. /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o: in function `_init': (.init+0xb): relocation truncated to fit: R_X86_64_REX_GOTPCRELX against undefined symbo…

3D Parallelism

3D Parallelism の参考になる横田先生の資料。 https://fugaku100kei.jp/events/colloquium/doc/20240130_10th_colloquium_slides.pdf DeepSpeed https://www.deepspeed.ai/assets/files/DeepSpeed_Overview_Japanese_2023Jun7th.pdf

Nsight SystemsのMPIプログラムプロファイルがなかなか終了しない

MPI

nsys (NVIDIA Nsight Systems) Nsight Systems | NVIDIA Developer でMPIプログラムのプロファイルを取得する際に、MPIプログラムが終了したにも関わらずプロファイルの作成が終了しない場合。例えば下記の表示で止まっているときは、 The target applicatio…

Troubleshooting ImportError: cannot import name 'load_metric' from 'datasets'

from datasets import load_dataset, load_metric >>> ImportError: cannot import name 'load_metric' from 'datasets' について、datasetsのバージョン3.0.0のリリースノートにあるようにこのバージョンからload_metric がdatasets から取り除かれました、…

Test NCCL failure common.cu:1005 'unhandled cuda error (run with NCCL_DEBUG=INFO for details) ' .. pid 175547: Test failure common.cu:891

I encountered the following error when executing nccl-tests. tateiwa@snail01:/data/nccl-tests$ NCCL_DEBUG=INFO ./build/all_reduce_perf -g 2 # nThread 1 nGpus 2 minBytes 33554432 maxBytes 33554432 step: 1048576(bytes) warmup iters: 5 iters:…

Test NCCL failure common.cu:1005 'unhandled cuda error (run with NCCL_DEBUG=INFO for details) ' .. pid 175547: Test failure common.cu:891

nccl-testsを実行中に次のようなエラー。 tateiwa@snail01:/data/nccl-tests$ NCCL_DEBUG=INFO ./build/all_reduce_perf -g 2 # nThread 1 nGpus 2 minBytes 33554432 maxBytes 33554432 step: 1048576(bytes) warmup iters: 5 iters: 20 agg iters: 1 valid…

論文内容に関する指針

情報処理学会 latexテンプレート、情報処理学会論文誌ジャーナル論文の準備方法、に記載の論文内容に関する指針「べからず集」を引用。 5.1 書き方の基本 研究の新規性、有用性、信頼性を明確に記述し、読者に伝わるようにする。 読み手にとって読みやすい文…

How to fix: /dev/fd/12:2: command not found: compdef error

This post says that we can use the completion for the kubectl by executing echo "source <(kubectl completion zsh)" >> ~/.zshrc. However, in my environment, MacOS and zsh shell, I encountered the following error. /dev/fd/12:2: command not f…

Docker Swarmを活用したマルチサーバ、マルチコンテナ環境でのMPIプログラム実行

本稿では複数サーバー複数コンテナ環境でOpenmpi を実行する手順について紹介します。本稿ではコンテナ接続のネットワークとしてとしてDocker Swarmによるオーバーレイネットワークを利用します。 構築する環境 Docker Swarm: コンテナ間の通信確立 swarmの…

KeyError for from_pretrained in transformers

I encountered the following error while trying to execute the microsoft/phi-1 model in HuggingFace transformers module. Traceback (most recent call last): File "xxx.py", line 293, in <module> main(args) File "xxx.py", line 104, in main config = Au</module>…

huggingface transformers.Trainer で pytorch.autograd.profiler を使う

transformersのTrainerCallbackを継承してCallbackを作成しました。 次の関数を継承すれば、それぞれのイベントで実行されます。当然、一部のみ実装してもOK。 on_epoch_begin Event called at the beginning of an epoch. on_epoch_end Event called at the…

GPUにおけるカーネル

コンピューティングの文脈において「Kernel カーネル」には複数の意味があるが、CUDAやGPUプログラミングに関連して使用される場合は次のような意味を持つ。 GPUプログラミングにおけるカーネル GPUプログラミングにおいて「Kernel カーネル」とは、GPU上で…

apt-get のオプション

apt-get は Ubuntu や Debian などのディストリビューションで使用されるパッケージ管理ツール*1です。 以下は、apt-get installコマンドを使ってパッケージをインストールする際によく使われるオプションの一部です。(随時、追加予定) -y: --yesの省略形。…

Master mind in Rust; part 8 logging

今回やること log コード 参考 関連 前の記事: Master mind in Rust; part 6 ファイル分割とモジュール - Sabrou-mal サブロウ丸 次の記事: TBA 今回やること ログを出力する log Rustでは標準ライブラリにログを出力するためのlogというライブラリがあリま…

NetworkX: 'import networkx' fails: TypeError: entry_points() got an unexpected keyword argument 'group'

I encountered the following error in Python3.9 environment. NetworkX: 'import networkx' fails: TypeError: entry_points() got an unexpected keyword argument 'group' This error seems to be caused by the fact that NetworkX v3.3 does not suppo…