AMDMIGraphX icon indicating copy to clipboard operation
AMDMIGraphX copied to clipboard

Enable MIGRAPHX_MLIR_TUNING_CFG generation when defined

Open richagadgil opened this issue 1 year ago • 3 comments

if(solution.is_null() or not tuning_cfg_path.empty())
       get_module_tuned();

The above code change allows rocMLIR team to run with a config even if solution is null (has been requested in the past), if the config file is specified

MIGRAPHX_ENABLE_MLIR=1 MIGRAPHX_MLIR_TUNING_CFG=../unet.cfg /code/AMDMIGraphX/build/bin/migra
phx-driver compile /models/resnet50_v1.onnx

richagadgil avatar Nov 13 '24 19:11 richagadgil

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3616   +/-   ##
========================================
  Coverage    92.04%   92.04%           
========================================
  Files          531      531           
  Lines        24527    24527           
========================================
  Hits         22574    22574           
  Misses        1953     1953           
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 13 '24 21:11 codecov[bot]

/AzurePipelines run

jayhawk-commits avatar Mar 07 '25 22:03 jayhawk-commits

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Mar 07 '25 22:03 azure-pipelines[bot]

Test Batch Rate new
64c5a0
Rate old
a4acf4
Diff Compare
torchvision-resnet50 64 3,255.72 3,239.15 0.51% :white_check_mark:
torchvision-resnet50_fp16 64 6,908.00 6,884.81 0.34% :white_check_mark:
torchvision-densenet121 32 2,448.13 2,442.67 0.22% :white_check_mark:
torchvision-densenet121_fp16 32 4,193.21 4,170.35 0.55% :white_check_mark:
torchvision-inceptionv3 32 1,479.69 1,619.07 -8.61% :red_circle:
torchvision-inceptionv3_fp16 32 2,725.14 2,709.73 0.57% :white_check_mark:
cadene-inceptionv4 16 760.67 756.52 0.55% :white_check_mark:
cadene-resnext64x4 16 814.26 814.33 -0.01% :white_check_mark:
slim-mobilenet 64 7,475.16 7,438.70 0.49% :white_check_mark:
slim-nasnetalarge 64 209.58 208.61 0.47% :white_check_mark:
slim-resnet50v2 64 3,348.21 3,335.63 0.38% :white_check_mark:
bert-mrpc-onnx 8 1,148.15 1,142.79 0.47% :white_check_mark:
bert-mrpc-tf 1 460.16 460.73 -0.12% :white_check_mark:
pytorch-examples-wlang-gru 1 345.18 356.22 -3.10% :red_circle:
pytorch-examples-wlang-lstm 1 472.83 484.39 -2.39% :white_check_mark:
torchvision-resnet50_1 1 797.57 799.61 -0.26% :white_check_mark:
cadene-dpn92_1 1 414.73 419.54 -1.15% :white_check_mark:
cadene-resnext101_1 1 393.46 392.72 0.19% :white_check_mark:
onnx-taau-downsample 1 396.06 395.32 0.19% :white_check_mark:
dlrm-criteoterabyte 1 33.39 32.22 3.64% :high_brightness:
dlrm-criteoterabyte_fp16 1 51.33 51.29 0.07% :white_check_mark:
agentmodel 1 10,355.47 10,056.98 2.97% :white_check_mark:
unet_fp16 2 59.63 59.42 0.35% :white_check_mark:
resnet50v1_fp16 1 998.10 1,041.91 -4.20% :red_circle:
resnet50v1_int8 1 1,055.46 1,064.30 -0.83% :white_check_mark:
bert_base_cased_fp16 64 1,175.74 1,170.58 0.44% :white_check_mark:
bert_large_uncased_fp16 32 351.95 356.45 -1.26% :white_check_mark:
bert_large_fp16 1 190.99 199.92 -4.46% :red_circle:
distilgpt2_fp16 16 2,236.78 2,231.69 0.23% :white_check_mark:
yolov5s 1 540.55 546.59 -1.11% :white_check_mark:
tinyllama 1 43.86 43.68 0.41% :white_check_mark:
vicuna-fastchat 1 45.16 44.86 0.66% :white_check_mark:
whisper-tiny-encoder 1 419.46 418.09 0.33% :white_check_mark:
whisper-tiny-decoder 1 411.83 402.71 2.26% :white_check_mark:
llama2_7b 1 19.12 19.06 0.32% :white_check_mark:
qwen1.5-7b 1 22.89 23.44 -2.34% :white_check_mark:
phi3-3.8b 1 26.63 26.55 0.32% :white_check_mark:
mask-rcnn 1 12.85 12.86 -0.14% :white_check_mark:
llama3-8b 1 21.74 21.65 0.39% :white_check_mark:
whisper-large-encoder 1 10.22 10.18 0.42% :white_check_mark:
whisper-large-decoder 1 101.32 101.16 0.15% :white_check_mark:
mistral-7b 1 23.77 23.69 0.33% :white_check_mark:
FLUX.1-schnell 1 768.11 775.66 -0.97% :white_check_mark:
nan nan nan nan nan% :x:

This build is not recommended to merge :red_circle:

migraphx-bot avatar Jun 17 '25 11:06 migraphx-bot


     :white_check_mark: bert-mrpc-onnx: PASSED: MIGraphX meets tolerance
:x:bert-mrpc-tf: ERROR - check error output2025-06-17 05:25:02.110042: 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:1750155907.841888 180246 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:1750155908.758926 180246 mlir_graph_optimization_pass.cc:401] MLIR V1 optimization pass is not enabled
2025-06-17 05:25:18.824404: 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-06-17 05:25:18.824473: 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-06-17 05:25:18.824772: 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-06-17 05:25:18.824820: 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-06-17 05:25:18.824871: 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-06-17 05:25:18.824925: 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-06-17 05:25:18.824977: 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-06-17 05:25:18.825031: 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-06-17 05:25:18.826048: E tensorflow/compiler/mlir/tools/kernel_gen/tf_framework_c_interface.cc:228] INTERNAL: Generating device code failed.
2025-06-17 05:25:18.827281: W tensorflow/core/framework/op_kernel.cc:1829] UNKNOWN: JIT compilation failed.
2025-06-17 05:25:18.827300: 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-06-17 05:25:18.827311: 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-06-17 05:25:18.827325: 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':

     :white_check_mark: pytorch-examples-wlang-gru: PASSED: MIGraphX meets tolerance
     :white_check_mark: pytorch-examples-wlang-lstm: PASSED: MIGraphX meets tolerance
     :white_check_mark: dlrm-criteoterabyte: PASSED: MIGraphX meets tolerance
     :white_check_mark: agentmodel: PASSED: MIGraphX meets tolerance
:red_circle:unet: FAILED: MIGraphX is not within tolerance - check verbose output

     :white_check_mark: resnet50v1: PASSED: MIGraphX meets tolerance
     :white_check_mark: bert_base_cased_fp16: PASSED: MIGraphX meets tolerance
:red_circle:bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output

     :white_check_mark: bert_large: PASSED: MIGraphX meets tolerance
     :white_check_mark: yolov5s: PASSED: MIGraphX meets tolerance
     :white_check_mark: tinyllama: PASSED: MIGraphX meets tolerance
     :white_check_mark: vicuna-fastchat: PASSED: MIGraphX meets tolerance
     :white_check_mark: whisper-tiny-encoder: PASSED: MIGraphX meets tolerance
     :white_check_mark: whisper-tiny-decoder: PASSED: MIGraphX meets tolerance
     :white_check_mark: distilgpt2_fp16: PASSED: MIGraphX meets tolerance
     :white_check_mark: llama2_7b: PASSED: MIGraphX meets tolerance
     :white_check_mark: qwen1.5-7b: PASSED: MIGraphX meets tolerance
     :white_check_mark: phi3-3.8b: PASSED: MIGraphX meets tolerance
:red_circle:mask-rcnn: FAILED: MIGraphX is not within tolerance - check verbose output

     :white_check_mark: llama3-8b: PASSED: MIGraphX meets tolerance
     :white_check_mark: whisper-large-decoder: PASSED: MIGraphX meets tolerance
     :white_check_mark: mistral-7b: PASSED: MIGraphX meets tolerance
     :white_check_mark: FLUX.1-schnell: PASSED: MIGraphX meets tolerance

migraphx-bot avatar Jun 17 '25 11:06 migraphx-bot