Fix kernel filtering when using rocprofv3 (#615)

When using rocprof v3:
* Use --kernel-include-regex for kernel name filtering
* Use --kernel-iteration-range for kernel dispatch filtering

Update changelog

[ROCm/rocprofiler-compute commit: 45b8937d5d]
Этот коммит содержится в:
vedithal-amd
2025-03-18 11:26:45 -04:00
коммит произвёл GitHub
родитель f775c7cdbd
Коммит ec4359658b
2 изменённых файлов: 23 добавлений и 1 удалений
+5
Просмотреть файл
@@ -21,6 +21,11 @@ Full documentation for ROCm Compute Profiler is available at [https://rocm.docs.
### Resolved issues
* Fixed option specs-correction
* Fixed kernel name and kernel dispatch filtering when using rocprof v3
### Known issues
* gpu id filtering is not supported when using rocprof v3
## (Unreleased) ROCm Compute Profiler 3.1.0 for ROCm 6.4.0
+18 -1
Просмотреть файл
@@ -71,8 +71,25 @@ class rocprof_v3_profiler(RocProfCompute_Base):
trace_option,
"--output-format",
rocprof_out_format,
"--",
]
# Kernel filtering
if self.get_args().kernel:
args.extend(["--kernel-include-regex", "|".join(self.get_args().kernel)])
# Dispatch filtering
dispatch = []
# rocprofv3 dispatch indexing is inclusive and starts from 1
if self.get_args().dispatch:
for dispatch_id in self.get_args().dispatch:
if ":" in dispatch_id:
tokens = dispatch_id.split(":")
# 4:7 -> 5-7
dispatch.append(f"{int(tokens[0]) + 1}-{tokens[1]}")
else:
# 4 -> 5
dispatch.append(f"{int(dispatch_id) + 1}")
if dispatch:
args.extend(["--kernel-iteration-range", f"[{','.join(dispatch)}]"])
args.append("--")
args.extend(app_cmd)
return args