Skip to content

Refactor License and Format Files #3959

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 24 commits into from
May 14, 2025
Merged

Refactor License and Format Files #3959

merged 24 commits into from
May 14, 2025

Conversation

richagadgil
Copy link
Contributor

@richagadgil richagadgil commented Apr 18, 2025

We have been seeing periodic failures in CI (licensing and formatting) due to conflicting logic/critieria and variations in getting changed files from Github.

Critical things this PR adds:

  • Helper functions in git_tools.py to ensure all CI uses the same method to get changedFiles, allFiles, etc.
  • Change check_stamped.py and license_stamper.py to use the same criteria to determine stamp status (stampCheck())
  • Introduce StampStatus Enum instead of multiple lists for files based on their license status

Copy link

codecov bot commented Apr 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3959   +/-   ##
========================================
  Coverage    92.12%   92.12%           
========================================
  Files          528      528           
  Lines        24317    24317           
========================================
  Hits         22401    22401           
  Misses        1916     1916           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@richagadgil richagadgil changed the title fix lc Refactor License and Format Files Apr 22, 2025
@richagadgil richagadgil marked this pull request as ready for review April 22, 2025 21:14
@richagadgil richagadgil requested a review from causten as a code owner April 22, 2025 21:14
@richagadgil richagadgil self-assigned this Apr 22, 2025
@TedThemistokleous TedThemistokleous added Continous Integration Pull request updates parts of continous integration pipeline Cleanup Cleans up code from stale bits/warnings/previous changes for a previous feature PR labels Apr 22, 2025
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.

You should run pylint or another python linter.

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.

Tool can not handle a single year date, nor can it handle spaces between the dash between years
i.e.
Copyright (c) 2025
Copyright (c) 2015 - 2025
Copyright (c) 2021-2025

All cases above produce...
Error: 1 Wrong year in license files:
['t.cpp']

@kahmed10 kahmed10 requested a review from pfultz2 April 25, 2025 16:57
@migraphx-bot
Copy link
Collaborator

Test Batch Rate new
8cde27
Rate old
03922b
Diff Compare
torchvision-resnet50 64 3,237.87 3,239.59 -0.05%
torchvision-resnet50_fp16 64 6,915.29 6,909.63 0.08%
torchvision-densenet121 32 2,444.74 2,447.49 -0.11%
torchvision-densenet121_fp16 32 4,223.40 4,221.15 0.05%
torchvision-inceptionv3 32 1,619.11 1,619.85 -0.05%
torchvision-inceptionv3_fp16 32 2,707.73 2,708.58 -0.03%
cadene-inceptionv4 16 756.69 756.74 -0.01%
cadene-resnext64x4 16 815.17 815.07 0.01%
slim-mobilenet 64 7,439.40 7,433.96 0.07%
slim-nasnetalarge 64 215.90 215.90 -0.00%
slim-resnet50v2 64 3,333.19 3,332.05 0.03%
bert-mrpc-onnx 8 1,143.95 1,145.28 -0.12%
bert-mrpc-tf 1 457.52 470.20 -2.70%
pytorch-examples-wlang-gru 1 342.94 342.73 0.06%
pytorch-examples-wlang-lstm 1 474.68 477.46 -0.58%
torchvision-resnet50_1 1 816.23 817.69 -0.18%
cadene-dpn92_1 1 433.44 431.34 0.49%
cadene-resnext101_1 1 391.54 391.77 -0.06%
onnx-taau-downsample 1 395.10 394.59 0.13%
dlrm-criteoterabyte 1 32.19 32.20 -0.02%
dlrm-criteoterabyte_fp16 1 51.21 51.17 0.08%
agentmodel 1 10,042.66 10,686.82 -6.03% 🔴
unet_fp16 2 59.39 59.32 0.11%
resnet50v1_fp16 1 1,085.16 1,082.39 0.26%
resnet50v1_int8 1 1,074.49 1,058.20 1.54%
bert_base_cased_fp16 64 1,163.03 1,163.66 -0.05%
bert_large_uncased_fp16 32 355.71 356.17 -0.13%
bert_large_fp16 1 199.12 200.85 -0.86%
distilgpt2_fp16 16 2,227.18 2,226.62 0.03%
yolov5s 1 535.34 536.08 -0.14%
tinyllama 1 43.68 43.70 -0.05%
vicuna-fastchat 1 44.94 44.76 0.39%
whisper-tiny-encoder 1 419.44 419.13 0.07%
whisper-tiny-decoder 1 410.87 411.20 -0.08%
llama2_7b 1 nan nan nan%
qwen1.5-7b 1 23.45 23.44 0.05%
phi3-3.8b 1 26.52 26.53 -0.04%
mask-rcnn 1 12.75 12.80 -0.39%
llama3-8b 1 21.69 21.66 0.15%
whisper-large-encoder 1 10.18 10.18 0.01%
whisper-large-decoder 1 101.09 100.33 0.76%
mistral-7b 1 23.67 23.66 0.04%
FLUX.1-schnell 1 912.14 916.31 -0.46%
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-05-13 17:36:00.576207: 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:1747175766.201477 163344 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:32:00.0
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1747175767.076697 163344 mlir_graph_optimization_pass.cc:401] MLIR V1 optimization pass is not enabled
2025-05-13 17:36:16.732380: 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-05-13 17:36:16.732515: 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-05-13 17:36:16.732552: 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-05-13 17:36:16.732581: 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-05-13 17:36:16.732625: 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-05-13 17:36:16.732664: 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-05-13 17:36:16.732704: 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-05-13 17:36:16.732749: 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-05-13 17:36:16.733851: E tensorflow/compiler/mlir/tools/kernel_gen/tf_framework_c_interface.cc:228] INTERNAL: Generating device code failed.
2025-05-13 17:36:16.734919: W tensorflow/core/framework/op_kernel.cc:1829] UNKNOWN: JIT compilation failed.
2025-05-13 17:36:16.734938: 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-05-13 17:36:16.734949: 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-05-13 17:36:16.734970: 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 340, in
main()
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 324, 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: ERROR - check error outputTraceback (most recent call last):
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 340, in
main()
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 205, in main
model = migraphx.parse_onnx(model_name, default_dim_value=batch)
RuntimeError: /src/AMDMIGraphX/src/onnx/onnx_parser.cpp:265: parse_from: PARSE_FROM: Failed reading onnx file: /new-saved-models/llama2_7b/decoder_model.onnx


❌qwen1.5-7b: ERROR - check error outputusage: accuracy_checker.py [-h] [--onnx ONNX] [--tf TF] [--provider PROVIDER]
[--batch BATCH] [--fill1] [--fill0] [--fp16]
[--argmax] [--verbose] [--tolerance TOLERANCE]
[--input-dim INPUT_DIM] [--target TARGET]
[--ort-run] [--ort-logging]
[--disable-offload-copy] [--disable-fast-math]
[--exhaustive_tune]
accuracy_checker.py: error: unrecognized arguments: input_ids attention_mask position_ids 1 256 @attention_mask 1 256 @position_ids 1 256


❌phi3-3.8b: ERROR - check error outputusage: accuracy_checker.py [-h] [--onnx ONNX] [--tf TF] [--provider PROVIDER]
[--batch BATCH] [--fill1] [--fill0] [--fp16]
[--argmax] [--verbose] [--tolerance TOLERANCE]
[--input-dim INPUT_DIM] [--target TARGET]
[--ort-run] [--ort-logging]
[--disable-offload-copy] [--disable-fast-math]
[--exhaustive_tune]
accuracy_checker.py: error: unrecognized arguments: input_ids attention_mask position_ids 1 256 @attention_mask 1 256 @position_ids 1 256


❌mask-rcnn: ERROR - check error outputusage: accuracy_checker.py [-h] [--onnx ONNX] [--tf TF] [--provider PROVIDER]
[--batch BATCH] [--fill1] [--fill0] [--fp16]
[--argmax] [--verbose] [--tolerance TOLERANCE]
[--input-dim INPUT_DIM] [--target TARGET]
[--ort-run] [--ort-logging]
[--disable-offload-copy] [--disable-fast-math]
[--exhaustive_tune]
accuracy_checker.py: error: unrecognized arguments: 3 800 800


     ✅ llama3-8b: PASSED: MIGraphX meets tolerance

❌#whisper-large-encoder: ERROR - check error outputTraceback (most recent call last):
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 340, in
main()
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 205, in main
model = migraphx.parse_onnx(model_name, default_dim_value=batch)
RuntimeError: /src/AMDMIGraphX/src/include/migraphx/op/convolution.hpp:100: normalize_compute_shape: CONVOLUTION: mismatched channel numbers


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

     ✅ mistral-7b: PASSED: MIGraphX meets tolerance

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

@causten causten merged commit 8274074 into develop May 14, 2025
43 of 47 checks passed
@causten causten deleted the fix_lc branch May 14, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Cleans up code from stale bits/warnings/previous changes for a previous feature PR Continous Integration Pull request updates parts of continous integration pipeline
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants