@@ -255,19 +255,6 @@ def set_log_level(parent_logger: Any, level: Any) -> None:
255
255
"""
256
256
if parent_logger :
257
257
parent_logger .setLevel (level )
258
- print ("Handlers for parent_logger:" , parent_logger .handlers )
259
- print ("bool check--" , parent_logger .hasHandlers ())
260
- if parent_logger .hasHandlers ():
261
- ch = logging .StreamHandler ()
262
- ch .setLevel (logging .DEBUG ) # Allow debug messages on handler
263
- formatter = logging .Formatter (
264
- "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
265
- )
266
- ch .setFormatter (formatter )
267
- parent_logger .addHandler (ch )
268
- print ("Logger level:" , parent_logger .level )
269
- # print("Parent logger level:", logger.parent.level)
270
- print ("Root logger level:" , logging .getLogger ().level )
271
258
272
259
if ENABLED_FEATURES .torch_tensorrt_runtime :
273
260
if level == logging .DEBUG :
@@ -885,7 +872,6 @@ def download_plugin_lib_path(platform: str) -> Iterator[str]:
885
872
# Downloading TRT-LLM lib
886
873
base_url = "https://pypi.nvidia.com/tensorrt-llm/"
887
874
download_url = base_url + file_name
888
- print ("Downloading TRT-LLM wheel" )
889
875
try :
890
876
logger .debug (f"Downloading { download_url } ..." )
891
877
urllib .request .urlretrieve (download_url , downloaded_file_path )
@@ -937,7 +923,7 @@ def download_plugin_lib_path(platform: str) -> Iterator[str]:
937
923
yield plugin_lib_path
938
924
939
925
940
- def load_and_initialize_trtllm_plugin (plugin_lib_path : str ) -> bool :
926
+ def load_and_initialize_trtllm_plugin (plugin_lib_path : str , platform : str ) -> bool :
941
927
"""
942
928
Loads and initializes the TensorRT-LLM plugin from the given shared library path.
943
929
@@ -947,6 +933,9 @@ def load_and_initialize_trtllm_plugin(plugin_lib_path: str) -> bool:
947
933
Returns:
948
934
bool: True if successful, False otherwise.
949
935
"""
936
+ if "windows" in platform :
937
+ logger .info ("NCCL backend is not supported on Windows" )
938
+ return False
950
939
try :
951
940
handle = ctypes .CDLL (plugin_lib_path )
952
941
logger .info (f"Successfully loaded plugin library: { plugin_lib_path } " )
@@ -1002,8 +991,10 @@ def load_tensorrt_llm() -> bool:
1002
991
bool: True if the plugin was successfully loaded and initialized, False otherwise.
1003
992
"""
1004
993
plugin_lib_path = os .environ .get ("TRTLLM_PLUGINS_PATH" )
994
+ platform = Platform .current_platform ()
995
+ platform = str (platform ).lower ()
1005
996
if plugin_lib_path :
1006
- return load_and_initialize_trtllm_plugin (plugin_lib_path )
997
+ return load_and_initialize_trtllm_plugin (plugin_lib_path , platform )
1007
998
else :
1008
999
# this option can be used by user if TRTLLM_PLUGINS_PATH is not set by user
1009
1000
use_trtllm_plugin = os .environ .get ("USE_TRTLLM_PLUGINS" , "0" ).lower () in (
@@ -1017,10 +1008,7 @@ def load_tensorrt_llm() -> bool:
1017
1008
"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
1009
)
1019
1010
return False
1020
- else :
1021
- platform = Platform .current_platform ()
1022
- platform = str (platform ).lower ()
1023
1011
1024
1012
with download_plugin_lib_path (platform ) as plugin_lib_path :
1025
- return load_and_initialize_trtllm_plugin (plugin_lib_path )
1013
+ return load_and_initialize_trtllm_plugin (plugin_lib_path , platform )
1026
1014
return False
0 commit comments