Better vllm deletion
This commit is contained in:
parent
718961ded9
commit
a6439e9424
2 changed files with 10 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue