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

Move clearml tests to appropriate place to unblock GHA #2234

Merged
merged 9 commits into from
Apr 17, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,11 @@

from clearml import Task
from sparseml.transformers import apply
from sparseml.utils import is_package_available


is_torch_available = is_package_available("torch")
if is_torch_available:
import torch

torch_err = None
else:
torch = object
torch_err = ModuleNotFoundError(
"`torch` is not installed, use `pip install torch` to log to Weights and Biases"
)


def test_oneshot_and_finetune(tmp_path: Path):
recipe_str = "tests/sparseml/transformers/finetune/test_alternate_recipe.yaml"
model = "Xenova/llama2.c-stories15M"
device = "cuda:0"
if is_torch_available and not torch.cuda.is_available():
device = "cpu"
dataset = "wikitext"
dataset_config_name = "wikitext-2-raw-v1"
concatenate_data = True
Expand All @@ -59,5 +43,4 @@ def test_oneshot_and_finetune(tmp_path: Path):
max_steps=max_steps,
concatenate_data=concatenate_data,
splits=splits,
oneshot_device=device,
)
Loading