9bow
(박정환)
5월 18, 2022, 10:52오후
1
많은 분들께서 기다리고 기다리셨던,
Apple M1 칩에서의 GPU 가속 기능이 드디어, PyTorch 1.12부터 가능 해진다고 합니다!
기존의 cuda
장치처럼 mps
(Apple의 Metal Performance Shaders) 장치로 접근해서 사용할 수 있다고 합니다.
(아래 코드는 MPS Backend 문서 에서 가져왔습니다.)
mps_device = torch.device("mps")
# Create a Tensor directly on the mps device
x = torch.ones(5, device=mps_device)
# Or
x = torch.ones(5, device="mps")
# Any operation happens on the GPU
y = x * 2
# Move your model to mps just like any other device
model = YourFavoriteNet()
model.to(mps_device)
# Now every call runs on the GPU
pred = model(x)
아래와 같이 M1 Ultra에서 학습과 평가 모두 CPU 대비 월등한 성능 향상을 보여주는 것을 보실 수 있습니다.
자세한 공지는 아래에서 보실 수 있으며, Preview 버전(Nightly Build) 에서는 바로 사용할 수 있다고 합니다.
In collaboration with the Metal engineering team at Apple, we are excited to announce support for GPU-accelerated PyTorch training on Mac. Until now, PyTorch training on Mac only leveraged the CPU, but with the upcoming PyTorch v1.12 release,...
기존의 많은 사용자들의 요청과 아우성(…)은 아래 이슈에서 보실 수 있습니다
opened 10:05PM - 10 Nov 20 UTC
module: performance
triaged
## 🚀 Feature
Hi,
I was wondering if we could evaluate PyTorch's performance… on Apple's new M1 chip. I'm also wondering how we could possibly optimize Pytorch's capabilities on M1 GPUs/neural engines.
I know the issue of supporting acceleration frameworks outside of CUDA has been discussed in previous issues like #488..but I think this is worth a revisit. In Apple's big reveal today, we learned that Apple's on a roll with 50% of product usage growth being as a result of new users this year. Given that Apple is moving to these in-house designed chips, enhanced support for these chips could make deep learning on personal laptops a better experience for many researchers and engineers. I think this really aligns with PyTorch's theme of facilitating deep learning from research to production.
I'm not quite sure how this should go down. But these could be important:
1. A study on M1 chips
2. Evaluation of Pytorch's performance on M1 chips
3. Assessment on M1's compatibility with acceleration frameworks compatible with PyTorch (best bet would be CUDA transpilation..from what I see at #488)
4. Investigating enhancements to PyTorch that can take advantage of M1's ML features.
cc @VitalyFedyunin @ngimel
5개의 좋아요
9bow
(박정환)
이 글을 에 분리
5월 21, 2022, 3:10오전
2
9bow
(박정환)
5월 20, 2022, 12:26오후
4
다른 분들께도 필요할 것 같아서, 자주 묻는 질문&답변 게시판 에 정리해서 올렸습니다.
내용은 거의 같지만, 필요하신 분들이 계실 것 같아 아래 링크를 남깁니다.
공식 홈페이지 와 StackOverflow 등에서 자주 보이는 질문과 답변을 번역하고 있습니다.
몇 일 전 소식이 전해진, 많은 분들께서 오랜 시간 기다리셨고 또 궁금해하시는 Apple M1 칩이 탑재된 맥북 또는 맥미니, 맥스튜디오 등에서 GPU 가속 사용 방법을 정리해보려고 합니다.
질문
Apple M1이 탑재된 장치에서 GPU 가속을 사용하려면 어떻게 해야 하나요?
(또는, M1 칩이 탑재된 맥북 / 맥미니 / 맥스튜디오에서 PyTorch GPU 가속 기능을 하고 싶습니다.)
2개의 좋아요