Skip to content

[rocm7.0] Fix parse resize when input and output shapes are same (#4133) (#4161) #4155

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

Open
wants to merge 2 commits into
base: release/rocm-rel-7.0
Choose a base branch
from

Conversation

TedThemistokleous
Copy link
Collaborator

Needed to run customer models in ROCm 7.0. Fixes an issue we were hitting.

@TedThemistokleous TedThemistokleous added the roadmap Tasks to finish for a release label Jul 21, 2025
@TedThemistokleous TedThemistokleous changed the base branch from develop to release/rocm-rel-7.0 July 21, 2025 22:38
@causten causten changed the title Fix parse resize when input and output shapes are same (#4133) [rocm7.0] Fix parse resize when input and output shapes are same (#4133) Jul 21, 2025
@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
a33cee
Rate old
3116c7
Diff Compare
torchvision-resnet50 64 3,248.93 3,245.58 0.10%
torchvision-resnet50_fp16 64 6,929.90 6,932.78 -0.04%
torchvision-densenet121 32 2,449.09 2,448.50 0.02%
torchvision-densenet121_fp16 32 4,179.69 4,194.27 -0.35%
torchvision-inceptionv3 32 1,637.45 1,637.03 0.03%
torchvision-inceptionv3_fp16 32 2,756.89 2,751.15 0.21%
cadene-inceptionv4 16 771.01 771.02 -0.00%
cadene-resnext64x4 16 814.15 813.58 0.07%
slim-mobilenet 64 7,470.24 7,467.22 0.04%
slim-nasnetalarge 64 211.08 211.05 0.01%
slim-resnet50v2 64 3,339.68 3,341.88 -0.07%
bert-mrpc-onnx 8 1,149.73 1,146.68 0.27%
bert-mrpc-tf 1 458.40 457.83 0.12%
pytorch-examples-wlang-gru 1 341.36 335.57 1.73%
pytorch-examples-wlang-lstm 1 470.60 471.51 -0.19%
torchvision-resnet50_1 1 794.51 793.95 0.07%
cadene-dpn92_1 1 416.45 413.94 0.61%
cadene-resnext101_1 1 392.87 388.08 1.24%
onnx-taau-downsample 1 396.05 396.09 -0.01%
dlrm-criteoterabyte 1 33.78 33.76 0.03%
dlrm-criteoterabyte_fp16 1 51.22 51.20 0.05%
agentmodel 1 10,339.07 10,382.46 -0.42%
unet_fp16 2 60.69 60.71 -0.04%
resnet50v1_fp16 1 1,036.76 1,027.59 0.89%
resnet50v1_int8 1 1,055.03 1,031.76 2.26%
bert_base_cased_fp16 64 1,170.00 1,170.17 -0.01%
bert_large_uncased_fp16 32 361.30 361.37 -0.02%
bert_large_fp16 1 201.96 202.02 -0.03%
distilgpt2_fp16 16 2,241.09 2,241.01 0.00%
yolov5s 1 540.77 540.21 0.10%
tinyllama 1 44.02 43.96 0.14%
vicuna-fastchat 1 45.30 45.39 -0.19%
whisper-tiny-encoder 1 419.31 419.33 -0.01%
whisper-tiny-decoder 1 403.34 403.05 0.07%
llama2_7b 1 19.18 19.18 -0.02%
qwen1.5-7b 1 23.61 23.67 -0.27%
phi3-3.8b 1 26.86 26.88 -0.10%
mask-rcnn 1 12.71 12.76 -0.41%
llama3-8b 1 21.84 21.84 0.03%
whisper-large-encoder 1 10.22 10.22 -0.00%
whisper-large-decoder 1 101.76 103.57 -1.75%
mistral-7b 1 23.87 23.85 0.06%
FLUX.1-schnell 1 781.09 767.98 1.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 output2025-07-21 21:39:43.449255: 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:1753151988.934632 181467 gpu_device.cc:2022] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 62973 MB memory: -> device: 0, name: AMD Instinct MI250X/MI250, pci bus id: 0000:b3:00.0
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1753151989.789405 181467 mlir_graph_optimization_pass.cc:401] MLIR V1 optimization pass is not enabled
2025-07-21 21:39:58.492859: 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-21 21:39:58.492914: 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-21 21:39:58.492948: 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-21 21:39:58.492994: 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-21 21:39:58.493025: 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-21 21:39:58.493076: 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-21 21:39:58.493124: 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-21 21:39:58.493153: 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-21 21:39:58.494485: E tensorflow/compiler/mlir/tools/kernel_gen/tf_framework_c_interface.cc:228] INTERNAL: Generating device code failed.
2025-07-21 21:39:58.495822: W tensorflow/core/framework/op_kernel.cc:1829] UNKNOWN: JIT compilation failed.
2025-07-21 21:39:58.495844: 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-21 21:39:58.495857: 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-21 21:39:58.495884: 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

Copy link
Collaborator

@causten causten left a comment

Choose a reason for hiding this comment

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

For the develop branch and for this add a test case

@kentqian
Copy link
Contributor

For the develop branch and for this add a test case

I am going to add it at once

@TedThemistokleous
Copy link
Collaborator Author

Odd CI is failing on the machine again with no deviceid

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                  @@
##           release/rocm-rel-7.0    #4155   +/-   ##
=====================================================
  Coverage                 92.21%   92.21%           
=====================================================
  Files                       545      545           
  Lines                     25107    25109    +2     
=====================================================
+ Hits                      23152    23154    +2     
  Misses                     1955     1955           
Files with missing lines Coverage Δ
src/onnx/parse_resize.cpp 95.77% <100.00%> (+0.05%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kentqian kentqian changed the title [rocm7.0] Fix parse resize when input and output shapes are same (#4133) [rocm7.0] Fix parse resize when input and output shapes are same (#4133) (#4161) Jul 27, 2025
@kentqian kentqian requested a review from causten July 27, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap Tasks to finish for a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants