Skip to content

Conversation

missflash
Copy link
Contributor

Added Apple Silicon GPU device

if torch.backends.mps.is_available():
    device = torch.device("mps")   # Apple Silicon GPU (Metal)
elif torch.cuda.is_available():
    device = torch.device("cuda")  # NVIDIA GPU
else:
    device = torch.device("cpu")   # CPU fallback

print(f"Using device: {device}")

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@rasbt
Copy link
Owner

rasbt commented Sep 13, 2025

Hi there, thanks for the PR. I agree that mps can be added here as it's not one of the main chapters (for the main chapters I don't recommend mps yet because of the current instability and numerical differences).

I tried to make a few updates to leave "cuda" as the default but when I pushed it, it created a new branch over at #820. I think that's because you did the PR from a main branch instead of a feature branch in your fork. Long story short, I am closing this in favor of #820 but don't worry, your contributions are counted in #820.

@rasbt rasbt closed this Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants