Resources & References
Duration: 5 min
For Mac Users (Apple Silicon)
Official Documentation
Apple Silicon Resources
For Everyone Else (Google Colab)
Google Colab Setup
Google Colab provides free GPU access in the cloud. Perfect for learning PyTorch without buying hardware.
Getting Started:
- Go to colab.research.google.com
- Click "New notebook"
- Enable GPU: Runtime → Change runtime type → GPU
- Install PyTorch:
!pip install torch torchvision torchaudio
Example Colab Notebook:
import torch
# Check GPU
print(f"GPU available: {torch.cuda.is_available()}")
print(f"GPU name: {torch.cuda.get_device_name(0)}")
# Create tensor on GPU
x = torch.randn(1000, 1000, device='cuda')
y = torch.randn(1000, 1000, device='cuda')
# Matrix multiplication on GPU
z = torch.matmul(x, y)
print(f"Result shape: {z.shape}")Colab Limitations:
- Free tier: ~12 GPU hours/month
- Session timeout: 12 hours
- Limited to 1 GPU
- Perfect for learning, not production
Colab Resources:
General PyTorch Resources
Learning
- PyTorch Official Tutorials
- Deep Learning with PyTorch
- PyTorch Lightning - Simplified training
- Hugging Face Transformers - Pre-trained models
Datasets
- CIFAR-10 - Image classification
- ImageNet - Large-scale image dataset
- MNIST - Handwritten digits
- Hugging Face Datasets - Thousands of datasets
Tools
- Jupyter Notebook - Interactive development
- VS Code - Code editor
- Conda - Package management
- Git - Version control
Community
Choosing Your Setup
| Setup | Cost | Speed | Setup Time | Best For |
|---|---|---|---|---|
| Google Colab | Free (limited) | Fast GPU | 2 min | Learning, experimentation |
| MacBook Pro M1/M2 | $1,200-2,500 | 5-6x CPU | 5 min | Local development, privacy |
| AWS/GCP GPU | $0.30-1.00/hr | Very fast | 15 min | Production training |
| Local CPU | $0 | Slow | 5 min | Fundamentals, no budget |
Next Steps
After completing this course:
- Try in Colab: Run the code examples in Google Colab
- Build a Project: Apply PyTorch to your own dataset
- Explore Transfer Learning: Fine-tune pre-trained models
- Learn MLOps: Deploy models to production
- Join the Community: Share your work and learn from others
Troubleshooting
MPS not available?
- Ensure macOS 12.3+
- Update PyTorch:
pip install --upgrade torch - Check with:
torch.backends.mps.is_available()
Out of memory?
- Reduce batch size
- Use mixed precision (float16)
- Use gradient accumulation
- Monitor with
torch.mps.current_allocated_memory()
Slow training?
- Ensure model is on GPU/MPS device
- Check with:
next(model.parameters()).device - Profile with PyTorch Profiler
- Use mixed precision for 1.5-2x speedup
No GPU access?
- Use Google Colab (free)
- Use CPU (slower but works)
- Rent cloud GPU (AWS/GCP/Azure)
Feedback
Have questions or suggestions? Join our community:
Happy learning! 🚀