Better vllm deletion

This commit is contained in:
Daniel Han 2025-05-04 05:03:58 -07:00
commit a6439e9424
2 changed files with 10 additions and 1 deletions

View file

@ -26,6 +26,7 @@ import time
from unsloth_zoo.vllm_utils import (
load_vllm,
patch_vllm,
delete_vllm,
)
import numpy as np
@ -189,6 +190,14 @@ class SyntheticDataKit:
for _ in range(10):
torch.cuda.empty_cache()
gc.collect()
# Delete vLLM module as well
# We delete llm.llm_engine.model_executor, so first make it accessible
class Dummy0: model_executor = 1
class Dummy1: llm_engine = Dummy0()
class Dummy2: llm = Dummy1()
llm = Dummy2().llm.llm_engine.model_executor
delete_vllm(llm)
pass
def __enter__(self): return self

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "2025.4.7"
__version__ = "2025.4.8"
__all__ = [
"SUPPORTS_BFLOAT16",