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
zhaoyu6
sglang
Commits
6a290034
"vscode:/vscode.git/clone" did not exist on "92ce53aab859012f7714dae6d6fce7a7d701e75f"
Unverified
Commit
6a290034
authored
Oct 02, 2025
by
Liangsheng Yin
Committed by
GitHub
Oct 02, 2025
Browse files
Remove unused pack `.item()` in paged allocator. (#11156)
parent
2ac453b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
python/sglang/srt/utils.py
python/sglang/srt/utils.py
+1
-6
No files found.
python/sglang/srt/utils.py
View file @
6a290034
...
...
@@ -3265,13 +3265,8 @@ def get_num_new_pages(
num_pages_after
=
(
seq_lens
+
page_size
-
1
)
//
page_size
num_pages_before
=
(
prefix_lens
+
page_size
-
1
)
//
page_size
num_new_pages
=
num_pages_after
-
num_pages_before
extend_lens
=
seq_lens
-
prefix_lens
sum_num_new_pages
=
torch
.
sum
(
num_new_pages
).
to
(
torch
.
int64
)
if
decode
:
return
sum_num_new_pages
.
item
()
merged_value
=
(
sum_num_new_pages
)
<<
32
|
torch
.
sum
(
extend_lens
).
to
(
torch
.
int64
)
return
merged_value
.
item
()
>>
32
return
sum_num_new_pages
.
item
()
class
CachedKernel
:
...
...
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