Skip to content

Change the inference device on Mac#557

Merged
RVC-Boss merged 4 commits into
RVC-Boss:mainfrom
XXXXRT666:main
Feb 21, 2024
Merged

Change the inference device on Mac#557
RVC-Boss merged 4 commits into
RVC-Boss:mainfrom
XXXXRT666:main

Conversation

@XXXXRT666

Copy link
Copy Markdown
Contributor

Using CPU inference on Mac to accelerate inference speed and reduce memory leak

Change the inference device for Mac to accelerate inference and reduce memory leak
Change inference device to accelerate inference on Mac and reduce memory leak
@Lion-Wu

Lion-Wu commented Feb 21, 2024

Copy link
Copy Markdown
Contributor

elif torch.backends.mps.is_available():
    infer_device = "mps"

去掉,直接变成

else:
    infer_device = "cpu"

就可以了

@XXXXRT666

Copy link
Copy Markdown
Contributor Author

感谢指导,已修改

@Lion-Wu

Lion-Wu commented Feb 21, 2024

Copy link
Copy Markdown
Contributor

作者可参考 #516,Mac 使用 CPU 推理速度接近 GPU 速度的两倍,所以考虑暂时在Mac上使用CPU

@RVC-Boss

Copy link
Copy Markdown
Owner

@Lion-Wu 离谱,有人分析过为啥吗,是GPU太拉还是CPU太强还是pytorch-gpu对mps的软件优化有点拉还是模型结构特殊

@RVC-Boss RVC-Boss merged commit 7ee72be into RVC-Boss:main Feb 21, 2024
@Lion-Wu

Lion-Wu commented Feb 23, 2024

Copy link
Copy Markdown
Contributor

@Lion-Wu 离谱,有人分析过为啥吗,是GPU太拉还是CPU太强还是pytorch-gpu对mps的软件优化有点拉还是模型结构特殊

估计是mps优化的问题,我看GPU占用率忽高忽低的,没法用满,不过只在推理的时候出现这种特殊现象

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.

3 participants