@@ -937,7 +937,7 @@ def download_plugin_lib_path(platform: str) -> Iterator[str]:
937
937
yield plugin_lib_path
938
938
939
939
940
- def load_and_initialize_trtllm_plugin (plugin_lib_path : str ) -> bool :
940
+ def load_and_initialize_trtllm_plugin (plugin_lib_path : str , platform : str ) -> bool :
941
941
"""
942
942
Loads and initializes the TensorRT-LLM plugin from the given shared library path.
943
943
@@ -947,6 +947,9 @@ def load_and_initialize_trtllm_plugin(plugin_lib_path: str) -> bool:
947
947
Returns:
948
948
bool: True if successful, False otherwise.
949
949
"""
950
+ if "windows" in platform :
951
+ logger .info ("NCCL backend is not supported on Windows" )
952
+ return False
950
953
try :
951
954
handle = ctypes .CDLL (plugin_lib_path )
952
955
logger .info (f"Successfully loaded plugin library: { plugin_lib_path } " )
@@ -1002,8 +1005,10 @@ def load_tensorrt_llm() -> bool:
1002
1005
bool: True if the plugin was successfully loaded and initialized, False otherwise.
1003
1006
"""
1004
1007
plugin_lib_path = os .environ .get ("TRTLLM_PLUGINS_PATH" )
1008
+ platform = Platform .current_platform ()
1009
+ platform = str (platform ).lower ()
1005
1010
if plugin_lib_path :
1006
- return load_and_initialize_trtllm_plugin (plugin_lib_path )
1011
+ return load_and_initialize_trtllm_plugin (plugin_lib_path , platform )
1007
1012
else :
1008
1013
# this option can be used by user if TRTLLM_PLUGINS_PATH is not set by user
1009
1014
use_trtllm_plugin = os .environ .get ("USE_TRTLLM_PLUGINS" , "0" ).lower () in (
@@ -1017,10 +1022,7 @@ def load_tensorrt_llm() -> bool:
1017
1022
"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"
1018
1023
)
1019
1024
return False
1020
- else :
1021
- platform = Platform .current_platform ()
1022
- platform = str (platform ).lower ()
1023
1025
1024
1026
with download_plugin_lib_path (platform ) as plugin_lib_path :
1025
- return load_and_initialize_trtllm_plugin (plugin_lib_path )
1027
+ return load_and_initialize_trtllm_plugin (plugin_lib_path , platform )
1026
1028
return False
0 commit comments