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

adds TPU to CI. #981

Merged
merged 19 commits into from
Apr 26, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tpu-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ jobs:
export XRT_WORKERS="localservice:0;grpc://localhost:40934"

python -c "import torch_xla; print('torch xla version:', torch_xla.__version__)"
py.test -vvv tests -m tpu
py.test --cov ignite --cov-append --cov-report term-missing tests/ -vvv -m tpu
7 changes: 6 additions & 1 deletion tests/ignite/engine/test_create_supervised.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
from ignite.engine.engine import Events
from ignite.metrics import MeanSquaredError

try:
import torch_xla.core.xla_model as xm
has_xla = True
except ImportError:
has_xla = False

def test_create_supervised_trainer():
model = Linear(1, 1)
Expand Down Expand Up @@ -103,7 +108,7 @@ def test_create_supervised_trainer_on_cuda():
assert model.bias.item() == approx(0.8)


@pytest.mark.tpu
@pytest.mark.skipif(not has_xla, reason="Skip if no TPU")
def test_create_supervised_trainer_on_tpu():
device = "xla"
model = Linear(1, 1)
Expand Down