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

Test with Metal backend #2507

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test_linux_pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
test:
# if PR has label "cuda tests" or "all tests" or if scheduled or manually triggered
# if PR has label "prerelease tests" or "all tests" or if scheduled or manually triggered
if: >-
(
contains(github.event.pull_request.labels.*.name, 'prerelease tests') ||
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/test_macos_m1.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test (MacOS M1)

on:
pull_request:
branches: [main, 1.1.x]
types: [labeled, synchronize, opened]
schedule:
- cron: "0 10 * * *" # runs at 10:00 UTC -> 03:00 PST every day
workflow_dispatch:
Expand All @@ -11,6 +14,15 @@ concurrency:

jobs:
test:
# if PR has label "metal tests" or "all tests" or "platform tests" if scheduled or manually triggered
if: >-
(
contains(github.event.pull_request.labels.*.name, 'metal tests') ||
contains(github.event.pull_request.labels.*.name, 'platform tests') ||
contains(github.event.pull_request.labels.*.name, 'all tests') ||
contains(github.event_name, 'schedule') ||
contains(github.event_name, 'workflow_dispatch')
)
runs-on: ${{ matrix.os }}
defaults:
run:
Expand Down Expand Up @@ -41,6 +53,10 @@ jobs:
run: |
python -m pip install --upgrade pip wheel

- name: Install Metal dependencies
run: |
pip install -U jax-metal numpy wheel ml-dtypes torch torchvision torchaudio

- name: Install dependencies
run: |
pip install ".[tests]"
Expand Down
5 changes: 0 additions & 5 deletions scvi/model/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,6 @@ def parse_device_args(
UserWarning,
stacklevel=settings.warnings_stacklevel,
)
elif _accelerator == "mps" and accelerator == "auto":
# auto accelerator should not default to mps
connector = _AcceleratorConnector(accelerator="cpu", devices=devices)
_accelerator = connector._accelerator_flag
_devices = connector._devices_flag
elif _accelerator == "mps" and accelerator != "auto":
warnings.warn(
"`accelerator` has been set to `mps`. Please note that not all PyTorch "
Expand Down