From e60f05d955597ff5eea501ac97d6a93f0bec4a81 Mon Sep 17 00:00:00 2001 From: A-transformer Date: Fri, 21 Mar 2025 21:49:10 +0400 Subject: [PATCH] Update decodingConfig.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check is tied to mDynamicTreeMaxTopK, which is only meaningful in the context of useDynamicTree. While the check could theoretically apply even when useDynamicTree is false, enforcing it here ensures it’s validated at construction time alongside related conditions. Signed-off-by: root --- cpp/tensorrt_llm/executor/decodingConfig.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/tensorrt_llm/executor/decodingConfig.cpp b/cpp/tensorrt_llm/executor/decodingConfig.cpp index 5d052846b6c9..a9506438e482 100644 --- a/cpp/tensorrt_llm/executor/decodingConfig.cpp +++ b/cpp/tensorrt_llm/executor/decodingConfig.cpp @@ -164,6 +164,10 @@ EagleConfig::EagleConfig(std::optional eagleChoices, bool greedySa TLLM_CHECK_WITH_INFO(eagleChoices.has_value() == false, "When dynamic tree is enabled (for Eagle-2), eagle choices should not be set."); } + if (mDynamicTreeMaxTopK.has_value()) + { + TLLM_CHECK_WITH_INFO(mDynamicTreeMaxTopK.value() > 0, "dynamicTreeMaxTopK must be positive"); + } } bool EagleConfig::operator==(EagleConfig const& other) const