mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-26 03:00:54 +00:00
fix transformer model unit tests (#14319)
For following failures, folder of convert_to_onnx should be specified to import for source code case: FAILED test_gpt2_to_onnx.py::TestGpt2ConvertToOnnx::test_auto_mixed_precision FAILED test_gpt2_to_onnx.py::TestGpt2ConvertToOnnx::test_stage1 - TypeError: ... FAILED test_gpt2_to_onnx.py::TestGpt2ConvertToOnnx::test_stage2 - TypeError: ... For failure below, SkipLayerNormal is fused: FAILED test_optimizer.py::TestModelOptimization::test_huggingface_openaigpt_fusion
This commit is contained in:
parent
909d7f4be5
commit
c99cd06b10
2 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ from parity_utilities import find_transformers_source
|
|||
from onnxruntime import get_available_providers
|
||||
|
||||
if find_transformers_source(sub_dir_paths=["models", "gpt2"]):
|
||||
from convert_to_onnx import main as gpt2_to_onnx
|
||||
from models.gpt2.convert_to_onnx import main as gpt2_to_onnx
|
||||
else:
|
||||
from onnxruntime.transformers.models.gpt2.convert_to_onnx import main as gpt2_to_onnx
|
||||
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ class TestModelOptimization(unittest.TestCase):
|
|||
|
||||
@pytest.mark.slow
|
||||
def test_huggingface_openaigpt_fusion(self):
|
||||
self._test_optimizer_on_huggingface_model("openai-gpt", [0, 12, 0, 12, 0, 24, 0])
|
||||
self._test_optimizer_on_huggingface_model("openai-gpt", [0, 12, 0, 12, 0, 0, 24])
|
||||
|
||||
@pytest.mark.slow
|
||||
@unittest.skip("skip failed fusion test of gpt-2 on PyTorch 1.12 and transformers 4.18. TODO: fix it")
|
||||
|
|
|
|||
Loading…
Reference in a new issue