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

An attempt to add MPS device to torch backend #750

Merged
merged 2 commits into from
Aug 19, 2023
Merged

Conversation

M7Saad
Copy link
Contributor

@M7Saad M7Saad commented Aug 18, 2023

I attempted to incorporate MPS device and have already conducted testing across various models, datasets, and optimizers. However, I've encountered two current challenges:

1- There are certain performance issues present compared to CPU, even when excluding Keras Core from the equation, and using torch only
2- Some operators are not supported on MPS, and a temporary workaround involves setting PYTORCH_ENABLE_MPS_FALLBACK, though this does come at the cost of reduced speed.

@google-cla
Copy link

google-cla bot commented Aug 18, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looks good to me.

keras_core/backend/torch/core.py Outdated Show resolved Hide resolved
Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@fchollet fchollet merged commit c8aefb0 into keras-team:main Aug 19, 2023
6 checks passed
@dkgaraujo
Copy link
Contributor

Great that this is coming up. I guess with this PR, you could close keras-team/keras#18437 ?

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