8000 Add memory cleanup calls in e2e integration tests by nikg4 · Pull Request #1277 · oumi-ai/oumi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add memory cleanup calls in e2e integration tests #1277

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

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions tests/e2e/test_eval_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pytest

from oumi.core.configs import EvaluationConfig
from oumi.utils.torch_utils import device_cleanup
from tests import get_configs_dir
from tests.e2e import get_e2e_test_output_dir
from tests.markers import requires_gpus
Expand Down Expand Up @@ -39,6 +40,7 @@ def _test_eval_impl(
interactive_logs: bool = True,
cleanup_output_dir_on_success: bool = True,
):
device_cleanup()
if test_config.skip:
pytest.skip(f"Skipped the test '{test_config.test_name}'!")
return
Expand Down Expand Up @@ -121,6 +123,7 @@ def _test_eval_impl(

shell_command = " ".join(cmd)
print(f"{test_tag} Running the command:\n{shell_command}\n")
device_cleanup()
result = subprocess.run(
shell_command,
shell=True,
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/test_train_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from oumi.core.configs import TrainingConfig
from oumi.core.configs.params.training_params import TrainerType
from oumi.utils.io_utils import load_json
from oumi.utils.torch_utils import device_cleanup
from tests import get_configs_dir
from tests.e2e import get_e2e_test_output_dir, is_file_not_empty
from tests.markers import requires_gpus
Expand Down Expand Up @@ -167,6 +168,7 @@ def _test_train_impl(
interactive_logs: bool = True,
cleanup_output_dir_on_success: bool = True,
):
device_cleanup()
if test_config.skip:
pytest.skip(f"Skipped the test '{test_config.test_name}'!")
return
Expand Down Expand Up @@ -242,6 +244,7 @@ def _test_train_impl(

shell_command = " ".join(cmd)
print(f"{test_tag} Running the command:\n{shell_command}\n")
device_cleanup()
result = subprocess.run(
shell_command,
shell=True,
Expand Down
0