Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ input [
},
{
name: "early_stopping"
data_type: TYPE_BOOL
data_type: TYPE_INT32
dims: [ 1 ]
optional: true
},
Expand Down
10 changes: 10 additions & 0 deletions triton_backend/all_models/gpt/ensemble/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ input [
dims: [ 1 ]
optional: true
},
{
name: "early_stopping"
data_type: TYPE_INT32
dims: [ 1 ]
optional: true
},
{
name: "prompt_ignore_length"
data_type: TYPE_INT32
Expand Down Expand Up @@ -187,6 +193,10 @@ ensemble_scheduling {
key: "len_penalty"
value: "length_penalty"
}
input_map {
key: "early_stopping"
value: "early_stopping"
}
input_map {
key: "prompt_ignore_length"
value: "prompt_ignore_length"
Expand Down
7 changes: 7 additions & 0 deletions triton_backend/all_models/gpt/tensorrt_llm/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ input [
reshape: { shape: [ ] }
optional: true
},
{
name: "early_stopping"
data_type: TYPE_INT32
dims: [ 1 ]
reshape: { shape: [ ] }
optional: true
},
{
name: "prompt_ignore_length"
data_type: TYPE_INT32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ input [
dims: [ 1 ]
optional: true
},
{
name: "early_stopping"
data_type: TYPE_INT32
dims: [ 1 ]
optional: true
},
{
name: "prompt_ignore_length"
data_type: TYPE_INT32
Expand Down Expand Up @@ -521,6 +527,10 @@ ensemble_scheduling {
key: "len_penalty"
value: "length_penalty"
}
input_map {
key: "early_stopping"
value: "early_stopping"
}
input_map {
key: "prompt_ignore_length"
value: "prompt_ignore_length"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ input [
},
{
name: "early_stopping"
data_type: TYPE_BOOL
data_type: TYPE_INT32
dims: [ 1 ]
reshape: { shape: [ ] }
optional: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Request:
top_p: Optional[np.ndarray] = None
temperature: Optional[np.ndarray] = None
length_penalty: Optional[np.ndarray] = None
early_stopping: Optional[np.ndarray] = None
prompt_ignore_length: Optional[np.ndarray] = None
repetition_penalty: Optional[np.ndarray] = None
min_tokens: Optional[np.ndarray] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ def __init__(self,
"image_bytes_input", "image_url_input", "video_bytes_input",
"max_tokens", "bad_words", "stop_words", "end_id", "pad_id",
"top_k", "top_p", "temperature", "length_penalty",
"prompt_ignore_length", "repetition_penalty", "min_tokens",
"presence_penalty", "frequency_penalty", "seed", "return_log_probs",
"return_context_logits", "return_generation_logits", "beam_width",
"stream", "prompt_embedding_table", "prompt_vocab_size",
"prompt_ignore_length", "early_stopping", "repetition_penalty",
"min_tokens", "presence_penalty", "frequency_penalty", "seed",
"return_log_probs", "return_context_logits",
"return_generation_logits", "beam_width", "stream",
"prompt_embedding_table", "prompt_vocab_size",
"prompt_table_extra_id", "embedding_bias_words",
"embedding_bias_weights", "num_draft_tokens", "use_draft_logits",
"lora_task_id", "lora_weights", "lora_config",
Expand All @@ -104,13 +105,14 @@ def __init__(self,

self.__undo_reshape_whitelist = {
"max_tokens", "end_id", "pad_id", "top_k", "top_p", "temperature",
"length_penalty", "prompt_ignore_length", "repetition_penalty",
"min_tokens", "presence_penalty", "frequency_penalty", "seed",
"return_log_probs", "return_context_logits",
"return_generation_logits", "beam_width", "stream",
"prompt_vocab_size", "num_draft_tokens", "use_draft_logits",
"exclude_input_in_output", "return_perf_metrics", "lora_weights",
"lora_config", "lora_task_id", "return_num_input_tokens",
"length_penalty", "prompt_ignore_length", "early_stopping",
"repetition_penalty", "min_tokens", "presence_penalty",
"frequency_penalty", "seed", "return_log_probs",
"return_context_logits", "return_generation_logits", "beam_width",
"stream", "prompt_vocab_size", "num_draft_tokens",
"use_draft_logits", "exclude_input_in_output",
"return_perf_metrics", "lora_weights", "lora_config",
"lora_task_id", "return_num_input_tokens",
"return_num_output_tokens"
}

Expand Down Expand Up @@ -456,6 +458,7 @@ def _get_llm_tensors_from_request(
"temperature": "temperature",
"length_penalty": "len_penalty",
"prompt_ignore_length": "prompt_ignore_length",
"early_stopping": "early_stopping",
"repetition_penalty": "repetition_penalty",
"min_tokens": "min_tokens",
"presence_penalty": "presence_penalty",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ input [
dims: [ 1 ]
optional: true
},
{
name: "early_stopping"
data_type: TYPE_INT32
dims: [ 1 ]
optional: true
},
{
name: "prompt_ignore_length"
data_type: TYPE_INT32
Expand Down
10 changes: 10 additions & 0 deletions triton_backend/all_models/multimodal/ensemble/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ input [
dims: [ 1 ]
optional: true
},
{
name: "early_stopping"
data_type: TYPE_INT32
dims: [ 1 ]
optional: true
},
{
name: "prompt_ignore_length"
data_type: TYPE_INT32
Expand Down Expand Up @@ -518,6 +524,10 @@ ensemble_scheduling {
key: "len_penalty"
value: "length_penalty"
}
input_map {
key: "early_stopping"
value: "early_stopping"
}
input_map {
key: "prompt_ignore_length"
value: "prompt_ignore_length"
Expand Down
8 changes: 6 additions & 2 deletions triton_backend/inflight_batcher_llm/tests/utilsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,11 @@ std::optional<tensorrt_llm::executor::Request> getRequest(
pushTensor<int32_t>(inputsTensors, InputFieldsNames::topPResetIds, nvinfer1::DataType::kINT32, {1}, {25});
pushTensor<float>(inputsTensors, InputFieldsNames::temperature, nvinfer1::DataType::kFLOAT, {1}, {0.3});
pushTensor<float>(inputsTensors, InputFieldsNames::lengthPenalty, nvinfer1::DataType::kFLOAT, {1}, {0.4});
pushTensor<int32_t>(inputsTensors, InputFieldsNames::earlyStopping, nvinfer1::DataType::kINT32, {1}, {4});
// early_stopping is a HuggingFace-style tri-state: 0=heuristic, 1=fast,
// 2=stop only when all beams emit <eos>. Push 2 to lock in INT32 wire-format
// for the canonical-beam-search mode (was silently truncated under the old
// TYPE_BOOL config declaration; cf. PR fixing the wire-protocol type).
pushTensor<int32_t>(inputsTensors, InputFieldsNames::earlyStopping, nvinfer1::DataType::kINT32, {1}, {2});
pushTensor<float>(inputsTensors, InputFieldsNames::repetitionPenalty, nvinfer1::DataType::kFLOAT, {1}, {0.8});
pushTensor<int32_t>(inputsTensors, InputFieldsNames::minTokens, nvinfer1::DataType::kINT32, {1}, {45});
pushTensor<float>(inputsTensors, InputFieldsNames::beamSearchDiversityRate, nvinfer1::DataType::kFLOAT, {1}, {0.1});
Expand Down Expand Up @@ -580,7 +584,7 @@ void checkRequest(tensorrt_llm::executor::Request const& request,
EXPECT_EQ(samplingConfig.getTopPResetIds().value(), 25);
EXPECT_EQ(samplingConfig.getTemperature().value(), 0.3f);
EXPECT_EQ(samplingConfig.getLengthPenalty().value(), 0.4f);
EXPECT_EQ(samplingConfig.getEarlyStopping().value(), 4);
EXPECT_EQ(samplingConfig.getEarlyStopping().value(), 2);
EXPECT_EQ(samplingConfig.getRepetitionPenalty().value(), 0.8f);
EXPECT_EQ(samplingConfig.getMinTokens().value(), 45);
EXPECT_EQ(samplingConfig.getBeamSearchDiversityRate().value(), 0.1f);
Expand Down
Loading