diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37c51fbbb377..4f5b84698c22 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -488,6 +488,7 @@ common-files: &common_files | tests/integration/defs/accuracy/accuracy_core.py | tests/integration/defs/accuracy/scripts/collect_evaluated_accuracies.py | tests/integration/defs/accuracy/scripts/compute_theta_and_thresholds.py | + tests/integration/defs/accuracy/test_cli_flow.py | tests/integration/defs/accuracy/test_disaggregated_serving.py | tests/integration/defs/accuracy/test_llm_api_autodeploy.py | tests/integration/defs/accuracy/test_llm_api_pytorch.py | @@ -1258,6 +1259,7 @@ legacy-files: &legacy_files | tests/integration/defs/accuracy/accuracy_core.py | tests/integration/defs/accuracy/scripts/collect_evaluated_accuracies.py | tests/integration/defs/accuracy/scripts/compute_theta_and_thresholds.py | + tests/integration/defs/accuracy/test_cli_flow.py | tests/integration/defs/accuracy/test_disaggregated_serving.py | tests/integration/defs/accuracy/test_llm_api_autodeploy.py | tests/integration/defs/accuracy/test_llm_api_pytorch.py | diff --git a/legacy-files.txt b/legacy-files.txt index 021a4fb301a8..29648dcdbcff 100644 --- a/legacy-files.txt +++ b/legacy-files.txt @@ -480,6 +480,7 @@ tests/integration/defs/accuracy/__init__.py tests/integration/defs/accuracy/accuracy_core.py tests/integration/defs/accuracy/scripts/collect_evaluated_accuracies.py tests/integration/defs/accuracy/scripts/compute_theta_and_thresholds.py +tests/integration/defs/accuracy/test_cli_flow.py tests/integration/defs/accuracy/test_disaggregated_serving.py tests/integration/defs/accuracy/test_llm_api_autodeploy.py tests/integration/defs/accuracy/test_llm_api_pytorch.py diff --git a/pyproject.toml b/pyproject.toml index 2efd23c84d48..6a5d36801339 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -537,6 +537,7 @@ exclude = [ "tests/integration/defs/accuracy/accuracy_core.py", "tests/integration/defs/accuracy/scripts/collect_evaluated_accuracies.py", "tests/integration/defs/accuracy/scripts/compute_theta_and_thresholds.py", + "tests/integration/defs/accuracy/test_cli_flow.py", "tests/integration/defs/accuracy/test_disaggregated_serving.py", "tests/integration/defs/accuracy/test_llm_api_autodeploy.py", "tests/integration/defs/accuracy/test_llm_api_pytorch.py", diff --git a/ruff-legacy.toml b/ruff-legacy.toml index 39a722295b41..7e4897f0c374 100644 --- a/ruff-legacy.toml +++ b/ruff-legacy.toml @@ -497,6 +497,7 @@ include = [ "tests/integration/defs/accuracy/accuracy_core.py", "tests/integration/defs/accuracy/scripts/collect_evaluated_accuracies.py", "tests/integration/defs/accuracy/scripts/compute_theta_and_thresholds.py", + "tests/integration/defs/accuracy/test_cli_flow.py", "tests/integration/defs/accuracy/test_disaggregated_serving.py", "tests/integration/defs/accuracy/test_llm_api_autodeploy.py", "tests/integration/defs/accuracy/test_llm_api_pytorch.py", diff --git a/tensorrt_llm/llmapi/mpi_session.py b/tensorrt_llm/llmapi/mpi_session.py index 8f9264923782..93c863ff7b29 100644 --- a/tensorrt_llm/llmapi/mpi_session.py +++ b/tensorrt_llm/llmapi/mpi_session.py @@ -241,21 +241,25 @@ def __init__(self, n_workers: int, wait_shutdown: bool = False, env_overrides: Optional[Dict[str, str]] = None): - """Args: - n_workers: number of MPI workers to spawn. - wait_shutdown: when True, ``shutdown()`` blocks until the spawned - worker processes have actually exited. ``MPIPoolExecutor.shutdown`` - returns at disconnect, but a worker's GPU memory is only released - when its process exits; callers that start new GPU work right - after ``shutdown()`` (e.g. CI test infrastructure handing a - pre-spawned pool to the next test) race that release and can OOM. - Off by default: production teardown does not need the barrier and - keeps its current latency. - env_overrides: extra environment variables to set in the WORKERS at - spawn, on top of the TRTLLM*/TLLM* variables forwarded from the - parent. The parent process environment is never touched — this - replaces the racy "set os.environ around the spawn, then restore" - pattern for callers that spawn pools from background threads. + """Spawn a pool of MPI worker processes. + + Args: + n_workers: number of MPI workers to spawn. + wait_shutdown: when True, ``shutdown()`` blocks until the spawned + worker processes have actually exited. + ``MPIPoolExecutor.shutdown`` returns at disconnect, but a + worker's GPU memory is only released when its process exits; + callers that start new GPU work right after ``shutdown()`` + (e.g. CI test infrastructure handing a pre-spawned pool to the + next test) race that release and can OOM. Off by default: + production teardown does not need the barrier and keeps its + current latency. + env_overrides: extra environment variables to set in the WORKERS at + spawn, on top of the TRTLLM*/TLLM* variables forwarded from the + parent. The parent process environment is never touched — this + replaces the racy "set os.environ around the spawn, then + restore" pattern for callers that spawn pools from background + threads. """ self.n_workers = n_workers self._wait_shutdown = wait_shutdown