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
b2c85669
Unverified
Commit
b2c85669
authored
Oct 15, 2025
by
Zheng Wengang
Committed by
GitHub
Oct 14, 2025
Browse files
[BugFix][Qwen3-VL]: fix cu_seqlens in qwen3-vl (#11458)
parent
32803fb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
python/sglang/srt/models/qwen3_vl.py
python/sglang/srt/models/qwen3_vl.py
+5
-3
No files found.
python/sglang/srt/models/qwen3_vl.py
View file @
b2c85669
...
...
@@ -452,13 +452,15 @@ class Qwen3_VisionTransformer(nn.Module):
position_embeddings
=
(
emb
.
cos
(),
emb
.
sin
())
# compute cu_seqlens
cu_seqlens
=
torch
.
repeat_interleave
(
grid_thw
[:,
1
]
*
grid_thw
[:,
2
],
grid_thw
[:,
0
]
).
cumsum
(
dim
=
0
)
cu_seqlens
=
torch
.
cat
(
[
torch
.
tensor
([
0
],
device
=
grid_thw
.
device
),
(
grid_thw
[:,
0
]
*
grid_thw
[:,
1
]
*
grid_thw
[:,
2
]).
cumsum
(
dim
=
0
),
torch
.
zeros
(
1
,
dtype
=
torch
.
int32
,
device
=
cu_seqlens
.
device
),
cu_seqlens
.
to
(
torch
.
int32
),
]
)
cu_seqlens
=
torch
.
cat
([
cu_seqlens
.
new_zeros
(
1
),
cu_seqlens
])
# max_seqlen, seqlens = self.compute_attn_mask_seqlen(cu_seqlens)
x
=
x
.
unsqueeze
(
1
)
...
...
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