CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
52 lines
1.7 KiB
Python
52 lines
1.7 KiB
Python
# Copyright (C) Advanced Micro Devices, Inc., or its affiliates.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
import re
|
|
import argparse
|
|
import time
|
|
import os
|
|
|
|
def parse_input_log(args, tuning_info):
|
|
|
|
start_time = time.time()
|
|
|
|
# save unique lines in hipblaslt log
|
|
os.makedirs(args.output_path, exist_ok=True)
|
|
unique_log_name = args.output_path + '/unique_' + args.input_file.split('/')[-1]
|
|
f_out = open(unique_log_name, 'w')
|
|
|
|
with open(args.input_file, 'r') as f:
|
|
for line in f:
|
|
if 'hipblaslt-bench' not in line:
|
|
continue
|
|
|
|
if line in tuning_info:
|
|
tuning_info[line]['count'] += 1
|
|
continue
|
|
else:
|
|
tuning_info[line] = {}
|
|
tuning_info[line]['count'] = 1
|
|
f_out.write(line)
|
|
matches = re.findall(r"-(m|n|k)\s+(\d+)", line)
|
|
matches.extend(re.findall(r"--(lda|ldb|ldc|ldd)\s+(\d+)", line))
|
|
matches.extend(re.findall(r"--(a_type|b_type|c_type|d_type)\s+(\S+)", line))
|
|
tuning_info[line].update({key: value for key, value in matches})
|
|
|
|
end_time = time.time()
|
|
print("parsing time elapsed = {} seconds".format(end_time - start_time))
|
|
print("After removing duplicate, the hipblaslt log is saved at\n", unique_log_name, "\n")
|
|
|
|
return unique_log_name
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description="Execute Gemm Tuning")
|
|
parser.add_argument("--input_file", type=str, help="Path to the list of gemm ops")
|
|
parser.add_argument("--output_path", type=str, default='.', help="Path to output file")
|
|
args = parser.parse_args()
|
|
|
|
tuning_info = dict()
|
|
unique_log_name = parse_input_log(args, tuning_info)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|