Skip to content

Commit 1cf38ef

Browse files
committed
Further changes in error logging of the TRT-LLM installation tool
1 parent c075924 commit 1cf38ef

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

py/torch_tensorrt/dynamo/conversion/converter_utils.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ def download_plugin_lib_path(py_version: str, platform: str) -> str:
10141014
# Downloading TRT-LLM lib
10151015
# TODO: check how to fix the 0.18.0 hardcode below
10161016
base_url = "https://pypi.nvidia.com/tensorrt-llm/"
1017-
file_name = f"tensorrt_llm-0.18.0.post1-{py_version}-{py_version}-{platform}.whl"
1017+
file_name = f"tensorrt_llm-0.18.0-{py_version}-{py_version}-{platform}.whl"
10181018
download_url = base_url + file_name
10191019
cmd = ["wget", download_url]
10201020
if not (os.path.exists(file_name)):
@@ -1059,11 +1059,6 @@ def load_tensorrt_llm() -> bool:
10591059
"""
10601060
plugin_lib_path = os.environ.get("TRTLLM_PLUGINS_PATH")
10611061
if not plugin_lib_path:
1062-
_LOGGER.warning(
1063-
"Please set the TRTLLM_PLUGINS_PATH to the directory containing libnvinfer_plugin_tensorrt_llm.so to use converters for torch.distributed ops or else set the USE_TRTLLM_PLUGINS variable to download the shared library",
1064-
)
1065-
# for key, value in os.environ.items():
1066-
# print(f"{key}: {value}")
10671062
# this option can be used by user if TRTLLM_PLUGINS_PATH is not set by user
10681063
use_trtllm_plugin = os.environ.get("USE_TRTLLM_PLUGINS", "0").lower() in (
10691064
"1",
@@ -1073,7 +1068,7 @@ def load_tensorrt_llm() -> bool:
10731068
)
10741069
if not use_trtllm_plugin:
10751070
_LOGGER.warning(
1076-
"Neither TRTLLM_PLUGIN_PATH is set nor is it directed to download the shared library"
1071+
"Neither TRTLLM_PLUGIN_PATH is set nor is it directed to download the shared library. Please set either of the two to use TRT-LLM libraries in torchTRT"
10771072
)
10781073
return False
10791074
else:
@@ -1088,11 +1083,19 @@ def load_tensorrt_llm() -> bool:
10881083
handle = ctypes.CDLL(plugin_lib_path)
10891084
_LOGGER.info(f"Successfully loaded plugin library: {plugin_lib_path}")
10901085
except OSError as e_os_error:
1091-
_LOGGER.error(
1092-
f"Failed to load libnvinfer_plugin_tensorrt_llm.so from {plugin_lib_path}"
1093-
f"Ensure the path is correct and the library is compatible",
1094-
exc_info=e_os_error,
1095-
)
1086+
if "libmpi" in str(e_os_error):
1087+
_LOGGER.warning(
1088+
f"Failed to load libnvinfer_plugin_tensorrt_llm.so from {plugin_lib_path}. "
1089+
f"The dependency libmpi.so is missing. "
1090+
f"Please install the packages libmpich-dev and libopenmpi-dev.",
1091+
exc_info=e_os_error,
1092+
)
1093+
else:
1094+
_LOGGER.warning(
1095+
f"Failed to load libnvinfer_plugin_tensorrt_llm.so from {plugin_lib_path}"
1096+
f"Ensure the path is correct and the library is compatible",
1097+
exc_info=e_os_error,
1098+
)
10961099
return False
10971100

10981101
try:
@@ -1121,3 +1124,4 @@ def load_tensorrt_llm() -> bool:
11211124
exc_info=e_initialization_error,
11221125
)
11231126
return False
1127+
return False

0 commit comments

Comments
 (0)