Skip to content
Draft
Changes from all 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
6 changes: 4 additions & 2 deletions test/test_ao_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import torch

from torchao._models.llama.model import Transformer
from torchao.utils import get_available_devices

_AVAILABLE_DEVICES = ["cpu"] + (["cuda"] if torch.cuda.is_available() else [])

_DEVICES = get_available_devices()


def init_model(name="stories15M", device="cpu", precision=torch.bfloat16):
Expand All @@ -17,7 +19,7 @@ def init_model(name="stories15M", device="cpu", precision=torch.bfloat16):
return model.eval()


@pytest.mark.parametrize("device", _AVAILABLE_DEVICES)
@pytest.mark.parametrize("device", _DEVICES)
@pytest.mark.parametrize("batch_size", [1, 4])
@pytest.mark.parametrize("is_training", [True, False])
def test_ao_llama_model_inference_mode(device, batch_size, is_training):
Expand Down