Skip to content

Add PyTorch MPS device support#11

Closed
Malek-AlAbed wants to merge 2 commits into
e0404:mainfrom
Malek-AlAbed:dev/mps_support
Closed

Add PyTorch MPS device support#11
Malek-AlAbed wants to merge 2 commits into
e0404:mainfrom
Malek-AlAbed:dev/mps_support

Conversation

@Malek-AlAbed

Copy link
Copy Markdown

Description

Closes #

Type of Change

  • Bug fix
  • Hotfix for a breaking change on main
  • New feature
  • Refactor
  • Interface to external software
  • DevOps / CI
  • Documentation
  • Other — please describe:

Checklist

  • This PR targets the develop branch (or main for hotfixes and documentation only).
  • The pre-commit hook has been run and all files are formatted (ruff).
  • Unit tests pass locally (pytest test).
  • New or changed code is covered by tests; coverage has not dropped significantly.
  • CHANGELOG.md has been updated in the [UNRELEASED] section following Keep a Changelog conventions.

Testing

Added a unit test function covering the MPS device selection logic to the script test/core/xp_utils/test_initialization.py

pytest test/core/xp_utils/test_initialization.py

Additional Notes

This PR adds support for Apple Metal Performance Shaders (MPS) devices when using the PyTorch backend.

Changes:

  • Detect PyTorch MPS availability in choose_device()
  • Return "mps" when MPS is available

@Malek-AlAbed

Copy link
Copy Markdown
Author

There is more to be done regarding the variables dtype before implementing it
MPS does not support double, and having the CT in float32 is not enough , it should go within calculating the dose matrix

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.

1 participant