Update error message to be more accurate when roofline binary is

missing (but with a supported OS and rocm version).  In response to
debugging #34 a second time.

Signed-off-by: Karl W. Schulz <karl.schulz@amd.com>
Этот коммит содержится в:
Karl W. Schulz
2022-11-23 15:41:18 -06:00
родитель 2a93da7cf5
Коммит 4f5998397d
+36 -15
Просмотреть файл
@@ -71,6 +71,7 @@ def resolve_rocprof():
print("ROC Profiler: ", rocprof_path.stdout.decode("utf-8"))
def get_soc():
mspec = specs.get_machine_specs(0)
@@ -177,8 +178,6 @@ def gen_sysinfo(workload_name, workload_dir, ip_blocks, app_cmd, skip_roof):
if not skip_roof:
blocks.append("roofline")
# ip block info
if ip_blocks == None:
t = ["SQ", "LDS", "SQC", "TA", "TD", "TCP", "TCC", "SPI", "CPC", "CPF"]
@@ -199,10 +198,12 @@ def mongo_import(args, profileAndImport):
csv_converter.convert_folder(connectionInfo, Extractionlvl)
print("-- Complete! --")
################################################
# Roofline Helpers
################################################
def detect_roofline():
mspec = specs.get_machine_specs(0)
rocm_ver = mspec.rocmversion[:1]
@@ -216,7 +217,7 @@ def detect_roofline():
rooflineBinary = os.environ["ROOFLINE_BIN"]
if os.path.exists(rooflineBinary):
print("Detected user-supplied binary")
return {"rocm_ver":"override", "distro":"override", "path":rooflineBinary}
return {"rocm_ver": "override", "distro": "override", "path": rooflineBinary}
else:
print("ROOFLINE ERROR: user-supplied path to binary not accessible")
print("--> ROOFLINE_BIN = %s\n" % target_binary)
@@ -234,23 +235,31 @@ def detect_roofline():
print("ROOFLINE ERROR: Cannot find a valid binary for your operating system")
sys.exit(1)
target_binary = { "rocm_ver":rocm_ver, "distro":distro }
target_binary = {"rocm_ver": rocm_ver, "distro": distro}
return target_binary
def mibench(args):
print("No roofline data found. Generating...")
target_binary = detect_roofline()
if target_binary["rocm_ver"] == "override":
path_to_binary = target_binary["path"]
else:
path_to_binary = str(OMNIPERF_HOME) + "/utils/rooflines/roofline" + "-" + DISTRO_MAP[target_binary["distro"]] + "-" + args.target.lower() + "-rocm" + target_binary["rocm_ver"]
path_to_binary = (
str(OMNIPERF_HOME)
+ "/utils/rooflines/roofline"
+ "-"
+ DISTRO_MAP[target_binary["distro"]]
+ "-"
+ args.target.lower()
+ "-rocm"
+ target_binary["rocm_ver"]
)
# Distro is valid but cant find rocm ver
if not os.path.exists(path_to_binary):
print(
"ROOFLINE ERROR: ROCm version not supported."
)
print("ROOFLINE ERROR: Unable to locate expected binary (%s)." % path_to_binary)
sys.exit(1)
subprocess.run(
@@ -280,6 +289,7 @@ def characterize_app(path, cmd, verbose):
print(fname)
run_prof(fname, workload_dir, perfmon_dir, app_cmd, verbose)
################################################
# Profiling Helpers
################################################
@@ -310,7 +320,7 @@ def run_prof(fname, workload_dir, perfmon_dir, cmd, verbose):
)
def omniperf_profile(args,VER):
def omniperf_profile(args, VER):
# Verify valid target
if args.target not in SOC_LIST:
parse.print_help(sys.stderr)
@@ -390,11 +400,21 @@ def omniperf_profile(args,VER):
if target_binary["rocm_ver"] == "override":
path_to_binary = target_binary["path"]
else:
path_to_binary = str(OMNIPERF_HOME) + "/utils/rooflines/roofline" + "-" + DISTRO_MAP[target_binary["distro"]] + "-" + args.target.lower() + "-rocm" + target_binary["rocm_ver"]
# Distro is valid but cant find rocm ver
path_to_binary = (
str(OMNIPERF_HOME)
+ "/utils/rooflines/roofline"
+ "-"
+ DISTRO_MAP[target_binary["distro"]]
+ "-"
+ args.target.lower()
+ "-rocm"
+ target_binary["rocm_ver"]
)
# Distro is valid but cant find valid binary
if not os.path.exists(path_to_binary):
print(
"ROOFLINE ERROR: ROCm version not supported."
"ROOFLINE ERROR: Unable to locate expected binary (%s))."
% path_to_binary
)
sys.exit(1)
@@ -408,6 +428,7 @@ def omniperf_profile(args,VER):
]
)
################################################
# MAIN
################################################
@@ -426,7 +447,7 @@ def main():
args = my_parser.parse_args()
vData = getVersion()
VER = vData['version']
VER = vData["version"]
if args.mode == None:
throw_parse_error(
@@ -526,7 +547,7 @@ def main():
# Profile only
else:
print("\n-------------\nProfile only\n-------------\n")
omniperf_profile(args,VER)
omniperf_profile(args, VER)
##############
# DATABASE MODE