Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

[ CI ] Fix Failing Magic Wand Test #311

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Changes from 1 commit
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: 2 additions & 0 deletions tests/models_core/test_magic_wand.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Run `pytest tests/models/test_compressed.py`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you fix this doc line while you're in here?

"""

import gc
import pytest

from tests.models.utils import check_logprobs_close
Expand Down Expand Up @@ -47,6 +48,7 @@ def test_magic_wand(
dense_outputs = dense_model.generate_greedy_logprobs(
example_prompts, max_tokens, num_logprobs)
del dense_model
gc.collect()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should you also gc.collect() the sparse_model down below too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script is over by then, so not needed. We just need to make sure the dense model is cleaned up before we start the sparse model

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved, but wondering if we should try to encapsulate cleanup in a helper function. even if "gc.collect()" isn't always needed it might be good practice.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about for the next test, though? are we guaranteed that everything is cleaned up by then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep


sparse_model = vllm_runner(
model_name=model_name,
Expand Down
Loading