-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[Feature] m系列的mac启用gpu #152
Comments
I tried to use mps backend to run on gpu, but it seems to have a bug when calling the |
it seems to work! ! 步骤:
# flags required to enable jit fusion kernels
# torch._C._jit_set_profiling_mode(False)
# torch._C._jit_set_profiling_executor(False)
# torch._C._jit_override_can_fuse_on_cpu(True)
# torch._C._jit_override_can_fuse_on_gpu(True)
dtype = attention_scores.dtype
目前会有些警告,但是似乎不影响使用 需要改进的地方: |
@kingzeus 您好 请问您测试环境的pytorch版本和macOS版本分别是多少呢? |
macOS 13.2.1 |
@kingzeus 请问如何绕过 cpm_kernels 的 RuntimeError: Unknown platform: darwin 报错? |
目前来看,最简单的方法不要调用量化函数/不使用int4模型 |
@kingzeus 感谢你提供的方法。我们已经修改了HF hub上的 |
但是直接运行
|
Is your feature request related to a problem? Please describe.
mac下cpu运行非常慢
pytorch 在m系列的mac上可以支持GPU加速
Solutions
可以通过以下函数判断
torch.backends.mps.is_available()
修改
.half().cuda()
成float().to("mps")
运行返回

有解决办法么?
Additional context
No response
The text was updated successfully, but these errors were encountered: