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
0b3b3e9a
"tests/pytorch/vscode:/vscode.git/clone" did not exist on "97fbd94dfc436ce8500770adced4a5f57889347c"
Unverified
Commit
0b3b3e9a
authored
Oct 27, 2025
by
ash-sigh
Committed by
GitHub
Oct 26, 2025
Browse files
transfer mrope_position_delta to device when first running (#11047)
parent
a1d5bc4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
python/sglang/srt/model_executor/forward_batch_info.py
python/sglang/srt/model_executor/forward_batch_info.py
+9
-3
No files found.
python/sglang/srt/model_executor/forward_batch_info.py
View file @
0b3b3e9a
...
...
@@ -575,9 +575,15 @@ class ForwardBatch:
device
=
model_runner
.
device
,
)
else
:
mrope_position_deltas
=
mm_input
.
mrope_position_delta
.
flatten
().
to
(
model_runner
.
device
,
non_blocking
=
True
)
if
mm_input
.
mrope_position_delta
.
device
.
type
!=
model_runner
.
device
:
# transfer mrope_position_delta to device when the first running,
# avoiding successvie host-to-device data transfer
mm_input
.
mrope_position_delta
=
(
mm_input
.
mrope_position_delta
.
to
(
model_runner
.
device
,
non_blocking
=
True
)
)
mrope_position_deltas
=
mm_input
.
mrope_position_delta
.
flatten
()
mrope_positions_list
[
batch_idx
]
=
(
(
mrope_position_deltas
+
self
.
seq_lens
[
batch_idx
]
-
1
)
.
unsqueeze
(
0
)
...
...
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