reformatting

Signed-off-by: josantos <josantos@amd.com>
This commit is contained in:
josantos
2023-08-10 11:16:50 -05:00
bovenliggende 59d77f9d81
commit bbb254ef43
2 gewijzigde bestanden met toevoegingen van 21 en 17 verwijderingen
@@ -222,15 +222,17 @@ def run_cli(args, runs):
# If we assume the panel layout for all archs are similar, it doesn't matter # If we assume the panel layout for all archs are similar, it doesn't matter
# which archConfig passed into show_all function. # which archConfig passed into show_all function.
# After decide to how to manage kernels display patterns, we can revisit it. # After decide to how to manage kernels display patterns, we can revisit it.
cache =dict() cache = dict()
for d in args.path: for d in args.path:
#demangle # demangle
for filename in os.listdir(d[0]): for filename in os.listdir(d[0]):
if filename.endswith('.csv'): if filename.endswith(".csv"):
df = pd.read_csv(os.path.join(d[0],filename)) df = pd.read_csv(os.path.join(d[0], filename))
new_df = csv_converter.kernel_name_shortener(df, cache, args.kernelVerbose) new_df = csv_converter.kernel_name_shortener(
new_df.to_csv(os.path.join(d[0],filename), index=False) df, cache, args.kernelVerbose
)
new_df.to_csv(os.path.join(d[0], filename), index=False)
file_io.create_df_kernel_top_stats( file_io.create_df_kernel_top_stats(
d[0], d[0],
runs[d[0]].filter_gpu_ids, runs[d[0]].filter_gpu_ids,
+12 -10
Bestand weergeven
@@ -39,6 +39,7 @@ cache = dict()
supported_arch = {"gfx906": "mi50", "gfx908": "mi100", "gfx90a": "mi200"} supported_arch = {"gfx906": "mi50", "gfx908": "mi100", "gfx90a": "mi200"}
MAX_SERVER_SEL_DELAY = 5000 # 5 sec connection timeout MAX_SERVER_SEL_DELAY = 5000 # 5 sec connection timeout
def kernel_name_shortener(df, cache, level): def kernel_name_shortener(df, cache, level):
if level >= 5: if level >= 5:
return df return df
@@ -116,6 +117,7 @@ def kernel_name_shortener(df, cache, level):
return df return df
# Verify target directory and setup connection # Verify target directory and setup connection
def parse(args, profileAndExport): def parse(args, profileAndExport):
host = args.host host = args.host
@@ -243,16 +245,16 @@ def convert_folder(connectionInfo, Extractionlvl):
# os.system(cmd) # os.system(cmd)
# else: # else:
cmd = ( cmd = (
"mongoimport --quiet --uri mongodb://{}:{}@{}:{}/{}?authSource=admin --file {} -c {} --drop --type csv --headerline" "mongoimport --quiet --uri mongodb://{}:{}@{}:{}/{}?authSource=admin --file {} -c {} --drop --type csv --headerline"
).format( ).format(
connectionInfo["username"], connectionInfo["username"],
connectionInfo["password"], connectionInfo["password"],
connectionInfo["host"], connectionInfo["host"],
connectionInfo["port"], connectionInfo["port"],
connectionInfo["db"], connectionInfo["db"],
connectionInfo["workload"] + "/" + file, connectionInfo["workload"] + "/" + file,
fileName, fileName,
) )
os.system(cmd) os.system(cmd)
i += 1 i += 1
except pd.errors.EmptyDataError: except pd.errors.EmptyDataError: