Skip to content

Conversation

bhimrazy
Copy link
Collaborator

@bhimrazy bhimrazy commented Aug 19, 2025

What does this PR do?

Fixes #<issue_number>

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

📚 Documentation preview 📚: https://pytorch-lightning--21098.org.readthedocs.build/en/21098/

@github-actions github-actions bot added the fabric lightning.fabric.Fabric label Aug 19, 2025
@github-actions github-actions bot added the ci Continuous Integration label Aug 19, 2025
@github-actions github-actions bot added the pl Generic label for PyTorch Lightning package label Aug 20, 2025
@bhimrazy bhimrazy changed the title Fix: Simplify MPS availability check by removing platform dependency [wip] Simplify MPS availability check by removing platform dependency Aug 20, 2025
"""MPS is only available on a machine with the ARM-based Apple Silicon processors."""
mps_disabled = os.getenv("DISABLE_MPS", "0") == "1"
return not mps_disabled and torch.backends.mps.is_available() and platform.processor() in ("arm", "arm64")
return not mps_disabled and torch.backends.mps.is_available()
Copy link
Member

Choose a reason for hiding this comment

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

what's the issue with the current checks?

We cannot easily remove them. MPS marks as available on older intel-based macs as well while not actually accelerating anything.

Copy link
Member

Choose a reason for hiding this comment

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

that is why we add testing back with Intel to see what is happening and if we even have related tests to cover or refuse this change

Copy link
Member

Choose a reason for hiding this comment

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

Even if it passes, it is slower than CPU on intel-macs and due to auto-selection users would end up with a non-optimal backend.

@bhimrazy
Copy link
Collaborator Author

Marking it as ready just to trigger the tests, since it seems that in draft mode not all tests are triggered.

@bhimrazy bhimrazy marked this pull request as ready for review August 21, 2025 08:45
@bhimrazy bhimrazy changed the title [wip] Simplify MPS availability check by removing platform dependency [wip/exp] Simplify MPS availability check by removing platform dependency Aug 21, 2025
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87%. Comparing base (ff64a92) to head (f6310f7).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #21098   +/-   ##
=======================================
  Coverage      87%      87%           
=======================================
  Files         269      269           
  Lines       23514    23513    -1     
=======================================
+ Hits        20500    20502    +2     
+ Misses       3014     3011    -3     

@bhimrazy bhimrazy closed this Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants