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

Force cpu usage on macos-latest runners #114

Merged
merged 11 commits into from
May 31, 2024
Merged

Force cpu usage on macos-latest runners #114

merged 11 commits into from
May 31, 2024

Conversation

IgorTatarnikov
Copy link
Member

@IgorTatarnikov IgorTatarnikov commented May 30, 2024

Before submitting a pull request (PR), please read the contributing guide.

Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
Currently, the macos-latest does not have access to a GPU, however, torch.backends.mps.is_available() returns true leading to issues when keras tries to allocate a tensor on the GPU. This leads to errors during testing.

What does this PR do?
Forces keras and torch to use CPU when running on the macos-latest runner (identified by GITHUB_ACTIONS env variable and torch.backends.mps.is_available().

How has this PR been tested?

Tested locally and on CI.

Is this a breaking change?

No

Does this PR require an update to the documentation?

No

Checklist:

  • The code has been tested locally
  • The code has been formatted with pre-commit

Copy link

codecov bot commented May 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.83%. Comparing base (2cf2020) to head (39c4210).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #114      +/-   ##
==========================================
+ Coverage   85.64%   85.83%   +0.18%     
==========================================
  Files          16       17       +1     
  Lines         836      847      +11     
==========================================
+ Hits          716      727      +11     
  Misses        120      120              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@IgorTatarnikov IgorTatarnikov requested a review from a team May 31, 2024 10:37
@adamltyson
Copy link
Member

@IgorTatarnikov is this ready for review?

@IgorTatarnikov IgorTatarnikov marked this pull request as ready for review May 31, 2024 10:53
@IgorTatarnikov
Copy link
Member Author

Yes! Forgot to mark is as ready.

@adamltyson adamltyson merged commit 062bb53 into main May 31, 2024
12 checks passed
@adamltyson adamltyson deleted the macos-test-fix branch May 31, 2024 13:57
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.

2 participants