Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
68b254d6
Unverified
Commit
68b254d6
authored
Aug 10, 2025
by
Benji Beck
Committed by
GitHub
Aug 10, 2025
Browse files
Fix TensorSchema validation test for symbolic dims (#22366)
Signed-off-by:
Benji Beck
<
benjibeck@meta.com
>
parent
8c50d62f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
tests/standalone_tests/test_tensor_schema.py
tests/standalone_tests/test_tensor_schema.py
+18
-14
No files found.
tests/standalone_tests/test_tensor_schema.py
View file @
68b254d6
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
import
pytest
import
pytest
import
torch
import
torch
from
vllm.model_executor.models.fuyu
import
FuyuImagePatchInputs
from
vllm.model_executor.models.glm4_1v
import
Glm4vImageEmbeddingInputs
from
vllm.model_executor.models.glm4_1v
import
Glm4vImageEmbeddingInputs
from
vllm.model_executor.models.granite_speech
import
GraniteSpeechAudioInputs
from
vllm.model_executor.models.phi3v
import
Phi3VImagePixelInputs
from
vllm.model_executor.models.phi3v
import
Phi3VImagePixelInputs
...
@@ -129,23 +129,27 @@ def test_tensor_schema_with_invalid_resolve_binding_dims():
...
@@ -129,23 +129,27 @@ def test_tensor_schema_with_invalid_resolve_binding_dims():
def
test_tensor_schema_with_list_of_symbolic_dim
():
def
test_tensor_schema_with_list_of_symbolic_dim
():
flat_data
=
torch
.
stack
([
torch
.
randn
(
768
)
for
_
in
range
(
3
)])
# (bn=3, fn)
input_features
=
torch
.
randn
(
3
,
10
,
160
)
# (b=3, fi=10, 160)
patches_per_image
=
[
64
,
64
,
64
]
# len = bn = 3
input_features_mask
=
torch
.
randn
(
3
,
8
)
# (b=3, fo=8)
audio_embed_sizes
=
[
8
,
8
,
8
]
# len = b = 3
FuyuImagePatchInputs
(
flat_data
=
flat_data
,
GraniteSpeechAudioInputs
(
patches_per_image
=
patches_per_image
,
input_features
=
input_features
,
input_features_mask
=
input_features_mask
,
audio_embed_sizes
=
audio_embed_sizes
,
)
)
def
test_tensor_schema_with_list_of_symbolic_dim_mismatch_in_length
():
def
test_tensor_schema_with_list_of_symbolic_dim_mismatch_in_length
():
flat_data
=
torch
.
stack
([
torch
.
randn
(
768
)
for
_
in
range
(
4
)])
# (bn=4, fn)
input_features
=
torch
.
randn
(
4
,
10
,
160
)
# (b=4, fi=10, 160)
patches_per_image
=
[
64
,
64
,
64
]
# len = 3 ≠ bn
input_features_mask
=
torch
.
randn
(
4
,
8
)
# (b=4, fo=8)
audio_embed_sizes
=
[
8
,
8
,
8
]
# len = 3 ≠ b
with
pytest
.
raises
(
ValueError
,
match
=
"expected 'bn'=4, got 3"
):
FuyuImagePatchInputs
(
with
pytest
.
raises
(
ValueError
,
match
=
"expected 'b'=4, got 3"
):
flat_data
=
flat_data
,
GraniteSpeechAudioInputs
(
patches_per_image
=
patches_per_image
,
input_features
=
input_features
,
input_features_mask
=
input_features_mask
,
audio_embed_sizes
=
audio_embed_sizes
,
)
)
...
...
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