Skip to content

Commit 1d4a186

Browse files
authored
[https://nvbugs/5623960][fix] Compress the warning log of AutoTuner when encountering tactic failures. (#8793)
Signed-off-by: Yukun He <[email protected]>
1 parent a6a3de8 commit 1d4a186

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tensorrt_llm/_torch/autotuner.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,22 +750,24 @@ def choose_one(
750750
f"[Autotuner] Profiling runner={runners[best_runner_id]}, tactic={best_tactic} for cache_key={cache_key}."
751751
)
752752
else:
753-
logger.warning(
753+
logger.warning_once(
754754
f"[Autotuner] No valid runner/tactic was found for custom_op={custom_op}, input_shapes={input_shapes}. "
755755
f"At least one valid (runner, tactic) pair is required. "
756756
f"If get_valid_tactics is intended to return empty list, please ensure that this profile is not valid for the custom_op "
757-
f"and should not occurs during the inference stage, or fallback tactic is implemented. Otherwise, the the tuning process will crash."
757+
f"and should not occurs during the inference stage, or fallback tactic is implemented. Otherwise, the the tuning process will crash.",
758+
key=custom_op,
758759
)
759760
new_tuning_failure_occured = new_tuning_failure_occured or has_tuning_failure_occured
760761

761762
# If failed profiling tactics occurs, log the error.
762763
if new_tuning_failure_occured:
763-
logger.warning(
764+
logger.warning_once(
764765
f"[Autotuner] New tuning error occurs:"
765766
f"Total failed profiling tactics occurs: {len(self.stats.failed_profiling_count[custom_op])} for custom_op={custom_op}. "
766767
f"This will not block the tuning process. "
767768
f"Please set TLLM_LOG_LEVEL=WARNING to find out when the tactic profiling fails. "
768-
f"Set TLLM_LOG_LEVEL=DEBUG to get more details of the failures."
769+
f"Set TLLM_LOG_LEVEL=DEBUG to get more details of the failures.",
770+
key=custom_op,
769771
)
770772

771773
# Get the best runner and tactic from cache

0 commit comments

Comments
 (0)