Skip to content

Conversation

@MichaelIspas
Copy link

Summary

Replaces fixed number of cmake --build -j entries with:

mac: -j$(($(sysctl -n hw.ncpu) - 1))
linux: -j$(($(nproc) - 1))

Changes

Implemented changes to the best of my ability to .sh, .md, and .yml, could you kindly review if any changes were unnecessary or not relevant? I am a CS student learning how to work with FLOSS communities so I am happy to make any adjustments if needed, thank you.

mac: $(sysctl -n hw.ncpu) - 1
linux: $(nproc) - 1
@pytorch-bot
Copy link

pytorch-bot bot commented Jun 4, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11351

Note: Links to docs will display an error until the docs builds have been completed.

❌ 29 New Failures, 45 Cancelled Jobs

As of commit a5b15d3 with merge base b5a6362 (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot
Copy link
Contributor

Hi @MichaelIspas!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@github-actions
Copy link

github-actions bot commented Jun 4, 2025

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 4, 2025
Copy link
Contributor

@larryliu0820 larryliu0820 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for your contribution! Please get rid of the additional file.

@@ -0,0 +1,110 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove this file?

./config --prefix=/opt/openssl -d "-Wl,--enable-new-dtags,-rpath,$(LIBRPATH)"
# NOTE: openssl install errors out when built with the -j option
make -j6; make install_sw
make -j$((nproc) - 1); make install_sw
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 think this is valid syntax is it? You need an additional parentheses

Suggested change
make -j$((nproc) - 1); make install_sw
make -j$(($(nproc) - 1)); make install_sw

-DQNN_SDK_ROOT="$QNN_SDK_ROOT" \
-Bcmake-out .
cmake --build cmake-out -j9 --target install --config "$CMAKE_BUILD_TYPE"
cmake --build cmake-out -j$(($(nproc) - 1)) --target install --config "$CMAKE_BUILD_TYPE"
Copy link
Contributor

@jathu jathu Jun 4, 2025

Choose a reason for hiding this comment

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

This script is also used to test locally on macOS, so we cannot just use nproc.

Overall what I would suggest is abstracting out this logic into a common script, and perhaps sharing the logic. For example, create ./tools/common_build.sh

core_count() {
  if [[ "$(uname)" == "Darwin" ]]; then
    num_cores=$(sysctl -n hw.ncpu)
  else
    num_cores=$(nproc)
  fi
  echo $((num_cores - 1))
}

@jathu
Copy link
Contributor

jathu commented Jun 4, 2025

Thanks for the contribution @MichaelIspas! I have some feedback, mainly that most of these scripts are used on macOS and Linux (and also Windows in bash), so we need to support both systems

@zingo zingo added ciflow/trunk module: arm Issues related to arm backend labels Jun 4, 2025
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions bot added the stale PRs inactive for over 60 days label Sep 2, 2025
@nil-is-all nil-is-all removed the stale PRs inactive for over 60 days label Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants