Skip to content

Added the testcase for parsing resize when input and output shapes are same #4161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 24, 2025

Conversation

kentqian
Copy link
Contributor

No description provided.

@kentqian kentqian self-assigned this Jul 23, 2025
@kentqian kentqian requested a review from causten as a code owner July 23, 2025 16:17
@kentqian kentqian added the simple small or simple changes label Jul 23, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new test case for the ONNX Resize operator when input and output shapes are the same. The test verifies that the ONNX parser correctly handles resize operations where no actual resizing occurs.

  • Adds a new C++ test case that creates an expected program structure for same input/output shape resize operations
  • Adds a Python function to generate the corresponding ONNX test file with a Resize node using linear interpolation and half_pixel coordinate transformation

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/onnx/parse/resize_with_same_inout_shapes_test.cpp New C++ test case that defines the expected migraphx program structure for resize operations with identical input/output shapes
test/onnx/gen_onnx.py Adds Python function to generate ONNX test file with Resize node configuration for same input/output shapes scenario

@TedThemistokleous TedThemistokleous added the Continous Integration Pull request updates parts of continous integration pipeline label Jul 23, 2025
Copy link

codecov bot commented Jul 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4161   +/-   ##
========================================
  Coverage    92.24%   92.24%           
========================================
  Files          548      548           
  Lines        25188    25188           
========================================
+ Hits         23233    23234    +1     
+ Misses        1955     1954    -1     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
3a3838
Rate old
408b98
Diff Compare
torchvision-resnet50 64 3,231.34 3,250.02 -0.57%
torchvision-resnet50_fp16 64 6,898.12 6,932.46 -0.50%
torchvision-densenet121 32 2,438.28 2,451.56 -0.54%
torchvision-densenet121_fp16 32 4,171.93 4,194.30 -0.53%
torchvision-inceptionv3 32 1,628.04 1,637.52 -0.58%
torchvision-inceptionv3_fp16 32 2,742.31 2,755.56 -0.48%
cadene-inceptionv4 16 766.69 771.29 -0.60%
cadene-resnext64x4 16 741.11 814.51 -9.01% 🔴
slim-mobilenet 64 7,425.63 7,468.33 -0.57%
slim-nasnetalarge 64 209.96 211.12 -0.55%
slim-resnet50v2 64 3,323.60 3,338.43 -0.44%
bert-mrpc-onnx 8 1,140.02 1,148.45 -0.73%
bert-mrpc-tf 1 458.52 457.12 0.31%
pytorch-examples-wlang-gru 1 343.30 375.73 -8.63% 🔴
pytorch-examples-wlang-lstm 1 487.22 471.27 3.39% 🔆
torchvision-resnet50_1 1 790.62 792.04 -0.18%
cadene-dpn92_1 1 412.83 412.62 0.05%
cadene-resnext101_1 1 391.51 393.63 -0.54%
onnx-taau-downsample 1 394.96 397.53 -0.64%
dlrm-criteoterabyte 1 33.66 33.77 -0.32%
dlrm-criteoterabyte_fp16 1 51.14 51.18 -0.09%
agentmodel 1 10,225.79 10,027.59 1.98%
unet_fp16 2 60.53 60.74 -0.34%
resnet50v1_fp16 1 1,044.45 1,026.72 1.73%
resnet50v1_int8 1 1,067.27 1,055.91 1.08%
bert_base_cased_fp16 64 1,162.42 1,170.12 -0.66%
bert_large_uncased_fp16 32 359.36 361.35 -0.55%
bert_large_fp16 1 203.14 203.52 -0.19%
distilgpt2_fp16 16 2,226.22 2,239.92 -0.61%
yolov5s 1 539.72 532.24 1.41%
tinyllama 1 43.83 44.02 -0.45%
vicuna-fastchat 1 45.05 45.26 -0.47%
whisper-tiny-encoder 1 417.67 418.72 -0.25%
whisper-tiny-decoder 1 400.95 403.41 -0.61%
llama2_7b 1 19.13 19.18 -0.26%
qwen1.5-7b 1 23.53 23.67 -0.58%
phi3-3.8b 1 26.77 26.86 -0.34%
mask-rcnn 1 12.75 12.78 -0.21%
llama3-8b 1 21.76 21.84 -0.38%
whisper-large-encoder 1 10.17 10.22 -0.41%
whisper-large-decoder 1 103.55 104.19 -0.61%
mistral-7b 1 23.78 23.85 -0.28%
FLUX.1-schnell 1 773.01 767.54 0.71%
nan nan nan nan nan%

This build is not recommended to merge 🔴

@migraphx-bot
Copy link
Collaborator


     ✅ bert-mrpc-onnx: PASSED: MIGraphX meets tolerance

❌bert-mrpc-tf: ERROR - check error outputerror: unknown warning option '-Wnrvo' [-Werror,-Wunknown-warning-option]

error: unknown warning option '-Wnrvo' [-Werror,-Wunknown-warning-option]

2025-07-23 18:19:14.438281: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1753312759.841908 184620 gpu_device.cc:2022] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 61729 MB memory: -> device: 0, name: AMD Instinct MI250X/MI250, pci bus id: 0000:32:00.0
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1753312760.703047 184620 mlir_graph_optimization_pass.cc:401] MLIR V1 optimization pass is not enabled
2025-07-23 18:19:29.322514: E external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:250] bitcode module is required by this HLO module but was not found at ./opencl.bc
2025-07-23 18:19:29.322559: E external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:250] bitcode module is required by this HLO module but was not found at ./opencl.bc
2025-07-23 18:19:29.322713: E external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:250] bitcode module is required by this HLO module but was not found at ./opencl.bc
2025-07-23 18:19:29.322742: E external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:250] bitcode module is required by this HLO module but was not found at ./opencl.bc
2025-07-23 18:19:29.322782: E external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:250] bitcode module is required by this HLO module but was not found at ./opencl.bc
2025-07-23 18:19:29.322821: E external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:250] bitcode module is required by this HLO module but was not found at ./opencl.bc
2025-07-23 18:19:29.322863: E external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:250] bitcode module is required by this HLO module but was not found at ./opencl.bc
2025-07-23 18:19:29.322906: E external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:250] bitcode module is required by this HLO module but was not found at ./opencl.bc
error: Failure when generating HSACO
error: Failure when generating HSACO
error: Failure when generating HSACO
error: Failure when generating HSACO
error: Failure when generating HSACO
error: Failure when generating HSACO
error: Failure when generating HSACO
error: Failure when generating HSACO
2025-07-23 18:19:29.323963: E tensorflow/compiler/mlir/tools/kernel_gen/tf_framework_c_interface.cc:228] INTERNAL: Generating device code failed.
2025-07-23 18:19:29.325053: W tensorflow/core/framework/op_kernel.cc:1829] UNKNOWN: JIT compilation failed.
2025-07-23 18:19:29.325073: I tensorflow/core/framework/local_rendezvous.cc:405] Local rendezvous is aborting with status: UNKNOWN: JIT compilation failed.
[[{{node import/bert/embeddings/LayerNorm/moments/SquaredDifference}}]]
2025-07-23 18:19:29.325084: I tensorflow/core/framework/local_rendezvous.cc:405] Local rendezvous is aborting with status: UNKNOWN: JIT compilation failed.
[[{{node import/bert/embeddings/LayerNorm/moments/SquaredDifference}}]]
[[import/loss/output/_21]]
2025-07-23 18:19:29.325099: I tensorflow/core/framework/local_rendezvous.cc:424] Local rendezvous recv item cancelled. Key hash: 11217777527359497193
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/client/session.py", line 1407, in _do_call
return fn(*args)
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/client/session.py", line 1390, in _run_fn
return self._call_tf_sessionrun(options, feed_dict, fetch_list,
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/client/session.py", line 1483, in _call_tf_sessionrun
return tf_session.TF_SessionRun_wrapper(self._session, options, feed_dict,
tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.
(0) UNKNOWN: JIT compilation failed.
[[{{node import/bert/embeddings/LayerNorm/moments/SquaredDifference}}]]
[[import/loss/output/_21]]
(1) UNKNOWN: JIT compilation failed.
[[{{node import/bert/embeddings/LayerNorm/moments/SquaredDifference}}]]
0 successful operations.
0 derived errors ignored.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 359, in
main()
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 335, in main
y_out = sess.run(y, feed_dict=tf_dict)
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/client/session.py", line 977, in run
result = self._run(None, fetches, feed_dict, options_ptr,
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/client/session.py", line 1220, in _run
results = self._do_run(handle, final_targets, final_fetches,
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/client/session.py", line 1400, in _do_run
return self._do_call(_run_fn, feeds, fetches, targets, options,
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/client/session.py", line 1426, in _do_call
raise type(e)(node_def, op, message) # pylint: disable=no-value-for-parameter
tensorflow.python.framework.errors_impl.UnknownError: Graph execution error:

Detected at node 'import/bert/embeddings/LayerNorm/moments/SquaredDifference' defined at (most recent call last):
Node: 'import/bert/embeddings/LayerNorm/moments/SquaredDifference'
Detected at node 'import/bert/embeddings/LayerNorm/moments/SquaredDifference' defined at (most recent call last):
Node: 'import/bert/embeddings/LayerNorm/moments/SquaredDifference'
2 root error(s) found.
(0) UNKNOWN: JIT compilation failed.
[[{{node import/bert/embeddings/LayerNorm/moments/SquaredDifference}}]]
[[import/loss/output/_21]]
(1) UNKNOWN: JIT compilation failed.
[[{{node import/bert/embeddings/LayerNorm/moments/SquaredDifference}}]]
0 successful operations.
0 derived errors ignored.

Original stack trace for 'import/bert/embeddings/LayerNorm/moments/SquaredDifference':


     ✅ pytorch-examples-wlang-gru: PASSED: MIGraphX meets tolerance

     ✅ pytorch-examples-wlang-lstm: PASSED: MIGraphX meets tolerance

     ✅ dlrm-criteoterabyte: PASSED: MIGraphX meets tolerance

     ✅ agentmodel: PASSED: MIGraphX meets tolerance

🔴unet: FAILED: MIGraphX is not within tolerance - check verbose output


     ✅ resnet50v1: PASSED: MIGraphX meets tolerance

     ✅ bert_base_cased_fp16: PASSED: MIGraphX meets tolerance

🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output


     ✅ bert_large: PASSED: MIGraphX meets tolerance

     ✅ yolov5s: PASSED: MIGraphX meets tolerance

     ✅ tinyllama: PASSED: MIGraphX meets tolerance

     ✅ vicuna-fastchat: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-encoder: PASSED: MIGraphX meets tolerance

     ✅ whisper-tiny-decoder: PASSED: MIGraphX meets tolerance

     ✅ distilgpt2_fp16: PASSED: MIGraphX meets tolerance

     ✅ llama2_7b: PASSED: MIGraphX meets tolerance

     ✅ qwen1.5-7b: PASSED: MIGraphX meets tolerance

     ✅ phi3-3.8b: PASSED: MIGraphX meets tolerance

🔴mask-rcnn: FAILED: MIGraphX is not within tolerance - check verbose output


     ✅ llama3-8b: PASSED: MIGraphX meets tolerance

     ✅ whisper-large-decoder: PASSED: MIGraphX meets tolerance

     ✅ mistral-7b: PASSED: MIGraphX meets tolerance

     ✅ FLUX.1-schnell: PASSED: MIGraphX meets tolerance

@kentqian kentqian changed the title Resize same inout shapes testcase adding Added the testcase for parsing resize when input and output shapes are same Jul 24, 2025
@causten causten merged commit c2cf84f into develop Jul 24, 2025
48 of 53 checks passed
@causten causten deleted the resize_same_inout_shapes_testcase_adding branch July 24, 2025 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Continous Integration Pull request updates parts of continous integration pipeline simple small or simple changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants