Learning Notes - July 2, 2024
Downloading PyTorch
Cell Command Execution Environment
Investigating where cell commands run -- initial assessment is that they run in the Jupyter startup environment rather than the corresponding virtual environment, meaning they do not run directly in the current virtual environment.

This form must be used to run commands in the specified environment within a notebook.
Place what you want to run after &&
! source ~/anaconda3/bin/activate Deep_Learing && pip install pandas

Checking if PyTorch is Properly Configured

Use the following code for testing
CUDA
import torch
# Print PyTorch version
print(torch.__version__)
# Check if CUDA (GPU) is available
print(torch.cuda.is_available())
MPS
import torch
# Print PyTorch version
print(torch.__version__)
# Check if MPS is available
if torch.backends.mps.is_available():
mps_device = torch.device("mps")
print("MPS device is available.")
else:
print("MPS device is not available.")
It's Running



Speed Test
M2 CPU: 62.8s

M2 GPU: 23.8s

4090: 15.37s


12 vCPU Intel(R) Xeon(R) Platinum 8352V: 28s
