Skip to content

Update python documentation - #8051

Closed
xzhu1900 wants to merge 1 commit into
gh-pagesfrom
xuzhu/doc_update
Closed

Update python documentation#8051
xzhu1900 wants to merge 1 commit into
gh-pagesfrom
xuzhu/doc_update

Conversation

@xzhu1900

Copy link
Copy Markdown
Contributor

Description: update python document for 1.8.0 release

Motivation and Context

  • Why is this change required? What problem does it solve?
  • If it fixes an open issue, please link to the issue here.

@xzhu1900
xzhu1900 requested a review from natke June 15, 2021 01:40
@natke

natke commented Jan 10, 2022

Copy link
Copy Markdown
Contributor

Superseded by #10181

@natke natke closed this Jan 10, 2022
titaiwangms added a commit to titaiwangms/onnxruntime that referenced this pull request Jun 9, 2026
…2 rc2

ONNX 1.22 rc2 (cherry-pick microsoft#8051) turned the silent `return;` early-exits in
convTransposeShapeInference into hard fail_shape_inference(...) on output_shape /
output_padding size mismatch. ORT's CPU/CUDA ConvTranspose kernel officially
supports the rank+2 (full N,C,H,W) output_shape form (conv_transpose_attributes.h
241-258), which is an ORT extension beyond the ONNX spec (the schema doc excludes
N,C). Under rc2 those valid ORT models that loaded under rc1 now fail at
Graph::Resolve. This restores rc1 behavior via onnx.patch (Option B).

Correction to the rc2 source-pin bump commit message: that change is NOT
'no valid-model behavior change' for ConvTranspose -- rc2's microsoft#8051 output_shape /
output_padding strictness would regress real ORT models. This patch restores the
rank+2 leniency to preserve ORT's documented kernel extension.

Patch (onnx.patch + byte-identical binskim.patch), 6 sites across all 3
ConvTranspose opset variants, fail_shape_inference(...) -> `return;`:
  - defs.cc:1228 (output_shape) / :1240 (output_padding)  [ConvTranspose-22]
  - old.cc:729 / :741   [convTransposeShapeInference_opset11, opset 11-21]
  - old.cc:3076 / :3088 [convTransposeShapeInference_opset1, opset 1-10]
Reverted to `return;` (not deletion): the downstream input_shape.dim(i+2) loop
runs output_shape.size() times and would OOB-read on a rank+2 shape if the guard
were removed; `return;` short-circuits before the loop (memory-safe, behavior-
neutral vs rc1). The new microsoft#8051 negative-value guards and all other hardening are
kept.

kernel_shape strictness is kept (it has no rank+2 form, so the model is genuinely
invalid per spec): ConvTranspose_InvalidKernelShape now expects ONNX's rc2
shape-inference message 'Attribute kernel_shape has incorrect size' instead of the
old CPU-kernel message. No other test edits are needed -- the 7 output_shape
tests (incl. InvalidBiasShape_1/2) pass unedited because B restores rc1 behavior.

Validation: onnxruntime_provider_test ConvTransposeTest/ConvTest/PoolTest/RoiPool
-> 120 passed, 0 failed, 9 skipped (CUDA/DML EP unavailable).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Agent-signed-off: Developer (a478a765) [claude-opus-4.8 via copilot]
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
titaiwangms added a commit to titaiwangms/onnxruntime that referenced this pull request Jun 9, 2026
… leniency)

ONNX 1.22 (rc2, cherry-pick microsoft#8051) tightened convTransposeShapeInference to
fail_shape_inference when an output_shape/output_padding attribute size does not
match the number of spatial dimensions. ORT historically also accepted a
non-spec rank+2 (full N,C,H,W) output_shape form. This is Option A: instead of
patching ONNX to restore the leniency (Option B, commit 031c777), conform
ORT's own test models to the spec so the onnx.patch ConvTranspose hunks never
land in main.

Changes:
- conv_transpose_op_test.cc: 10 output_shape attributes -> spatial-only
  (N,C prefix dropped; Y_shape/expected_vals unchanged). Keep B's
  InvalidKernelShape expected-message fix (ONNX rejects kernel_shape rank at
  Graph::Resolve). Add a new InferenceSession-based regression test
  (ConvTranspose_RankPlus2_OutputShape_DynamicRankInput_Runtime) that feeds an
  unknown-rank input so the kept rank+2 kernel branch stays exercised.
- xnnpack_basic_test.cc: 1 output_shape attribute -> spatial-only.
- conv_transpose_attributes.h: keep the rank+2 toleration (runtime-reachable for
  dynamic-rank inputs) and document why it is retained; no behavior change.
- onnx.patch / binskim.patch: unchanged at the 3-hunk base (no ConvTranspose
  reverts) since this branch is built on the pre-B base.

Breaking change: models specifying a rank+2 output_shape AND a statically-known
input rank now fail to load under ONNX 1.22 with 'Attribute output_shape has
incorrect size'. Migration: use spatial-only output_shape. See PR microsoft#28754
description.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
titaiwangms added a commit to titaiwangms/onnxruntime that referenced this pull request Jun 15, 2026
… leniency)

ONNX 1.22 (rc2, cherry-pick microsoft#8051) tightened convTransposeShapeInference to
fail_shape_inference when an output_shape/output_padding attribute size does not
match the number of spatial dimensions. ORT historically also accepted a
non-spec rank+2 (full N,C,H,W) output_shape form. This is Option A: instead of
patching ONNX to restore the leniency (Option B, commit 031c777), conform
ORT's own test models to the spec so the onnx.patch ConvTranspose hunks never
land in main.

Changes:
- conv_transpose_op_test.cc: 10 output_shape attributes -> spatial-only
  (N,C prefix dropped; Y_shape/expected_vals unchanged). Keep B's
  InvalidKernelShape expected-message fix (ONNX rejects kernel_shape rank at
  Graph::Resolve). Add a new InferenceSession-based regression test
  (ConvTranspose_RankPlus2_OutputShape_DynamicRankInput_Runtime) that feeds an
  unknown-rank input so the kept rank+2 kernel branch stays exercised.
- xnnpack_basic_test.cc: 1 output_shape attribute -> spatial-only.
- conv_transpose_attributes.h: keep the rank+2 toleration (runtime-reachable for
  dynamic-rank inputs) and document why it is retained; no behavior change.
- onnx.patch / binskim.patch: unchanged at the 3-hunk base (no ConvTranspose
  reverts) since this branch is built on the pre-B base.

Breaking change: models specifying a rank+2 output_shape AND a statically-known
input rank now fail to load under ONNX 1.22 with 'Attribute output_shape has
incorrect size'. Migration: use spatial-only output_shape. See PR microsoft#28754
description.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants