Skip to content

Commit bd02ff5

Browse files
committed
fix
1 parent 2eab178 commit bd02ff5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

_unittests/ut_torch_export_patches/test_patch_transformers.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ def test_qwen2_5_vl_vision_attention_iteration(self):
402402
patched_Qwen2_5_VLVisionAttentionOneIteration,
403403
)
404404

405+
try:
406+
from onnxscript.function_libs.torch_lib.ops.core import aten_sym_storage_offset
407+
except ImportError:
408+
aten_sym_storage_offset = None
409+
405410
model = patched_Qwen2_5_VLVisionAttentionOneIteration()
406411
inputs = (
407412
torch.tensor([736, 800], dtype=torch.int64),
@@ -416,18 +421,13 @@ def test_qwen2_5_vl_vision_attention_iteration(self):
416421
{0: "batch", 1: "length", 2: "dim"},
417422
)
418423
for exporter in ("custom", "onnx-dynamo"):
424+
if exporter == "onnx-dynamo" and aten_sym_storage_offset is None:
425+
raise unittest.SkipTest("update onnxscript to make this test run")
419426
# onnx-dynamo needs OpOverload(op='aten.sym_storage_offset' (transformers>=5.0?)
420427
filename = self.get_dump_file(
421428
f"test_qwen2_5_vl_vision_attention_iteration.{exporter}.onnx"
422429
)
423-
to_onnx(
424-
model,
425-
inputs,
426-
dynamic_shapes=ds,
427-
exporter=exporter,
428-
filename=filename,
429-
exporter_kwargs={"report": True} if exporter == "onnx-dynamo" else {},
430-
)
430+
to_onnx(model, inputs, dynamic_shapes=ds, exporter=exporter, filename=filename)
431431
self.assert_onnx_disc(
432432
f"test_qwen2_5_vl_vision_attention_iteration-{exporter}",
433433
onnx.load(filename),

0 commit comments

Comments
 (0)