You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module provides functions to initialize and clean up the distributed environment for tensor parallel distributed inference.
6
+
This module provides functions to initialize and clean up the distributed environment for tensor parallel distributed inference. These utilities are useful for tensor parallel distributed inference examples using torch.distributed.
7
7
"""
8
8
9
9
importlogging
@@ -19,8 +19,63 @@
19
19
logger=logging.getLogger(__name__)
20
20
21
21
22
-
# this is kept at the application level, when mpirun is used to run the application
# Conditionally register NCCL converters only if TensorRT-LLM plugin is available.
24
+
# We use an `if` statement instead of @needs_trtllm_for_nccl decorator because
25
+
# @dynamo_tensorrt_converter ALWAYS registers at import time regardless of decorator
26
+
# order. Conditional registration prevents registration when TRTLLM is unavailable,
27
+
# allowing fallback to PyTorch execution for NCCL ops.
28
+
29
+
# Order 1: @needs_trtllm_for_nccl followed by registering the converter leads to plugin registry not finding nccl ops plugins since we register the bare converter, without the decorator
30
+
# Order 2: registering the converter first followed by @needs_trtllm_for_nccl leads to "NotImplementedError: TensorRT-LLM plugin for NCCL is not available :TensorRT-LLM plugin for NCCL is not available" and no fall back to pytorch
31
+
ifENABLED_FEATURES.trtllm_for_nccl:
32
+
_LOGGER.debug(
33
+
"TensorRT-LLM plugin for NCCL is available. Registering NCCL converters."
0 commit comments