Skip to content

Commit

Permalink
Disable bart onnx export for text-classification and question-answeri…
Browse files Browse the repository at this point in the history
…ng (#1457)

* disable bart onnx export for text-classification and question-answering

* add details
  • Loading branch information
fxmarty authored Oct 17, 2023
1 parent 38b0809 commit 5638705
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions optimum/exporters/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,10 @@ class TasksManager:
"text-generation-with-past",
"text2text-generation",
"text2text-generation-with-past",
"text-classification",
"question-answering",
# text-classification and question-answering can be supported, but the ONNX export is currently broken due to a regression in PyTorch 2.1.
# Reference: https://github.com/pytorch/pytorch/issues/110597.
# "text-classification",
# "question-answering",
onnx="BartOnnxConfig",
),
# BEiT cannot be used with the masked image modeling autoclass, so this task is excluded here
Expand Down
4 changes: 2 additions & 2 deletions tests/onnxruntime/test_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ def test_trust_remote_code(self):
class ORTModelForQuestionAnsweringIntegrationTest(ORTModelTestMixin):
SUPPORTED_ARCHITECTURES = [
"albert",
"bart",
# "bart", # see tasks.py
"bert",
# "big_bird",
# "bigbird_pegasus",
Expand Down Expand Up @@ -1372,7 +1372,7 @@ def test_compare_to_io_binding(self, model_arch):
class ORTModelForSequenceClassificationIntegrationTest(ORTModelTestMixin):
SUPPORTED_ARCHITECTURES = [
"albert",
"bart",
# "bart", # see tasks.py
"bert",
# "big_bird",
# "bigbird_pegasus",
Expand Down
1 change: 0 additions & 1 deletion tests/onnxruntime/test_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ def tearDownClass(cls):
class ORTOptimizerTest(unittest.TestCase):
# Contribution note: Please add test models in alphabetical order. Find test models here: https://huggingface.co/hf-internal-testing.
SUPPORTED_ARCHITECTURES_WITH_MODEL_ID = (
(ORTModelForSequenceClassification, "hf-internal-testing/tiny-random-bart"),
(ORTModelForSequenceClassification, "hf-internal-testing/tiny-random-bert"),
# (ORTModelForSequenceClassification, "hf-internal-testing/tiny-random-big_bird"),
(ORTModelForSequenceClassification, "hf-internal-testing/tiny-random-distilbert"),
Expand Down
1 change: 0 additions & 1 deletion tests/onnxruntime/test_quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class ORTDynamicQuantizationTest(unittest.TestCase):
(ORTModelForSequenceClassification, "hf-internal-testing/tiny-random-bert", 30),
(ORTModelForSequenceClassification, "hf-internal-testing/tiny-random-roberta", 30),
(ORTModelForSequenceClassification, "hf-internal-testing/tiny-random-distilbert", 30),
(ORTModelForSequenceClassification, "hf-internal-testing/tiny-random-bart", 32),
)

SUPPORTED_DECODER_ARCHITECTURES_WITH_EXPECTED_QUANTIZED_MATMULS = (
Expand Down

0 comments on commit 5638705

Please sign in to comment.