Merge branch 'dev' into lucky
Signed-off-by: coleramos425 <colramos@amd.com>
This commit is contained in:
@@ -224,27 +224,27 @@ def convert_folder(connectionInfo, Extractionlvl):
|
||||
df_saved_file = t2.to_csv(newfilepath + file)
|
||||
|
||||
cmd = (
|
||||
'mongoimport --quiet --uri mongodb://{}:{}@{}:{} --authenticationDatabase "admin" --file {} -d {} -c {} --drop --type csv --headerline'
|
||||
"mongoimport --quiet --uri mongodb://{}:{}@{}:{}/{}?authSource=admin --file {} -c {} --drop --type csv --headerline"
|
||||
).format(
|
||||
connectionInfo["username"],
|
||||
connectionInfo["password"],
|
||||
connectionInfo["host"],
|
||||
connectionInfo["port"],
|
||||
newfilepath + file,
|
||||
connectionInfo["db"],
|
||||
newfilepath + file,
|
||||
fileName,
|
||||
)
|
||||
os.system(cmd)
|
||||
else:
|
||||
cmd = (
|
||||
'mongoimport --quiet --uri mongodb://{}:{}@{}:{} --authenticationDatabase "admin" --file {} -d {} -c {} --drop --type csv --headerline'
|
||||
"mongoimport --quiet --uri mongodb://{}:{}@{}:{}/{}?authSource=admin --file {} -c {} --drop --type csv --headerline"
|
||||
).format(
|
||||
connectionInfo["username"],
|
||||
connectionInfo["password"],
|
||||
connectionInfo["host"],
|
||||
connectionInfo["port"],
|
||||
connectionInfo["workload"] + "/" + file,
|
||||
connectionInfo["db"],
|
||||
connectionInfo["workload"] + "/" + file,
|
||||
fileName,
|
||||
)
|
||||
os.system(cmd)
|
||||
|
||||
+24
-15
@@ -21,16 +21,22 @@
|
||||
################################################################################
|
||||
|
||||
from linecache import cache
|
||||
import subprocess
|
||||
from operator import sub
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import numpy
|
||||
import matplotlib
|
||||
matplotlib.use('Agg')
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
try:
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
except ImportError:
|
||||
# other non-interactive options:
|
||||
# cairo, pdf, pgf, ps, svg, template
|
||||
matplotlib.use("agg", force=True)
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from matplotlib.pyplot import get, text
|
||||
from math import log, pi, sqrt
|
||||
import pandas as pd
|
||||
@@ -296,7 +302,7 @@ def plot_application(inputs, verbose):
|
||||
avgDuration / calls,
|
||||
)
|
||||
)
|
||||
if verbose:
|
||||
if verbose >= 2:
|
||||
print(
|
||||
"Just added {} to AI_Data at index {}. # of calls: {}".format(
|
||||
kernelName, index, calls
|
||||
@@ -356,7 +362,7 @@ def plot_application(inputs, verbose):
|
||||
+ (row["SQ_INSTS_VALU_MFMA_MOPS_F64"] * 512)
|
||||
)
|
||||
except KeyError:
|
||||
if verbose:
|
||||
if verbose >= 2:
|
||||
print("Skipped total_flops at index {}".format(index))
|
||||
pass
|
||||
try:
|
||||
@@ -384,7 +390,7 @@ def plot_application(inputs, verbose):
|
||||
)
|
||||
)
|
||||
except KeyError:
|
||||
if verbose:
|
||||
if verbose >= 2:
|
||||
print("Skipped valu_flops at index {}".format(index))
|
||||
pass
|
||||
|
||||
@@ -395,7 +401,7 @@ def plot_application(inputs, verbose):
|
||||
mfma_flops_f64 += row["SQ_INSTS_VALU_MFMA_MOPS_F64"] * 512
|
||||
mfma_iops_i8 += row["SQ_INSTS_VALU_MFMA_MOPS_I8"] * 512
|
||||
except KeyError:
|
||||
if verbose:
|
||||
if verbose >= 2:
|
||||
print("Skipped mfma ops at index {}".format(index))
|
||||
pass
|
||||
|
||||
@@ -404,14 +410,14 @@ def plot_application(inputs, verbose):
|
||||
(row["SQ_LDS_IDX_ACTIVE"] - row["SQ_LDS_BANK_CONFLICT"]) * 4 * L2_BANKS
|
||||
) # L2_BANKS = 32 (since assuming mi200)
|
||||
except KeyError:
|
||||
if verbose:
|
||||
if verbose >= 2:
|
||||
print("Skipped lds_data at index {}".format(index))
|
||||
pass
|
||||
|
||||
try:
|
||||
L1cache_data += row["TCP_TOTAL_CACHE_ACCESSES_sum"] * 64
|
||||
except KeyError:
|
||||
if verbose:
|
||||
if verbose >= 2:
|
||||
print("Skipped L1cache_data at index {}".format(index))
|
||||
pass
|
||||
|
||||
@@ -423,7 +429,7 @@ def plot_application(inputs, verbose):
|
||||
+ row["TCP_TCC_READ_REQ_sum"] * 64
|
||||
)
|
||||
except KeyError:
|
||||
if verbose:
|
||||
if verbose >= 2:
|
||||
print("Skipped L2cache_data at index {}".format(index))
|
||||
pass
|
||||
try:
|
||||
@@ -434,7 +440,7 @@ def plot_application(inputs, verbose):
|
||||
+ ((row["TCC_EA_WRREQ_sum"] - row["TCC_EA_WRREQ_64B_sum"]) * 32)
|
||||
)
|
||||
except KeyError:
|
||||
if verbose:
|
||||
if verbose >= 2:
|
||||
print("Skipped hbm_data at index {}".format(index))
|
||||
pass
|
||||
|
||||
@@ -513,8 +519,6 @@ def plot_application(inputs, verbose):
|
||||
|
||||
print(intensities)
|
||||
|
||||
# fig, ax = plt.subplots()
|
||||
|
||||
plotted_spots = []
|
||||
labels = []
|
||||
for i in intensities:
|
||||
@@ -652,7 +656,12 @@ def empirical_roof(args):
|
||||
dtype = plot_roof(inputs, roof_data) # Also returns chosen dtype
|
||||
plot_application(inputs, args.verbose)
|
||||
|
||||
filename = IMGNAME + "_gpu-" + str(inputs["device"]) + "_{}".format(dtype) + ".pdf"
|
||||
if inputs["device"] == -1:
|
||||
dev_id = "ALL"
|
||||
else:
|
||||
dev_id = str(inputs["device"])
|
||||
|
||||
filename = IMGNAME + "_gpu-" + dev_id + "_{}".format(dtype) + ".pdf"
|
||||
|
||||
full_path = os.path.abspath(inputs["path"])
|
||||
path_to_output = full_path + "/" + filename
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import socket
|
||||
import subprocess
|
||||
|
||||
@@ -174,12 +175,34 @@ def get_machine_specs(devicenum):
|
||||
"version-libs",
|
||||
"version-utils",
|
||||
]
|
||||
|
||||
rocmFound = False
|
||||
for itr in version_loc:
|
||||
_path = os.path.join(os.getenv("ROCM_PATH", "/opt/rocm"), ".info", itr)
|
||||
if os.path.exists(_path):
|
||||
rocm_ver = path(_path).read_text()
|
||||
rocmFound = True
|
||||
break
|
||||
|
||||
if not rocmFound:
|
||||
# check if ROCM_VER is supplied externally
|
||||
ROCM_VER_USER = os.getenv("ROCM_VER")
|
||||
if ROCM_VER_USER is not None:
|
||||
print(
|
||||
"Overriding missing ROCm version detection with ROCM_VER = %s"
|
||||
% ROCM_VER_USER
|
||||
)
|
||||
rocm_ver = ROCM_VER_USER
|
||||
else:
|
||||
_rocm_path = os.getenv("ROCM_PATH", "/opt/rocm")
|
||||
print("Error: Unable to detect a complete local ROCm installation.")
|
||||
print(
|
||||
"\nThe expected %s/.info/ versioning directory is missing. Please"
|
||||
% _rocm_path
|
||||
)
|
||||
print("ensure you have valid ROCm installation.")
|
||||
sys.exit(1)
|
||||
|
||||
(
|
||||
gpu_id,
|
||||
L1,
|
||||
|
||||
Reference in New Issue
Block a user