Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以在MAC上跑吗? #6

Closed
taozhiyuai opened this issue Sep 11, 2024 · 1 comment
Closed

可以在MAC上跑吗? #6

taozhiyuai opened this issue Sep 11, 2024 · 1 comment
Labels
question Further information is requested

Comments

@taozhiyuai
Copy link

可以在MAC上跑吗?

@jingyaogong
Copy link
Owner

训练框架基本上是原生PyTorch

CPU完全支持训练

但是PyTorch对MAC的GPU支持貌似只对M1芯片及以上有效,具体如何启用可以参考:

how-to-enable-gpu-support-for-tensorflow-or-pytorch-on-macos

mac中pytorch使用

核心是把cuda换成mps

MPS 是 Apple 提供的用于 macOS 和 iOS 设备的高性能计算库,专门用于 Apple 的 GPU 上的加速计算。
CUDA 是 NVIDIA 提供的并行计算平台和 API 模型,专门用于 NVIDIA GPU 上的高性能计算。

device = torch.device("mps")
model = model.to(device)

BTW: 本人没有MAC设备供测试,不好意思~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants