[CI] fix: notebook ci often OOM (#20199)

This commit is contained in:
shuwenn
2026-03-10 13:32:41 +08:00
committed by GitHub
parent 591e61245a
commit 5a11ae19c1
3 changed files with 8 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ Do some monkey patch to make the documentation compilation faster and more relia
- Avoid port conflicts
- Reduce the server launch time
- Limit GPU memory usage to allow multiple servers on the same machine
"""
import weakref
@@ -26,6 +27,9 @@ def patched_post_init(self):
self.max_running_requests = DEFAULT_MAX_RUNNING_REQUESTS
if self.max_total_tokens is None:
self.max_total_tokens = DEFAULT_MAX_TOTAL_TOKENS
# Disable CUDA graphs to avoid memory spikes during capture.
# Notebooks only run a few sample requests, so perf is not critical.
self.disable_cuda_graph = True
self.cuda_graph_max_bs = 4
@@ -47,6 +51,7 @@ def launch_server_cmd(command: str, host: str = "0.0.0.0", port: int = None):
extra_flags = (
f"--max-running-requests {DEFAULT_MAX_RUNNING_REQUESTS} "
f"--max-total-tokens {DEFAULT_MAX_TOTAL_TOKENS} "
f"--disable-cuda-graph "
f"--cuda-graph-max-bs 4"
)