-
Notifications
You must be signed in to change notification settings - Fork 404
fix_prebuiild_asm #1439
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
fix_prebuiild_asm #1439
Changes from 1 commit
89e693a
e240972
0b904dd
8722ea1
10c8892
069b5b3
ad8899d
4c4f12a
1654310
e65d743
32797e5
a068800
82417d2
1343a4a
f0771f2
e519df1
ec8475f
3ecbf01
0703559
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -62,6 +62,8 @@ get_heuristic_kernel(int M, | |||||||||||||||
| hipDeviceProp_t dev_prop; | ||||||||||||||||
| HIP_CALL(hipGetDevice(&dev)); | ||||||||||||||||
| HIP_CALL(hipGetDeviceProperties(&dev_prop, dev)); | ||||||||||||||||
| std::string arch_id = get_gpu_arch(); | ||||||||||||||||
| printf("Arch ID: %s\n", arch_id.c_str()); | ||||||||||||||||
| uint32_t num_cu = dev_prop.multiProcessorCount; | ||||||||||||||||
| // printf("num_cu: %d\n", num_cu); | ||||||||||||||||
| uint32_t empty_cu = num_cu; | ||||||||||||||||
|
|
@@ -75,6 +77,8 @@ get_heuristic_kernel(int M, | |||||||||||||||
|
|
||||||||||||||||
| for(const auto& el : *cfgs) | ||||||||||||||||
| { | ||||||||||||||||
| if (el.first.find(arch_id) != 0) | ||||||||||||||||
| continue; | ||||||||||||||||
| const auto& cfg = el.second; | ||||||||||||||||
|
Comment on lines
+82
to
84
|
||||||||||||||||
| if (el.first.find(arch_id) != 0) | |
| continue; | |
| const auto& cfg = el.second; | |
| const auto& cfg = el.second; | |
| // Explicitly match architecture using cfg.arch instead of relying on kernel name format. | |
| if (cfg.arch != arch_id) | |
| continue; |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Debug printf statement should be removed or guarded by a debug flag before merging to production. Consider using a proper logging mechanism or conditional compilation.
| selectedKernelName = el.first; | |
| printf("Selected Kernel: %s\n", selectedKernelName.c_str()); | |
| selectedKernelName = el.first; | |
| #ifdef DEBUG_ASM_GEMM | |
| printf("Selected Kernel: %s\n", selectedKernelName.c_str()); | |
| #endif |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,113 @@ | ||||||||
| # SPDX-License-Identifier: MIT | ||||||||
| # Copyright (C) 2018-2025, Advanced Micro Devices, Inc. All rights reserved. | ||||||||
|
|
||||||||
| import os | ||||||||
| import sys | ||||||||
|
||||||||
| import sys |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential AttributeError if AITER_ASM_DIR environment variable is not set. The code will fail with AttributeError: 'NoneType' object has no attribute 'split'. Add a check or provide a default value.
| archs = [os.path.basename(os.path.normpath(path)) for path in os.environ.get("AITER_ASM_DIR").split(":")] | |
| archs = [os.path.basename(os.path.normpath(path)) for path in os.environ.get("AITER_ASM_DIR", "").split(":") if path] |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'kernle' to 'kernel'.
| help="""module of ASM kernle | |
| help="""module of ASM kernel |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error is printed but execution continues, which may lead to downstream failures. The script should exit with a non-zero status code after printing the error using sys.exit(1) to prevent generating invalid configurations.
| print(f"ERROR: Invalid assembly CSV format -- {single_file}. Missing required columns: {', '.join(missing)}") | |
| print(f"ERROR: Invalid assembly CSV format -- {single_file}. Missing required columns: {', '.join(missing)}") | |
| sys.exit(1) |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Use if not have_get_header: instead of if have_get_header == False: for more Pythonic code.
| if have_get_header == False: | |
| if not have_get_header: |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing string concatenation operator between path and co_name. This will result in a C++ syntax error. Should be path \" \" co_name or path + co_name depending on the intended behavior.
| arch knl_name, {{ knl_name, path co_name, arch, {other_columns_comma} }} \\ | |
| arch knl_name, {{ knl_name, path + co_name, arch, {other_columns_comma} }} \\ |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable el is used from the outer loop but this code is inside a loop iterating over file_info_list. The variable el refers to the last CSV file from the outer loop (line 49), not the current file. This will generate incorrect paths. Should use single_file or track the file path correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Debug printf statement should be removed or guarded by a debug flag before merging to production. Consider using a proper logging mechanism or conditional compilation.