Skip to content

Support collecting perf profiles remotely #275

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lukel97
Copy link
Contributor

@lukel97 lukel97 commented Aug 13, 2025

If we're running tests on a remote machine with -DTEST_SUITE_REMOTE_HOST and generate a perf profile with lit --param profile=perf, currently the profile step will be run on the local machine and fail.

This patch fixes this by running the profile step on the remote, as well as copying the generated profiles back to the host so tools like LNT can inspect them.

There's two parts to this, first we need to run the remote module after the perf (and hpmcount) module so that we can wrap the profile step with ssh etc.

Secondly, we need to scp over the generated .perf_data files like we also do for the profilegen.py module. However today this is also done as part of the profile step which we now need to start running over ssh. So to fix this, this adds a new "profile collect" step that runs after the profile step, but always runs on the local machine.

I've tested this out on a remote build configured with -DTEST_SUITE_REMOTE_HOST=... -DTEST_SUITE_USE_PERF=ON -DTEST_SUITE_PROFILE_GENERATE=ON -DTEST_SUITE_USE_IR_PGO=ON and running the tests with lit --param profile=perf, and it seems to work.

If we're running tests on a remote machine with -DTEST_SUITE_REMOTE_HOST and generate a perf profile with `lit --param profile=perf`, currently the profile step will be run on the local machine and fail.

This patch fixes this by running the profile step on the remote, as well as copying the generated profiles back to the host so tools like LNT can inspect them.

There's two parts to this, first we need to run the remote module after the perf (and hpmcount) module so that we can wrap the profile step with ssh etc.

Secondly, we need to scp over the generated .perf_data files like we also do for the profilegen.py module. However today this is also done as part of the profile step which we now need to start running over ssh. So to fix this, this adds a new "profile collect" step that runs after the profile step, but always runs on the local machine.

I've tested this out on a remote build configured with `-DTEST_SUITE_REMOTE_HOST=... -DTEST_SUITE_USE_PERF=ON -DTEST_SUITE_PROFILE_GENERATE=ON -DTEST_SUITE_USE_IR_PGO=ON` and running the tests with `lit --param profile=perf`, and it seems to work.
Fixes a "AttributeError: 'TestContext' object has no attribute 'profilefile'" when running tests without --param profile=perf
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.

1 participant