本文へ移動
cccskills
無料GitHub で公開日本語紹介

nvshmem-configure-nic-pe-mapping

NVSHMEMで使うGPUと通信ポートの接続構成を調べ、処理単位への割り当てと環境変数を提案します。複数NICの選択や、構成に基づく設定診断に使えます。

原文原文の説明を見る

Recommend NVSHMEM NIC-to-PE mappings and environment exports. Use for HCA selection, multi-NIC configuration, or topology-based mapping diagnostics.

インストール方法を見る

こんなときに便利

  • GPUに近い通信ポートを選びたいとき
  • バージョン別の複数NIC対応確認
  • 想定外のポート選択を診断したいとき
  • 再現可能な割り当て設定の作成

日本語での紹介

できること

NVSHMEMの各PE(並列処理の単位)に、どの通信ポートを割り当てるかを提案します。対象ノードのGPUとNICの接続関係、ポートの稼働状態、PEとGPUの対応を確認し、距離と負荷の偏りを考慮した割り当て表と環境変数をまとめます。NVSHMEMのバージョンと通信方式に応じて、複数NICを使う選択肢も整理します。

こんなときに便利

GPUを複数搭載した計算ノードで通信アダプターを選びたいときや、設定後に想定外のポートが選ばれる原因を調べたいときに向いています。必要な情報が不足している場合は、確定設定を出す前に不足点を示します。

使い方の例

  • 「4つのPEをGPU 0〜3に割り当てています。この収集結果から近いポートと環境変数を提案して」
  • 「NVSHMEM 3.7とIBGDAで、複数NICを使える条件を確認して」

注意点

GPUとRDMAデバイスが見える計算ノード、およびnvidia-smiなどの情報が必要です。ログインノードの構成は根拠に使いません。接続距離に基づく提案は性能向上を保証せず、実際の処理で検証が必要です。UCXとlibfabricには設定範囲の制約があります。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(14)

  • SKILL.md14.7 KB
  • BENCHMARK.md10.7 KB
  • evals/evals.json15.9 KB
  • evals/files/ambiguous-two-gpu-two-ib.txt448 B
  • evals/files/four-gpu-four-ib.txt1.1 KB
  • evals/files/four-gpu-two-ib.txt618 B
  • evals/files/mixed-link-inactive.txt829 B
  • evals/files/two-gpu-five-ib.txt817 B
  • evals/files/two-gpu-four-ib.txt840 B
  • references/topology-and-output.md11.0 KB
  • references/version-transport-matrix.md11.1 KB
  • scripts/collect-nic-topology.sh8.2 KB
  • skill-card.md3.9 KB
  • skill.oms.sig6.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Tune NVSHMEM NIC-to-PE Mapping

Purpose

Produce a reproducible recommendation from the target node's actual GPU/NIC topology. Do not promise a performance improvement; present the mapping as a topology-informed starting point that must be validated.

Requirements

  • Use an allocated target compute node with visible GPUs and RDMA devices; do not use login-node topology as evidence.
  • Make nvidia-smi and /sys/class/infiniband readable on that node. If /sys is unavailable, make ibv_devinfo available or provide equivalent per-port evidence.
  • Provide the NVSHMEM installation prefix, make nvshmem-info available on the target node, or supply the installed NVSHMEM version explicitly.
  • Use the bundled read-only collector when possible. It requires no API keys, credentials, package installation, or writable filesystem access.

Inputs

Resolve every required input before emitting exact exports. If values from different sources conflict, identify the conflict and request clarification rather than selecting a value silently.

Required inputs

  • NVSHMEM version: Prefer the user-confirmed installed version; otherwise use the collector's [nvshmem-version] output, then nvshmem-info -n on the target node. Retain the complete reported version after normalizing a leading v.
  • Remote transport: Prefer the explicitly selected transport for the target run; otherwise use the target node's NVSHMEM initialization log. Do not infer a transport from topology; request a log when automatic selection is ambiguous.
  • Local PE count: Prefer observed per-rank logs, then launcher configuration, then an explicit user-provided count. Confirm that all evidence describes the same node allocation.
  • Ordered local PE -> GPU index or PCI BDF binding: Prefer observed per-rank binding logs, then launcher binding configuration, then an explicit user mapping. Use CUDA_VISIBLE_DEVICES only when its rank order is explicitly established.
  • Target-node GPU/NIC and HCA-port topology: Prefer the newest complete output from scripts/collect-nic-topology.sh on the target node. Otherwise use the listed nvidia-smi commands plus per-port /sys/class/infiniband or ibv_devinfo evidence. Include GPU and NIC PCI BDFs, port state, and link layer.

Optional inputs

  • Requested link layer: Use the user's explicit InfiniBand or Ethernet/RoCE preference. If absent, choose from observed active ports as described in step 5.
  • Excess-port policy: Use the user's explicit request to select a closest subset or use multiple NICs per PE. If absent, present supported alternatives conditionally and make no selection.
  • Current official documentation or citations: Obtain only when the user requests them or the version/transport matrix is insufficient. Use $nvshmem-docs for that check.

Scripts

ScriptUseInvocation
scripts/collect-nic-topology.shCollect read-only NVSHMEM version, GPU PCI, GPU/NIC topology, and RDMA-port evidence. It emits all evidence to stdout and may exit nonzero after producing useful partial output.Resolve the script from this skill directory and invoke run_script("scripts/collect-nic-topology.sh", "--prefix", "/absolute/nvshmem/prefix") when the prefix is known, or omit --prefix to use environment/PATH discovery.

Read the Required References

  • Read references/version-transport-matrix.md before interpreting or emitting any mapping variable.
  • Read references/topology-and-output.md before ranking NICs or formatting a recommendation.
  • Treat the bundled NVSHMEM 3.8 or later BLOCK contract as authoritative within its recorded transport scope. Do not invoke $nvshmem-docs merely to revalidate behavior that this contract resolves, including for releases later than 3.8.

Instructions

1. Resolve the NVSHMEM Version and Transport

Obtain the version from the user first. Otherwise use the collector's [nvshmem-version] evidence or run nvshmem-info -n when it is already available on the target node. Normalize a leading v and retain the complete reported version.

Classify the release as:

  • 3.7 or earlier;
  • 3.8 or later.

Do not assume latest or silently treat an unknown version as 3.8. If the version remains unknown, request the installed version before continuing.

Determine the selected remote transport: IBRC, IBDevX, IBGDA, GPUNetIO, UCX, or libfabric. If automatic selection makes the transport ambiguous, ask for the relevant initialization log or the intended transport.

2. Resolve Documentation Uncertainty

Use references/version-transport-matrix.md as the default authority for mapping behavior. Do not invoke $nvshmem-docs when the matrix or the bundled NVSHMEM 3.8 or later BLOCK contract resolves the version, transport, feature gate, and required mapping controls, including for a release later than 3.8.

Invoke the sibling $nvshmem-docs skill at ../nvshmem-docs/SKILL.md only when the matrix and bundled contract are insufficient or conflicting, exact feature-version applicability remains unclear, or the user explicitly requests live official documentation or citations. Follow that skill's version and citation workflow.

If a documentation check is needed but the sibling skill, an HTTPS retrieval tool, or the live official pages are unavailable:

  • continue from the matrix only when it resolves the needed behavior;
  • otherwise withhold final exports and identify the unresolved behavior;
  • label Documentation freshness: unverified only when a documentation check was attempted;
  • state which official routes could not be checked; and
  • never invent a behavior that the matrix does not establish.

When a documentation check is performed, report the exact documentation edition consulted and any remaining uncertainty. Otherwise identify the applicable matrix section as the basis for the recommendation.

3. Collect Topology Evidence

When already running on the target compute node, tell the user that the skill is running a read-only collector. Before its first invocation in the current checkout, inspect the complete bundled collector script. Run only that inspected file; if it is unavailable or incomplete, do not execute it. Then run:

run_script("scripts/collect-nic-topology.sh")

When the NVSHMEM installation prefix is known, pass its absolute path explicitly:

run_script("scripts/collect-nic-topology.sh", "--prefix", "/opt/nvshmem")

Replace the example path with the absolute prefix. Without --prefix, discovery uses NVSHMEM_PREFIX, then nvshmem-info on PATH. Prefix libraries are scoped to that query. Exit 2 indicates incomplete evidence.

When not on the target node, ask the user for the collector's complete output from the target node. If the script is unavailable remotely, request all of:

nvshmem-info -n
nvidia-smi --query-gpu=index,pci.bus_id,name --format=csv,noheader
nvidia-smi topo -m

Also request, for every candidate HCA port, its HCA name, port number, PCI BDF, state, and link layer from /sys/class/infiniband or ibv_devinfo.

Do not run a collector from a login node and treat that topology as compute-node evidence.

4. Establish PE Placement

Obtain the number of local PEs per node. Assume nodes are homogeneous only after stating that assumption.

Obtain the ordered local PE -> GPU index or PCI BDF binding from explicit user input, launcher configuration, CUDA_VISIBLE_DEVICES, or per-rank logs. Do not infer a local PE's GPU solely from PE count or the order displayed by nvidia-smi topo -m.

If the binding is ambiguous, request it before producing an exact closest-NIC mapping. A conditional table is acceptable, but final exports are not. Do not bypass the missing binding by duplicating every usable NIC for every PE; that adds non-closest paths and is a different multi-port policy. Consider such an all-ports assignment only after the user explicitly requests it and accepts the distance tradeoff.

5. Filter and Rank Candidate Ports

Treat an HCA port, not merely an HCA device, as the selectable NIC unit.

  • Exclude inactive or physically down ports and record why each was excluded.
  • Partition active ports by link layer. Do not mix InfiniBand with Ethernet/RoCE by default.
  • Honor an explicitly requested link layer. Otherwise choose the larger active partition; prefer InfiniBand on an exact tie. Ask the user if that default conflicts with their fabric or provider intent.
  • Rank each bound GPU-to-port pair by PIX < PXB < PHB < NODE < SYS from nvidia-smi topo -m.
  • Break equal-distance choices by lower assigned-port load, then canonical hca:port order.
  • Share a port when fewer usable ports than PEs makes sharing necessary, while preserving distance first and balance second.

6. Resolve Excess NICs Explicitly

When usable NIC ports outnumber local PEs, stop before final exports and ask whether to:

  1. select the closest balanced subset; or
  2. use multiple NICs per PE.

Offer option 2 only when the resolved version and transport support it according to the matrix. Explain whether multi-NIC requires automatic distance assignment or supports an explicit BLOCK mapping. If the user does not answer, show both supported alternatives as conditional recommendations and do not choose silently.

If the user asked to use all NICs but the resolved version/transport does not support multi-NIC, explain the restriction and request approval to use the closest subset. Do not treat the unsupported request as implicit approval for a subset, and do not emit final exports until the user confirms it. When only the subset is supported, present that single supported choice for confirmation instead of offering a disabled multi-NIC option.

7. Synthesize Exactly One Selection Mechanism

Prefer NVSHMEM_HCA_PE_MAPPING for exact assignments. Use NVSHMEM_HCA_LIST only when selecting an eligible set and accepting transport-canonical ordering. Never set both variables.

Apply the version/transport rules in the matrix exactly:

  • For 3.7 and earlier, preserve one expanded mapping slot per PE for explicit IB mappings. Use automatic distance assignment for supported multi-NIC paths.
  • For 3.8 or later, apply the bundled BLOCK contract: set NVSHMEM_ENABLE_NIC_PE_MAPPING=1 for explicit assignments and NVSHMEM_ENABLE_MULTI_PORT=1 whenever recommending more than one NIC per PE.
  • For UCX and libfabric, explain the provider-controlled boundary and do not fabricate common-HCA exact mappings.

Build NVSHMEM_HCA_PE_MAPPING with explicit hca:port:count entries. Expand every count before explaining which slots each PE receives. Preserve duplicates when intentional sharing is required.

Keep a mapping-only export block limited to NIC-assignment controls. Do not add NVSHMEM_REMOTE_TRANSPORT or provider/launcher settings merely because the transport is known; include them only when the user separately asks to select the transport and the matrix, or documentation when needed, verifies the value.

8. Return the Recommendation

Execute the Output Contract in order; that reference is the single authority for output fields, formatting, withholding messages, and validation guidance.

Treat its Mapping and Exact Exports sections as mandatory gates. Do not return until each gate is either completed or explicitly withheld for the reason allowed by the contract. Do not duplicate or paraphrase the contract in this file.

Examples

  • “My 4 local PEs are bound to GPUs 0–3. Given this target-node collector output and NVSHMEM 3.8.0 IBRC, recommend the closest balanced InfiniBand port mapping and exact exports.”
  • “Interpret this nvidia-smi topo -m and per-port state/link-layer output. NVSHMEM is 3.7 with IBGDA; identify whether multiple NICs per PE are supported and what extra evidence is needed before emitting exports.”
  • “We have 2 PEs and 5 active Ethernet/RoCE ports. Use this PE-to-GPU binding and initialization log to show the supported subset and multi-NIC alternatives without selecting one silently.”

Troubleshooting

SymptomResponse
The collector reports status=partial, an unknown NVSHMEM version, missing GPUs, or no HCA ports.Re-run it on an allocated target compute node with the intended NVSHMEM installation and NVIDIA/RDMA device visibility. Paste the complete labeled output; a nonzero exit may still contain usable evidence.
No exact mapping can be produced.Obtain the NVSHMEM version, resolved remote transport, local PE-to-GPU binding, and active-port evidence. Give only conditional guidance until all are available.
Ports have mixed link layers or a requested port is inactive.Exclude inactive ports and select one link-layer partition unless the user explicitly requests another supported fabric.
NVSHMEM behavior is unclear for the selected version or transport.Check the version/transport matrix first, then invoke $nvshmem-docs only if it remains insufficient or the user requires current official citations.
Logs select unexpected ports after applying the mapping.Verify the export block, PE binding, selected transport, and provider constraints; compare against the unforced automatic configuration before changing other settings.

Limitations

  • Limit recommendations to the observed target-node topology and port state; repeat evidence collection after hardware, fabric, launcher, or binding changes.
  • Treat topology proximity as a selection heuristic, not a performance guarantee; validate with a representative workload.
  • Do not produce an exact mapping until the NVSHMEM version, transport, local PE-to-GPU binding, and usable-port evidence are resolved.
  • For UCX and libfabric, remain within the provider-controlled boundary and do not fabricate common-HCA mapping settings.

Guardrails

  • Do not select inactive ports or silently mix link layers.
  • Do not assume that a numerically matching GPU and NIC index implies proximity.
  • Do not turn an unknown PE-to-GPU binding into an all-ports-per-PE mapping.
  • Do not emit 3.8-or-later BLOCK behavior for 3.7 or earlier.
  • Do not emit legacy IBGDA multi-port controls as the primary 3.8-or-later control.
  • Do not generate provider-native UCX or libfabric settings; explain them without inventing values.
  • Do not overwrite user files or change the system while collecting evidence.
<!-- ci trigger -->

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

accelerated-computing-cudf

無料概要あり

pandasで扱う表データ処理をcuDFでGPUへ移す作業を支援します。結合・集計・CSVやParquet入出力から、結果の照合、メモリ対策、複数GPU利用まで扱います。

  • 既存pandas処理を少ない変更で加速
  • 結合や集計をGPUへ移したいとき
  • 欠損値や並び順をpandasと照合
NVIDIA/skills3,6892026年10月22日 更新

NVIDIA Nemotron Voice Agentのサンプルを変更し、別のバックエンドを設けずに予約受付や患者情報の聞き取りを行う音声エージェントを作るスキル。

  • 予約受付の音声エージェント作成
  • 患者情報5項目の会話による収集
  • 独自の医療受付とツール呼び出し設計
NVIDIA/skills3,6892026年10月22日 更新

amc-run-rtsp-calibration

無料概要あり

ライブカメラのRTSP映像をVIOSで録画し、AutoMagicCalibでカメラ校正を進めます。設定や位置合わせ資料の取り込み、進捗確認、結果取得まで扱います。

  • ライブ映像でカメラ校正をしたいとき
  • 現場用の設定と位置合わせ資料を登録
  • 正解データを使った校正結果の評価
NVIDIA/skills3,6892026年10月22日 更新

amc-run-sample-calibration

無料概要あり

同梱の倉庫カメラ映像でAMCのカメラ校正を一通り実行し、正解データとの誤差を確認します。導入後の動作検証や、実データ投入前の確認に使えます。

  • 導入直後のAMCを動作確認したいとき
  • サンプルの校正誤差を確認したいとき
  • Swagger UIで手順を確認したいとき
NVIDIA/skills3,6892026年10月22日 更新

amc-run-video-calibration

無料概要あり

録画済みの複数カメラ映像をAutoMagicCalibに送り、カメラの位置や向きを調整する処理を、プロジェクト作成から進捗確認・結果評価まで進めます。

  • 同期済みMP4からカメラを調整したいとき
  • ローカル設定や対応点ファイルの登録
  • 正解データで調整結果を評価したいとき
NVIDIA/skills3,6892026年10月22日 更新

amc-setup-calibration-stack

無料概要あり

AutoMagicCalibの自動キャリブレーション環境をDocker Composeで構築し、NGC認証からポート設定、サービスとWeb UIの起動確認まで進めます。

  • AutoMagicCalibとWeb UIの起動
  • サービスポートと接続先の設定
  • 任意のVGGTモデルの導入
NVIDIA/skills3,6892026年10月22日 更新

NVIDIA のスキルをすべて見る

このスキルの問題を報告する