Skip to content
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
6 changes: 5 additions & 1 deletion tensorrt_llm/commands/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ def launch_server(host: str,
server_role=server_role,
metadata_server_cfg=metadata_server_cfg)

# Optionally disable GC (default: not disabled)
if os.getenv("TRTLLM_SERVER_DISABLE_GC", "0") == "1":
gc.disable()

Comment thread
pcastonguay marked this conversation as resolved.
asyncio.run(server(host, port))


Expand Down Expand Up @@ -518,7 +522,7 @@ def disaggregated(config_file: Optional[str],
# increment, and observed that `count0` (obtained by `gc.get_count()`)
# increases by fewer than 1,000 after every 200,000 requests, while the
# maximum value of `count0` exceeded 3,000,000 during the test.
if int(os.getenv("TRTLLM_DISAGG_SERVER_DISABLE_GC", "1")):
if os.getenv("TRTLLM_DISAGG_SERVER_DISABLE_GC", "1") == "1":
gc.disable()

asyncio.run(server(disagg_cfg.hostname, disagg_cfg.port))
Expand Down
5 changes: 5 additions & 0 deletions tensorrt_llm/executor/worker.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gc
import json
import os
import time
Expand Down Expand Up @@ -413,6 +414,10 @@ def notify_proxy_threads_to_quit():
logger.error("Failed to deliver error message to proxy")
return

# Optionally disable GC (default: not disabled)
if os.getenv("TRTLLM_WORKER_DISABLE_GC", "0") == "1":
gc.disable()

with worker:
try:
worker.block_subordinates()
Expand Down