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
912788c0
"server/vscode:/vscode.git/clone" did not exist on "379c5c4da2494a15fb82b3b1a39fa454cb73df44"
Unverified
Commit
912788c0
authored
May 13, 2025
by
Chang Su
Committed by
GitHub
May 13, 2025
Browse files
perf: optimize local_block_table memory allocation (#6273)
parent
0f75b907
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
python/sglang/srt/layers/attention/flashattention_backend.py
python/sglang/srt/layers/attention/flashattention_backend.py
+1
-2
No files found.
python/sglang/srt/layers/attention/flashattention_backend.py
View file @
912788c0
...
...
@@ -1165,7 +1165,6 @@ class FlashAttentionBackend(AttentionBackend):
max_virtual_batches
=
max_bs
*
(
(
max_seq_len
+
attn_chunk_size
-
1
)
//
attn_chunk_size
)
max_blocks_per_seq
=
(
max_seq_len
+
attn_chunk_size
-
1
)
//
attn_chunk_size
max_pages_per_block
=
(
attn_chunk_size
+
page_size
-
1
)
//
page_size
self
.
decode_cuda_graph_local_attn_metadata
=
{
...
...
@@ -1177,7 +1176,7 @@ class FlashAttentionBackend(AttentionBackend):
),
"local_block_table"
:
torch
.
zeros
(
max_virtual_batches
,
max_blocks_per_seq
*
max_pages_per_block
,
max_pages_per_block
,
dtype
=
torch
.
int32
,
device
=
self
.
device
,
),
...
...
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