クラウドGPU環境の監査とハードウェア接続検証
Agent支援エンジニアリングチェック
前提条件
第56日リソース計画の計算およびSSH公開鍵暗号の基礎。
学習目標
Gitに秘密情報をコミットすることなく、リモートホストのGPU性能、CUDAランタイム、PyTorchのGPU認識を厳格に検証する。
手順
1. SSH鍵を用いた安全な接続手法(ssh -i ~/.ssh/id_rsa user@ip)を確認し、APIキーや秘密鍵をコードに埋め込まない原則を徹底します。
2. nvidia-smi コマンドを用いて契約通りのGPUモデルと物理VRAM容量が提供されているか照合します。
3. Python仮想環境内で torch.cuda.is_available()、デバイス名、デバイス数を確認します。
4. bfloat16のハードウェア対応状況(torch.cuda.is_bf16_supported())をチェックします。
演習と予測記録
リモート環境を検証する verify_env.py を作成し、GPU認識、VRAM容量(15GB以上)、BF16対応を検証して合格時に終了コード0を返すスクリプトを作成してください。
torch.cuda.get_device_properties(0).total_memory を用いてGB単位に変換します。
import torch, sys
def verify():
if not torch.cuda.is_available(): sys.exit(1)
vram_gb = torch.cuda.get_device_properties(0).total_memory / (1024**3)
if vram_gb < 15.0: sys.exit(1)
print(f'Verified GPU: {torch.cuda.get_device_name(0)} ({vram_gb:.1f} GB)')
verify()
認証情報を露出させることなく、リモートGPU環境の要件適合性を検証できる。
公式ソースリソースと権利証跡
CS336 Assignment 1: Basics (Spring 2025 tagged release)
該当セクション・タイムスタンプ: README setup; tests/adapters.py; tests/test_optimizer.py; tests/test_nn_utils.py; tests/test_serialization.py
検証バージョンと日付: spring2025 tag; README, tests and MIT LICENSE checked 2026-11-01
Lead assignment-driven source for pretraining component practice and tests. nanoGPT remains a compact historical code-reading companion, not the current recommended training curriculum.
Fluent Python, PyTorch, and linear algebra
Local self-contained pretraining scripts run on standard local CPUs or budget GPUs without Stanford cluster dependency.
比較対象候補リソースと選定評価 (2)
Simpler code layout, useful complementary reference for minimal PyTorch Transformer.
High-level API focus rather than building from raw tensor fundamentals.
nanoGPT: train.py pretraining loop
該当セクション・タイムスタンプ: train.py: system settings (device, dtype bfloat16/float16 selection, compile) and DDP settings
検証バージョンと日付: Git master commit 71c3905 (Verified: 2026-10-30)
Compact historical code reference for the named implementation functions; CS336 spring2025 provides the lead component exercises. Do not infer top-p, atomic persistence or cloud budget enforcement from nanoGPT.
Python, PyTorch, and Day 46-48 Transformer model architecture.
Runnable pretraining scripts and step-by-step tensor mechanics are fully self-contained in the curriculum lessons.
比較対象候補リソースと選定評価 (2)
Heavy abstraction layer wrapping distributed training; nanoGPT exposes raw PyTorch loops without framework overhead.
High-performance enterprise distributed framework; unsuitable for local educational first-principles comprehension.