-
Notifications
You must be signed in to change notification settings - Fork 801
[CI][benchmarks] Modify benchmark scripts and CI workflow to enable gdb_mode #20891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| import csv | ||
| import io | ||
| import math | ||
| import os | ||
| from enum import Enum | ||
| from itertools import product | ||
| from pathlib import Path | ||
|
|
@@ -76,6 +77,7 @@ def setup(self) -> None: | |
| "compute-benchmarks", | ||
| use_installdir=False, | ||
| ) | ||
| print(self._project) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these some debug prints? Why logger is not used? |
||
|
|
||
| if not self._project.needs_rebuild(): | ||
| log.info(f"Rebuilding {self._project.name} skipped") | ||
|
|
@@ -89,6 +91,13 @@ def setup(self) -> None: | |
| f"-DCMAKE_CXX_COMPILER=clang++", | ||
| f"-DCMAKE_C_COMPILER=clang", | ||
| ] | ||
|
|
||
| is_gdb_mode = os.environ.get("LLVM_BENCHMARKS_USE_GDB", "") == "true" | ||
| if is_gdb_mode: | ||
| extra_args += [ | ||
| f"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG -fdebug-info-for-profiling", | ||
| ] | ||
|
|
||
| if options.ur_adapter == "cuda": | ||
| extra_args += [ | ||
| "-DBUILD_SYCL_WITH_CUDA=ON", | ||
|
|
@@ -567,6 +576,12 @@ def __enabled_runtimes(self) -> list[RUNTIMES]: | |
| return runtimes | ||
|
|
||
| def __parse_output(self, output: str) -> list[tuple[float, float]]: | ||
| is_gdb_mode = os.environ.get("LLVM_BENCHMARKS_USE_GDB", "") == "true" | ||
| print(output) | ||
|
|
||
| if is_gdb_mode: | ||
| return [(0.0, 0.0)] | ||
|
|
||
| csv_file = io.StringIO(output) | ||
| reader = csv.reader(csv_file) | ||
| next(reader, None) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,25 @@ def run( | |
| if isinstance(command, str): | ||
| command = command.split() | ||
|
|
||
| is_gdb_mode = os.environ.get("LLVM_BENCHMARKS_USE_GDB", "") == "true" | ||
| if command[0] == "taskset" and is_gdb_mode: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why If needed, perhaps add some wrapper function that modifies benchmarks command (or passes it through down here).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I understand this check is to distinguish if we run a benchmark or some other command. I think we can (instead of looking for taskset) just check if a binary from |
||
| gdb_cmd = [ | ||
| "gdb", | ||
| "-return-child-result", | ||
| "--batch", | ||
| "--ex", | ||
| "set confirm off", | ||
| "--ex", | ||
| "run", | ||
| "--ex", | ||
| "bt", | ||
| "--ex", | ||
| "quit", | ||
| "--args", | ||
| ] + command | ||
| command = gdb_cmd | ||
| print(f"Running in gdb mode: {command}") | ||
|
|
||
| env = os.environ.copy() | ||
| for ldlib in ld_library: | ||
| if os.path.isdir(ldlib): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when is
LLVM_BENCHMARKS_USE_GDBset?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must have deleted it accidentally. Now it is added