From 49ea17ad1b282137ed30ec1cf028c63ea415e417 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Wed, 3 Sep 2025 20:54:31 +0000 Subject: [PATCH 1/3] use DYNAMIC(str) --- onnx_diagnostic/tasks/automatic_speech_recognition.py | 2 +- onnx_diagnostic/tasks/feature_extraction.py | 2 +- onnx_diagnostic/tasks/fill_mask.py | 2 +- onnx_diagnostic/tasks/image_text_to_text.py | 4 ++-- onnx_diagnostic/tasks/sentence_similarity.py | 2 +- onnx_diagnostic/tasks/summarization.py | 2 +- onnx_diagnostic/tasks/text2text_generation.py | 2 +- onnx_diagnostic/tasks/text_classification.py | 2 +- onnx_diagnostic/tasks/text_generation.py | 2 +- onnx_diagnostic/tasks/zero_shot_image_classification.py | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/onnx_diagnostic/tasks/automatic_speech_recognition.py b/onnx_diagnostic/tasks/automatic_speech_recognition.py index 43aac84c..c122c086 100644 --- a/onnx_diagnostic/tasks/automatic_speech_recognition.py +++ b/onnx_diagnostic/tasks/automatic_speech_recognition.py @@ -76,7 +76,7 @@ def get_inputs( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "seq_length" shapes = { diff --git a/onnx_diagnostic/tasks/feature_extraction.py b/onnx_diagnostic/tasks/feature_extraction.py index 13861ba4..b049a5b6 100644 --- a/onnx_diagnostic/tasks/feature_extraction.py +++ b/onnx_diagnostic/tasks/feature_extraction.py @@ -47,7 +47,7 @@ def get_inputs( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "sequence_length" shapes = { "input_ids": {0: batch, 1: seq_length}, diff --git a/onnx_diagnostic/tasks/fill_mask.py b/onnx_diagnostic/tasks/fill_mask.py index a59365e1..0e790ee8 100644 --- a/onnx_diagnostic/tasks/fill_mask.py +++ b/onnx_diagnostic/tasks/fill_mask.py @@ -42,7 +42,7 @@ def get_inputs( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "sequence_length" shapes = { "input_ids": {0: batch, 1: seq_length}, diff --git a/onnx_diagnostic/tasks/image_text_to_text.py b/onnx_diagnostic/tasks/image_text_to_text.py index 585b6ddf..fe3b6d4a 100644 --- a/onnx_diagnostic/tasks/image_text_to_text.py +++ b/onnx_diagnostic/tasks/image_text_to_text.py @@ -107,7 +107,7 @@ def _get_inputs_gemma3( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "seq_length" # torch.export.Dim("seq_length", min=1, max=4096) # cache_length = "cache_length" # torch.export.Dim("cache_length", min=1, max=4096) @@ -230,7 +230,7 @@ def get_inputs( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" batch_img = torch.export.Dim("batch_img", min=1, max=1024) seq_length = "seq_length" # torch.export.Dim("seq_length", min=1, max=4096) cache_length = "cache_length" # torch.export.Dim("cache_length", min=1, max=4096) diff --git a/onnx_diagnostic/tasks/sentence_similarity.py b/onnx_diagnostic/tasks/sentence_similarity.py index 7bcdb889..7386ec5a 100644 --- a/onnx_diagnostic/tasks/sentence_similarity.py +++ b/onnx_diagnostic/tasks/sentence_similarity.py @@ -42,7 +42,7 @@ def get_inputs( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "seq_length" shapes = { "input_ids": {0: batch, 1: seq_length}, diff --git a/onnx_diagnostic/tasks/summarization.py b/onnx_diagnostic/tasks/summarization.py index 6c7fde27..5760c41c 100644 --- a/onnx_diagnostic/tasks/summarization.py +++ b/onnx_diagnostic/tasks/summarization.py @@ -70,7 +70,7 @@ def get_inputs( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "seq_length" # torch.export.Dim("seq_length", min=1, max=4096) cache_length = "cache_length_key" # torch.export.Dim("cache_length", min=1, max=4096) cache_length2 = "cache_length_val" # torch.export.Dim("cache_length2", min=1, max=4096) diff --git a/onnx_diagnostic/tasks/text2text_generation.py b/onnx_diagnostic/tasks/text2text_generation.py index 94d0d888..fc8cd2e0 100644 --- a/onnx_diagnostic/tasks/text2text_generation.py +++ b/onnx_diagnostic/tasks/text2text_generation.py @@ -72,7 +72,7 @@ def get_inputs( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "seq_length" # torch.export.Dim("seq_length", min=1, max=4096) cache_length = "cache_length_key" cache_length2 = "cache_length_val" diff --git a/onnx_diagnostic/tasks/text_classification.py b/onnx_diagnostic/tasks/text_classification.py index 380b15cc..4b82155d 100644 --- a/onnx_diagnostic/tasks/text_classification.py +++ b/onnx_diagnostic/tasks/text_classification.py @@ -42,7 +42,7 @@ def get_inputs( assert ( "cls_cache" not in kwargs ), f"Not yet implemented for cls_cache={kwargs['cls_cache']!r}." - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "seq_length" # torch.export.Dim("sequence_length", min=1, max=1024) shapes = { "input_ids": {0: batch, 1: seq_length}, diff --git a/onnx_diagnostic/tasks/text_generation.py b/onnx_diagnostic/tasks/text_generation.py index 6b8ae5ef..6e6e29ba 100644 --- a/onnx_diagnostic/tasks/text_generation.py +++ b/onnx_diagnostic/tasks/text_generation.py @@ -83,7 +83,7 @@ def get_inputs( :class:`transformers.cache_utils.DynamicCache` :return: dictionary """ - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "seq_length" # torch.export.Dim("seq_length", min=1, max=4096) cache_length = "cache_length" # torch.export.Dim("cache_length", min=1, max=4096) diff --git a/onnx_diagnostic/tasks/zero_shot_image_classification.py b/onnx_diagnostic/tasks/zero_shot_image_classification.py index 61fee29e..d19e3c9e 100644 --- a/onnx_diagnostic/tasks/zero_shot_image_classification.py +++ b/onnx_diagnostic/tasks/zero_shot_image_classification.py @@ -65,7 +65,7 @@ def get_inputs( input_width, int ), f"Unexpected type for input_height {type(input_height)}{config}" - batch = torch.export.Dim("batch", min=1, max=1024) + batch = "batch" seq_length = "seq_length" # torch.export.Dim("seq_length", min=1, max=4096) shapes = { "input_ids": {0: batch, 1: seq_length}, From 6983c2c6aae5c6105c02f037f0ea78fbd0514583 Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Thu, 4 Sep 2025 20:06:50 +0000 Subject: [PATCH 2/3] delete check-urls.yml --- .github/workflows/check-urls.yml | 47 -------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 .github/workflows/check-urls.yml diff --git a/.github/workflows/check-urls.yml b/.github/workflows/check-urls.yml deleted file mode 100644 index 49c2bfbb..00000000 --- a/.github/workflows/check-urls.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Check URLs - -on: - pull_request: - branches: [main] - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ │ - # * * * * * - - cron: '30 1 * * 0' - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: urls-checker-code - uses: urlstechie/urlchecker-action@master - with: - subfolder: onnx_diagnostic - file_types: .md,.py,.rst,.ipynb - print_all: false - timeout: 2 - retry_count# : 2 - exclude_urls: https://github.com/pytorch/pytorch/pull/117009,https://github.com/huggingface/transformers/pull/29285,https://github.com/pytorch/pytorch/blob/a44f8894fa6d973693aab44a3dda079a168b05c1/torch/_decomp/decompositions.py#L1475,https://github.com/huggingface/transformers/pull/36652 - exclude_patterns: https://dumps.wikimedia.org/,https://github.com/,https://huggingface.co/,https://huggingface.co/ - # force_pass : true - - - name: urls-checker-docs - uses: urlstechie/urlchecker-action@master - with: - subfolder: _doc - file_types: .md,.py,.rst,.ipynb - print_all: false - timeout: 2 - retry_count# : 2 - exclude_urls: https://hal.archives-,ouvertes.fr/hal-00990252/document,http://badge.fury.io/py/onnx-diagnostic,https://azure.microsoft.com/en-us/products/devops/pipelines,https://github.com/pytorch/pytorch/pull/83137#issuecomment-1211320670,https://github.com/NVIDIA/TransformerEngine.git@6a9edc38bf9b941b7d369af5103fa8fe0b121d61,https://medium.com/@msouza.os/llm-from-scratch-with-pytorch-9f21808c6319,https://github.com/pytorch/pytorch/blob/main/torch/fx/experimental/symbolic_shapes.py#L5965,https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-04.html,https://badge.fury.io/py/onnx-diagnostic.svg,https://github.com/huggingface/transformers/pull/36311 - exclude_patterns: https://www.data.gouv.fr/fr/datasets/r/e3d83ab3-dc52-4c99-abaf-8a38050cc68c,https://dev.azure.com/,https://azure.microsoft.com/en-us/products/devops/pipelines,https://github.com/pytorch/pytorch/pull/83137#issuecomment-1211320670,https://github.com/NVIDIA/TransformerEngine.git@6a9edc38bf9b941b7d369af5103fa8fe0b121d61,https://github.com/pytorch/pytorch/blob/main/torch/,https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-04.html,https://badge.fury.io/py/onnx-diagnostic.svg,https://github.com/,https://codecov.io/,https://huggingface.co/ - # force_pass : true From 7795cd74987c98d63ecf66454842a407c6d23e2e Mon Sep 17 00:00:00 2001 From: Ti-Tai Wang Date: Thu, 4 Sep 2025 20:11:52 +0000 Subject: [PATCH 3/3] Revert "delete check-urls.yml" This reverts commit 6983c2c6aae5c6105c02f037f0ea78fbd0514583. --- .github/workflows/check-urls.yml | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/check-urls.yml diff --git a/.github/workflows/check-urls.yml b/.github/workflows/check-urls.yml new file mode 100644 index 00000000..49c2bfbb --- /dev/null +++ b/.github/workflows/check-urls.yml @@ -0,0 +1,47 @@ +name: Check URLs + +on: + pull_request: + branches: [main] + schedule: + # ┌───────────── minute (0 - 59) + # │ ┌───────────── hour (0 - 23) + # │ │ ┌───────────── day of the month (1 - 31) + # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) + # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) + # │ │ │ │ │ + # │ │ │ │ │ + # │ │ │ │ │ + # * * * * * + - cron: '30 1 * * 0' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: urls-checker-code + uses: urlstechie/urlchecker-action@master + with: + subfolder: onnx_diagnostic + file_types: .md,.py,.rst,.ipynb + print_all: false + timeout: 2 + retry_count# : 2 + exclude_urls: https://github.com/pytorch/pytorch/pull/117009,https://github.com/huggingface/transformers/pull/29285,https://github.com/pytorch/pytorch/blob/a44f8894fa6d973693aab44a3dda079a168b05c1/torch/_decomp/decompositions.py#L1475,https://github.com/huggingface/transformers/pull/36652 + exclude_patterns: https://dumps.wikimedia.org/,https://github.com/,https://huggingface.co/,https://huggingface.co/ + # force_pass : true + + - name: urls-checker-docs + uses: urlstechie/urlchecker-action@master + with: + subfolder: _doc + file_types: .md,.py,.rst,.ipynb + print_all: false + timeout: 2 + retry_count# : 2 + exclude_urls: https://hal.archives-,ouvertes.fr/hal-00990252/document,http://badge.fury.io/py/onnx-diagnostic,https://azure.microsoft.com/en-us/products/devops/pipelines,https://github.com/pytorch/pytorch/pull/83137#issuecomment-1211320670,https://github.com/NVIDIA/TransformerEngine.git@6a9edc38bf9b941b7d369af5103fa8fe0b121d61,https://medium.com/@msouza.os/llm-from-scratch-with-pytorch-9f21808c6319,https://github.com/pytorch/pytorch/blob/main/torch/fx/experimental/symbolic_shapes.py#L5965,https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-04.html,https://badge.fury.io/py/onnx-diagnostic.svg,https://github.com/huggingface/transformers/pull/36311 + exclude_patterns: https://www.data.gouv.fr/fr/datasets/r/e3d83ab3-dc52-4c99-abaf-8a38050cc68c,https://dev.azure.com/,https://azure.microsoft.com/en-us/products/devops/pipelines,https://github.com/pytorch/pytorch/pull/83137#issuecomment-1211320670,https://github.com/NVIDIA/TransformerEngine.git@6a9edc38bf9b941b7d369af5103fa8fe0b121d61,https://github.com/pytorch/pytorch/blob/main/torch/,https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-04.html,https://badge.fury.io/py/onnx-diagnostic.svg,https://github.com/,https://codecov.io/,https://huggingface.co/ + # force_pass : true