Skip to content

Commit

Permalink
fix(abstractions): double deallocation in inference with continuous b…
Browse files Browse the repository at this point in the history
…ackends
  • Loading branch information
TianyiQ committed Dec 21, 2024
1 parent d2f3147 commit 26b552c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/abstractions/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ def vllm_free_gpu_memory():

try:
sgl.set_default_backend(sgl.RuntimeEndpoint(f"http://localhost:{port}"))
backend_key = None
connected = True
backend = None
print("Connected to backend.", flush=True)
Expand Down Expand Up @@ -671,7 +672,9 @@ def sglang_free_gpu_memory():
with open(f"{root}/output/backend_history.json", "r") as f:
backend_history = json.load(f)

backend_history.pop(backend_key)
if backend_key:
backend_history.pop(backend_key)

with open(f"{root}/output/backend_history.json", "w") as f:
json.dump(backend_history, f)

Expand Down

0 comments on commit 26b552c

Please sign in to comment.