Skip to content

Conversation

@luszczewskakasia1
Copy link
Contributor

Modify benchmark scripts and CI workflow to enable gdb_mode on workflow_dispatch while deugging benchmarks.

@luszczewskakasia1 luszczewskakasia1 force-pushed the luszczewskakasia1_add-gdb branch from 56320bf to 9de028f Compare December 15, 2025 09:12
@luszczewskakasia1 luszczewskakasia1 force-pushed the luszczewskakasia1_add-gdb branch from 9de028f to 42f6390 Compare December 15, 2025 09:18
@luszczewskakasia1 luszczewskakasia1 force-pushed the luszczewskakasia1_add-gdb branch from 42f6390 to e179b9f Compare December 15, 2025 09:20
@luszczewskakasia1 luszczewskakasia1 force-pushed the luszczewskakasia1_add-gdb branch from e179b9f to 1cae956 Compare December 15, 2025 10:08
@luszczewskakasia1 luszczewskakasia1 force-pushed the luszczewskakasia1_add-gdb branch from 1cae956 to a4c9fed Compare December 15, 2025 11:32
@luszczewskakasia1 luszczewskakasia1 force-pushed the luszczewskakasia1_add-gdb branch from a4c9fed to c2805eb Compare December 15, 2025 11:59
@luszczewskakasia1 luszczewskakasia1 marked this pull request as ready for review December 15, 2025 12:58
@luszczewskakasia1 luszczewskakasia1 requested review from a team as code owners December 15, 2025 12:58
default: ''
gdb_mode:
type: string
required: False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add default = false

Extra options to be added to LIT_OPTS.
type: string
default: ''
gdb_mode:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls move below and add to the name prefix benchmark_

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

echo "::endgroup::"
echo "::group::run_benchmarks"
export LLVM_BENCHMARKS_USE_GDB=${LLVM_BENCHMARKS_USE_GDB}
Copy link
Contributor

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_GDB set?

Copy link
Contributor Author

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

if is_gdb_benchmarks:
return [(0.0, 0.0)]

else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for else, since you returned on the if (this way we don't need extra tab for the rest of the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

f"-DUSE_SYSTEM_LEVEL_ZERO=OFF",
f"-DCMAKE_CXX_COMPILER=clang++",
f"-DCMAKE_C_COMPILER=clang",
f"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG -fdebug-info-for-profiling",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we should only add these when GDB is enabled...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

command = command.split()

is_gdb_benchmarks = os.environ.get("LLVM_BENCHMARKS_USE_GDB", "") == "true"
if command[0] == "taskset" and is_gdb_benchmarks:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we check if taskset is the first part of the command?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it so gdb is used only for commands which are responsible for running benchmarks as it looks like that 'taskset', '-c', '0,1,2,3', '/tmp/tmp7nhle4ge/compute-benchmarks-build/bin/torch_benchmark_l0', '--test=KernelSubmitMultiQueue', '--csv', '--noHeaders', '--iterations=3', '--workgroupCount=4096', '--workgroupSize=512', '--kernelsPerQueue=20'
I don't think we need gdb for any other command which are executed in out benchmarks as this extends time of execution of the script.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it be not the first one? e.g. in command like PATH=<...> taskset <...>? just asking, dunno.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In base.py the method taskset_cmd says, that the benchmark command starts with taskset and then it is used in run_bench method

f"-DCMAKE_CXX_COMPILER=clang++",
f"-DCMAKE_C_COMPILER=clang",
f"-DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG -fdebug-info-for-profiling",
f"-DCMAKE_BUILD_TYPE=RelWithDebInfo",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modify the GitProject class, there is a default Release version set for all projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@luszczewskakasia1
Copy link
Contributor Author

@luszczewskakasia1 luszczewskakasia1 force-pushed the luszczewskakasia1_add-gdb branch 2 times, most recently from 1897a8b to 317c411 Compare December 17, 2025 21:45
@PatKamin
Copy link
Contributor

https://github.com/intel/llvm/actions/runs/20301652593/job/58309783774 - results with gdb enabled

Please, fix the safe-path error. It looks like gdb refuses to run test binaries.

command = command.split()

is_gdb_mode = os.environ.get("LLVM_BENCHMARKS_USE_GDB", "") == "true"
if command[0] == "taskset" and is_gdb_mode:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why taskset is crucial here? We shouldn't rely on taskset being used in benchmark commands (if this is the case), this could be changed in future.

If needed, perhaps add some wrapper function that modifies benchmarks command (or passes it through down here).

Copy link
Contributor

Choose a reason for hiding this comment

The 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 .../compute-benchmarks-build/bin/ is run.

"compute-benchmarks",
use_installdir=False,
)
print(self._project)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these some debug prints? Why logger is not used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants