Cloud GPU Environment Auditing and Hardware Verification
Agent-Assisted Engineering Check
Prerequisites
Day 56 Resource Planning calculations and SSH public-key cryptography.
Learning Objective
Verify GPU hardware capabilities, CUDA runtime, and torch.cuda availability on remote hosts without hardcoding credentials in git.
Instructions
1. Understand secure remote connection using SSH keys (ssh -i ~/.ssh/id_rsa user@remote_ip); never embed private keys or tokens in code.
2. Run nvidia-smi --query-gpu=name,memory.total,driver_version --format=csv to verify actual GPU hardware matches rental contracts.
3. Verify PyTorch CUDA integration in a fresh Python virtualenv: torch.cuda.is_available(), torch.cuda.get_device_name(0), and torch.cuda.device_count().
4. Check NCCL communication library and bfloat16 hardware support (torch.cuda.is_bf16_supported()).
Practice & Prediction Log
Write a remote environment validator script verify_env.py that checks Python version >= 3.10, PyTorch CUDA build, GPU device name, VRAM >= 15GB, and BF16 support. Exit with status 0 on pass or 1 on failure.
Check torch.cuda.get_device_properties(0).total_memory / (1024**3) >= 15.0.
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()
Produce a validator script that certifies remote environment specs without storing credentials.
Authoritative Source Resources & Provenance
CS336 Assignment 1: Basics (Spring 2025 tagged release)
Relevant Section / Range: README setup; tests/adapters.py; tests/test_optimizer.py; tests/test_nn_utils.py; tests/test_serialization.py
Verified Version & Date: 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.
Compared Candidate Sources & Selection Analysis (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
Relevant Section / Range: train.py: system settings (device, dtype bfloat16/float16 selection, compile) and DDP settings
Verified Version & Date: 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.
Compared Candidate Sources & Selection Analysis (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.