Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
4367f4bb
"llm/vscode:/vscode.git/clone" did not exist on "61dda6a5e07429c2f429efd59cb07681e0478256"
Unverified
Commit
4367f4bb
authored
Jul 24, 2024
by
Ying Sheng
Committed by
GitHub
Jul 24, 2024
Browse files
Fix prefill size (#711)
parent
00e4baa7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
python/sglang/srt/managers/controller/tp_worker.py
python/sglang/srt/managers/controller/tp_worker.py
+4
-0
python/sglang/srt/memory_pool.py
python/sglang/srt/memory_pool.py
+1
-0
No files found.
python/sglang/srt/managers/controller/tp_worker.py
View file @
4367f4bb
...
...
@@ -103,6 +103,10 @@ class ModelTpServer:
if
server_args
.
max_running_requests
is
None
else
server_args
.
max_running_requests
)
self
.
max_running_requests
=
min
(
self
.
max_running_requests
,
self
.
model_runner
.
req_to_token_pool
.
size
-
1
)
self
.
int_token_logit_bias
=
torch
.
tensor
(
get_int_token_logit_bias
(
self
.
tokenizer
,
self
.
model_config
.
vocab_size
)
)
...
...
python/sglang/srt/memory_pool.py
View file @
4367f4bb
...
...
@@ -11,6 +11,7 @@ class ReqToTokenPool:
"""A memory pool that maps a request to its token locations."""
def
__init__
(
self
,
size
:
int
,
max_context_len
:
int
):
self
.
size
=
size
self
.
mem_state
=
torch
.
ones
((
size
,),
dtype
=
torch
.
bool
,
device
=
"cuda"
)
self
.
req_to_token
=
torch
.
empty
(
(
size
,
max_context_len
),
dtype
=
torch
.
int32
,
device
=
"cuda"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment