Fix docs for clip max new tokens (#9082)
This commit is contained in:
@@ -36,7 +36,7 @@ if TYPE_CHECKING:
|
||||
# This can prevent the server from being too conservative.
|
||||
# Note that this only clips the estimation in the scheduler but does not change the stop
|
||||
# condition. The request can still generate tokens until it hits the unclipped max_new_tokens.
|
||||
CLIP_MAX_NEW_TOKENS_ESTIMATION = int(
|
||||
CLIP_MAX_NEW_TOKENS = int(
|
||||
os.environ.get("SGLANG_CLIP_MAX_NEW_TOKENS_ESTIMATION", "4096")
|
||||
)
|
||||
|
||||
@@ -305,7 +305,7 @@ class PrefillAdder:
|
||||
[
|
||||
min(
|
||||
(r.sampling_params.max_new_tokens - len(r.output_ids)),
|
||||
CLIP_MAX_NEW_TOKENS_ESTIMATION,
|
||||
CLIP_MAX_NEW_TOKENS,
|
||||
)
|
||||
* self.new_token_ratio
|
||||
for r in running_batch.reqs
|
||||
@@ -388,7 +388,7 @@ class PrefillAdder:
|
||||
0,
|
||||
req.extend_input_len,
|
||||
(
|
||||
min(req.sampling_params.max_new_tokens, CLIP_MAX_NEW_TOKENS_ESTIMATION)
|
||||
min(req.sampling_params.max_new_tokens, CLIP_MAX_NEW_TOKENS)
|
||||
if not truncated
|
||||
else 0
|
||||
),
|
||||
@@ -477,7 +477,7 @@ class PrefillAdder:
|
||||
self._update_prefill_budget(
|
||||
0,
|
||||
req.extend_input_len,
|
||||
min(req.sampling_params.max_new_tokens, CLIP_MAX_NEW_TOKENS_ESTIMATION),
|
||||
min(req.sampling_params.max_new_tokens, CLIP_MAX_NEW_TOKENS),
|
||||
)
|
||||
else:
|
||||
if self.rem_chunk_tokens == 0:
|
||||
@@ -499,7 +499,7 @@ class PrefillAdder:
|
||||
return self.add_one_req_ignore_eos(req, has_chunked_req)
|
||||
|
||||
total_tokens = req.extend_input_len + min(
|
||||
req.sampling_params.max_new_tokens, CLIP_MAX_NEW_TOKENS_ESTIMATION
|
||||
req.sampling_params.max_new_tokens, CLIP_MAX_NEW_TOKENS
|
||||
)
|
||||
|
||||
# adjusting the input_tokens based on host_hit_length and page_size
|
||||
@@ -544,7 +544,7 @@ class PrefillAdder:
|
||||
input_tokens,
|
||||
min(
|
||||
req.sampling_params.max_new_tokens,
|
||||
CLIP_MAX_NEW_TOKENS_ESTIMATION,
|
||||
CLIP_MAX_NEW_TOKENS,
|
||||
),
|
||||
)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user