Skip to content

Commit

Permalink
Fixing GHA Hangs (#2265)
Browse files Browse the repository at this point in the history
* test commit

* update runners

* move pytest to transformers

* update import

* fix pathing

* don't automatically ifer reporters

* remove clearml

* my attempt to unclot GHA

* update model for commit tests

* fix export test

* can add back in clearml I think

* quality

* oops!

* remove clearml support

* PR comments

* QUALITY

* int tests

---------

Co-authored-by: dbogunowicz <[email protected]>
Co-authored-by: dbogunowicz <[email protected]>
  • Loading branch information
3 people authored May 8, 2024
1 parent 80ef58e commit a157dfd
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 44 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"tensorboardX>=1.0",
"evaluate>=0.4.1",
"parameterized",
"clearml==1.14.4",
]

_docs_deps = [
Expand Down
4 changes: 4 additions & 0 deletions src/sparseml/transformers/finetune/text_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ def apply(**kwargs):
"""
CLI entrypoint for any of training, eval, predict or oneshot
"""
report_to = kwargs.get("report_to", None)
model_args, data_args, training_args = parse_args(**kwargs)
training_args.run_stages = True
if report_to is None: # user didn't specify any reporters
# get rid of the reporters inferred from hugging face
training_args.report_to = []
main(model_args, data_args, training_args)


Expand Down
6 changes: 0 additions & 6 deletions tests/integrations/transformers/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,12 +507,6 @@ class _TransformersTrainArgs(BaseModel):
push_to_hub_token: str = Field(
default=None, description="The token to use to push to the Model Hub."
)
n_gpu_: int = Field(init=False, repr=False, default=-1)
mp_parameters: Optional[str] = Field(
default=None,
description="Used by the SageMaker launcher to send mp-specific args. "
"Ignored in Trainer",
)


class QuestionAnsweringArgs(_TransformersTrainArgs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ def setup(self, tmp_path, stub, task):

shutil.rmtree(tmp_path)

def test_export_initialized_model_no_source_path(self, setup):
def test_export_initialized_model_no_source_path(self, tmp_path, stub, task):
# export the transformer model, that is being passed to the
# `export` API directly as an object
source_path, target_path, task = setup
target_path = tmp_path / "target"
export(
model=SparseAutoModelForCausalLM.from_pretrained(source_path),
tokenizer=SparseAutoTokenizer.from_pretrained(source_path),
model=SparseAutoModelForCausalLM.from_pretrained(stub),
tokenizer=SparseAutoTokenizer.from_pretrained(stub),
target_path=target_path,
sequence_length=384,
task=task,
Expand All @@ -68,6 +68,8 @@ def test_export_initialized_model_no_source_path(self, setup):
inp.name == "past_key_values.0.key" for inp in onnx_model.graph.input
)

shutil.rmtree(tmp_path)

def test_export_happy_path(self, setup):
source_path, target_path, task = setup
export(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions tests/sparseml/pytorch/utils/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

import pytest

from sparseml.pytorch.utils import (
ClearMLLogger,
from sparseml.pytorch.utils import ( # ClearMLLogger,
LambdaLogger,
LoggerManager,
PythonLogger,
Expand All @@ -46,7 +45,8 @@
or True
),
*([WANDBLogger()] if WANDBLogger.available() else []),
*([ClearMLLogger()] if ClearMLLogger.available() else []),
# TODO: uncomment this once the ClearML server hanging is fixed
# *([ClearMLLogger()] if ClearMLLogger.available() else []),
SparsificationGroupLogger(
lambda_func=lambda tag, value, values, step, wall_time, level: logging.info(
f"{tag}, {value}, {values}, {step}, {wall_time}, {level}"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cadence: "commit"
test_type: "smoke"
tokenize: False
model: "TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T"
model: "Xenova/llama2.c-stories15M"
dataset: open_platypus
recipe: |
test_stage:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cadence: "commit"
test_type: "smoke"
tokenize: False
model: "Xenova/llama2.c-stories15M"
dataset: open_platypus
recipe: "tests/sparseml/transformers/oneshot/oneshot_configs/recipes/recipe.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cadence: "commit"
test_type: "smoke"
tokenize: False
model: "Xenova/llama2.c-stories15M"
dataset: "gsm8k"
dataset_config_name: "main"
recipe: "tests/sparseml/transformers/oneshot/oneshot_configs/recipes/recipe.yaml"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cadence: "commit"
test_type: "smoke"
tokenize: False
model: "TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T"
model: "Xenova/llama2.c-stories15M"
dataset: "gsm8k"
dataset_config_name: "main"
recipe: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cadence: "commit"
test_type: "smoke"
tokenize: True
model: "Xenova/llama2.c-stories15M"
dataset: open_platypus
recipe: "tests/sparseml/transformers/oneshot/oneshot_configs/recipes/recipe.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cadence: "commit"
test_type: "smoke"
tokenize: True
model: "Xenova/llama2.c-stories15M"
dataset: "gsm8k"
recipe: "tests/sparseml/transformers/oneshot/oneshot_configs/recipes/recipe.yaml"
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import pytest

from parameterized import parameterized_class
from tests.sparseml.pytorch.oneshot.dataset_processing import get_data_utils
from tests.sparseml.transformers.oneshot.dataset_processing import get_data_utils
from tests.testing_utils import parse_params, requires_torch


CONFIGS_DIRECTORY = "tests/sparseml/pytorch/oneshot/oneshot_configs"
CONFIGS_DIRECTORY = "tests/sparseml/transformers/oneshot/oneshot_configs"

# TODO: Seems better to mark test type (smoke, sanity, regression) as a marker as
# opposed to using a field in the config file?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from tests.testing_utils import parse_params, requires_torch, run_cli_command


CONFIGS_DIRECTORY = "tests/sparseml/pytorch/oneshot/oneshot_configs"
CONFIGS_DIRECTORY = "tests/sparseml/transformers/oneshot/oneshot_configs"


@pytest.mark.smoke
Expand Down

0 comments on commit a157dfd

Please sign in to comment.