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

fix: supported mps in macOS #21

Merged
merged 1 commit into from
May 29, 2024
Merged

fix: supported mps in macOS #21

merged 1 commit into from
May 29, 2024

Conversation

zgx949
Copy link
Contributor

@zgx949 zgx949 commented May 26, 2024

增加对macOS的mps支持
close #20

@Tau-J
Copy link
Owner

Tau-J commented May 29, 2024

LGTM

@Tau-J Tau-J merged commit f1fce5e into Tau-J:main May 29, 2024
@wep21
Copy link

wep21 commented May 30, 2024

By the way, does MPSExecutionProvider exist? I cannot find the provider in the document.

@Tau-J
Copy link
Owner

Tau-J commented May 30, 2024

@wep21 I've test on my macbookpro, the code can run and be accelerated properly.

@zgx949
Copy link
Contributor Author

zgx949 commented May 30, 2024

@wep21

onnxruntime.get_available_providers()

try this code for test?
image

@wep21
Copy link

wep21 commented May 30, 2024

In my environment,

❯ python3 -c "import onnxruntime;print(onnxruntime.get_available_providers())"
['CoreMLExecutionProvider', 'AzureExecutionProvider', 'CPUExecutionProvider']

So, is return 'CoreMLExecutionProvider' in providers correct?

@zgx949
Copy link
Contributor Author

zgx949 commented May 30, 2024

@wep21

In my environment,

❯ python3 -c "import onnxruntime;print(onnxruntime.get_available_providers())"
['CoreMLExecutionProvider', 'AzureExecutionProvider', 'CPUExecutionProvider']

So, is return 'CoreMLExecutionProvider' in providers correct?

Yes, it is just a judgement.

code of onnxruntime device map:

    'onnxruntime': {
        'cpu': 'CPUExecutionProvider',
        'cuda': 'CUDAExecutionProvider',
        'mps': 'CoreMLExecutionProvider' if check_mps_support() else 'CPUExecutionProvider'

    },

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.

mps support
3 participants