Skip to content
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

benchmark: conditionally use spawn with taskset for CPU pinning #52253

Merged

Conversation

thisalihassan
Copy link
Contributor

@thisalihassan thisalihassan commented Mar 28, 2024

This PR updates our process spawning mechanism from fork to spawn to incorporate the taskset command, enabling CPU pinning for benchmark tasks. This change aims to improve benchmark consistency and reliability on systems with heterogeneous CPU cores.

closes #52233

@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. performance Issues and PRs related to the performance of Node.js. labels Mar 28, 2024
benchmark/compare.js Outdated Show resolved Hide resolved
@thisalihassan thisalihassan changed the title taskset support for benchmarks benchmark: conditionally use spawn with taskset for CPU pinning Mar 28, 2024
benchmark/compare.js Outdated Show resolved Hide resolved
benchmark/compare.js Outdated Show resolved Hide resolved
benchmark/run.js Outdated Show resolved Hide resolved
benchmark/run.js Outdated Show resolved Hide resolved
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina
Copy link
Member

Can you please amend the first commit so it passes our linting rules? You can use npx core-validate-commit.

This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.

Fixes: nodejs#52233
@thisalihassan
Copy link
Contributor Author

Can you please amend the first commit so it passes our linting rules? You can use npx core-validate-commit.

image

thanks, it's passing all now except

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2024
@mcollina
Copy link
Member

mcollina commented Apr 1, 2024

I've run the benchmarking script myself and verified that it does not switch CPU.

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 1, 2024
@nodejs-github-bot
Copy link
Collaborator

@thisalihassan
Copy link
Contributor Author

is it normal that CI takes more than 14hours?

@nodejs-github-bot
Copy link
Collaborator

@mcollina
Copy link
Member

mcollina commented Apr 4, 2024

No, let's see if I was able to kick it back up.

Copy link
Member

@mertcanaltin mertcanaltin left a comment

Choose a reason for hiding this comment

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

lgtm

@nodejs-github-bot
Copy link
Collaborator

@thisalihassan
Copy link
Contributor Author

Build from tarball / test-tarball-linux (pull_request) is stuck again, it's been running for 3d, can someone let me know if something needs to be fixed in the PR?

benchmark/_cli.js Show resolved Hide resolved
@rluvaton rluvaton added commit-queue Add this label to land a pull request using GitHub Actions. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 6, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Apr 6, 2024
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/52253
✔  Done loading data for nodejs/node/pull/52253
----------------------------------- PR info ------------------------------------
Title      benchmark: conditionally use spawn with taskset for CPU pinning (#52253)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     thisalihassan:taskset_support_benchmark -> nodejs:main
Labels     benchmark, performance, author ready
Commits    6
 - benchmark: conditionally use spawn with taskset for cpu pinning
 - benchmark: run lint
 - benchmark: refactor code for benchmark cpu settings
 - benchmark: prefer node import syntax for built-in child_process
 - docs: update benchmarks md to explain CPUSET variable
 - benchmark: fix stdio on stderr for child process
Committers 1
 - Ali Hassan 
PR-URL: https://github.com/nodejs/node/pull/52253
Reviewed-By: Matteo Collina 
Reviewed-By: Raz Luvaton 
Reviewed-By: Yagiz Nizipli 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/52253
Reviewed-By: Matteo Collina 
Reviewed-By: Raz Luvaton 
Reviewed-By: Yagiz Nizipli 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 28 Mar 2024 15:21:09 GMT
   ✔  Approvals: 3
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/52253#pullrequestreview-1970850302
   ✔  - Raz Luvaton (@rluvaton): https://github.com/nodejs/node/pull/52253#pullrequestreview-1984706306
   ✔  - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/52253#pullrequestreview-1981518776
   ✔  Last GitHub CI successful
   ℹ  Green GitHub CI is sufficient
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 52253
From https://github.com/nodejs/node
 * branch                  refs/pull/52253/merge -> FETCH_HEAD
✔  Fetched commits as ba07e4e5e643..5f700f58ec81
--------------------------------------------------------------------------------
[main 3c831d10f9] benchmark: conditionally use spawn with taskset for cpu pinning
 Author: Ali Hassan 
 Date: Thu Mar 28 20:18:15 2024 +0500
 2 files changed, 50 insertions(+), 9 deletions(-)
[main a1a9ea842b] benchmark: run lint
 Author: Ali Hassan 
 Date: Fri Mar 29 02:21:59 2024 +0500
 2 files changed, 4 insertions(+), 4 deletions(-)
[main 511f2a7dc2] benchmark: refactor code for benchmark cpu settings
 Author: Ali Hassan 
 Date: Sat Mar 30 04:53:37 2024 +0500
 3 files changed, 38 insertions(+), 15 deletions(-)
[main b9577be4c0] benchmark: prefer node import syntax for built-in child_process
 Author: Ali Hassan 
 Date: Sat Mar 30 15:10:36 2024 +0500
 2 files changed, 2 insertions(+), 2 deletions(-)
[main 137610d821] docs: update benchmarks md to explain CPUSET variable
 Author: Ali Hassan 
 Date: Fri Apr 5 12:44:29 2024 +0500
 1 file changed, 36 insertions(+)
[main d44dadece0] benchmark: fix stdio on stderr for child process
 Author: Ali Hassan 
 Date: Sat Apr 6 04:09:09 2024 +0500
 2 files changed, 6 insertions(+), 8 deletions(-)
   ✔  Patches applied
There are 6 commits in the PR. Attempting autorebase.
Rebasing (2/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: conditionally use spawn with taskset for cpu pinning

This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.

Fixes: #52233
PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 7362ac3807] benchmark: conditionally use spawn with taskset for cpu pinning
Author: Ali Hassan ali-hassan27@outlook.com
Date: Thu Mar 28 20:18:15 2024 +0500
2 files changed, 50 insertions(+), 9 deletions(-)
Rebasing (3/12)
Rebasing (4/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: run lint

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 1282101554] benchmark: run lint
Author: Ali Hassan ali-hassan27@outlook.com
Date: Fri Mar 29 02:21:59 2024 +0500
2 files changed, 4 insertions(+), 4 deletions(-)
Rebasing (5/12)
Rebasing (6/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: refactor code for benchmark cpu settings

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 23a8358636] benchmark: refactor code for benchmark cpu settings
Author: Ali Hassan ali-hassan27@outlook.com
Date: Sat Mar 30 04:53:37 2024 +0500
3 files changed, 38 insertions(+), 15 deletions(-)
Rebasing (7/12)
Rebasing (8/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: prefer node import syntax for built-in child_process

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 052a8c9d28] benchmark: prefer node import syntax for built-in child_process
Author: Ali Hassan ali-hassan27@outlook.com
Date: Sat Mar 30 15:10:36 2024 +0500
2 files changed, 2 insertions(+), 2 deletions(-)
Rebasing (9/12)
Rebasing (10/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
docs: update benchmarks md to explain CPUSET variable

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD a2eb5d2273] docs: update benchmarks md to explain CPUSET variable
Author: Ali Hassan ali-hassan27@outlook.com
Date: Fri Apr 5 12:44:29 2024 +0500
1 file changed, 36 insertions(+)
Rebasing (11/12)
Rebasing (12/12)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
benchmark: fix stdio on stderr for child process

PR-URL: #52253
Reviewed-By: Matteo Collina matteo.collina@gmail.com
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Yagiz Nizipli yagiz.nizipli@sentry.io

[detached HEAD 92e603f9cb] benchmark: fix stdio on stderr for child process
Author: Ali Hassan ali-hassan27@outlook.com
Date: Sat Apr 6 04:09:09 2024 +0500
2 files changed, 6 insertions(+), 8 deletions(-)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/8584238305

@rluvaton rluvaton added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 6, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 6, 2024
@nodejs-github-bot nodejs-github-bot merged commit 47c934e into nodejs:main Apr 6, 2024
33 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 47c934e

marco-ippolito pushed a commit that referenced this pull request May 2, 2024
This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.

Fixes: #52233
PR-URL: #52253
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
marco-ippolito pushed a commit that referenced this pull request May 3, 2024
This change enhances the benchmarking tool by conditionally using the,
spawn method with taskset for CPU pinning, improving consistency of
benchmark results across different environments.

Fixes: #52233
PR-URL: #52253
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. benchmark Issues and PRs related to the benchmark subsystem. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. performance Issues and PRs related to the performance of Node.js.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support starting benchmark tasks using taskset on Linux
6 participants