TCC per channel metric's fix for rocprofv3 (#597)

[ROCm/rocprofiler-compute commit: 46e15dc840]
Dieser Commit ist enthalten in:
ywang103-amd verfasst und GitHub committed 2025-03-20 20:09:27 -04:00
1 Ursprung 77ffa73e5b
Commit b812f54a9b
3 Dateien geändert
+167 -41

Keine Dateien entsprechen Ihrer Suche

+22 -7
Datei anzeigen
@@ -47,6 +47,23 @@ rocprof_cmd = ""
rocprof_args = ""
# TODO: This is a HACK
def using_v3():
return "ROCPROF" in os.environ.keys() and "rocprofv3" in os.environ["ROCPROF"]
# TODO: This is a HACK
def get_default_accumulate_counter_file_ymal():
"""Return the path of the default derivative counters' definatin's yaml file that we current use to store accumulated counters' defination. It will possibly be removed later on"""
return str(
config.rocprof_compute_home.joinpath(
"rocprof_compute_soc",
"profile_configs",
"accum_counters.yaml",
)
)
def demarcate(function):
def wrap_function(*args, **kwargs):
logging.trace("----- [entering function] -> %s()" % (function.__qualname__))
@@ -570,9 +587,12 @@ def run_prof(
console_debug("pmc file: %s" % path(fname).name)
path_counter_config_yaml = path(fname).with_suffix(".yaml")
# standard rocprof options
default_options = ["-i", fname]
options = default_options + profiler_options
if path_counter_config_yaml.exists():
options = ["-E", str(path_counter_config_yaml)] + options
# set required env var for mi300
new_env = None
@@ -581,12 +601,6 @@ def run_prof(
or mspec.gpu_model.lower() == "mi300x_a1"
or mspec.gpu_model.lower() == "mi300a_a0"
or mspec.gpu_model.lower() == "mi300a_a1"
) and (
path(fname).name == "pmc_perf_13.txt"
or path(fname).name == "pmc_perf_14.txt"
or path(fname).name == "pmc_perf_15.txt"
or path(fname).name == "pmc_perf_16.txt"
or path(fname).name == "pmc_perf_17.txt"
):
new_env = os.environ.copy()
new_env["ROCPROFILER_INDIVIDUAL_XCC_MODE"] = "1"
@@ -596,6 +610,7 @@ def run_prof(
is_timestamps = True
time_1 = time.time()
console_debug("rocprof command: {}".format([rocprof_cmd] + options))
# profile the app
if new_env:
success, output = capture_subprocess_output(
@@ -668,7 +683,7 @@ def run_prof(
workload_dir + "/out/pmc_1/results_" + fbase + ".csv", index=False
)
if new_env:
if new_env and not using_v3():
# flatten tcc for applicable mi300 input
f = path(workload_dir + "/out/pmc_1/results_" + fbase + ".csv")
xcds = total_xcds(mspec.gpu_model, mspec.compute_partition)