Skip to content

Run unittests in debug mode at pull time and release mode on trunk builds #8550

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

Merged
merged 8 commits into from
Feb 20, 2025

Conversation

swolchok
Copy link
Contributor

@swolchok swolchok commented Feb 18, 2025

Per discussion in discord with @mergennachin. Motivation was to have debug coverage to catch debug-only test failures.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@swolchok
Copy link
Contributor Author

swolchok commented Feb 18, 2025

Copy link

pytorch-bot bot commented Feb 18, 2025

🔗 Helpful Links

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

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

❌ 3 New Failures

As of commit 5dca304 with merge base e2f8624 (image):

NEW FAILURES - The following jobs have failed:

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

@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 Feb 18, 2025
swolchok added a commit that referenced this pull request Feb 18, 2025
…ilds

Per discussion in discord with mergennachin.

ghstack-source-id: ab718c7
ghstack-comment-id: 2667086154
Pull Request resolved: #8550
[ghstack-poisoned]
swolchok added a commit that referenced this pull request Feb 18, 2025
…ilds

Per discussion in discord with mergennachin.

ghstack-source-id: 1b2decd
ghstack-comment-id: 2667086154
Pull Request resolved: #8550
[ghstack-poisoned]
swolchok added a commit that referenced this pull request Feb 18, 2025
…ilds

Per discussion in discord with mergennachin.

ghstack-source-id: 604ae2a
ghstack-comment-id: 2667086154
Pull Request resolved: #8550
@swolchok
Copy link
Contributor Author

linux unittest jobs are green and mac test is broken on trunk, think this is ready to go

Copy link
Contributor

@mergennachin mergennachin left a comment

Choose a reason for hiding this comment

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

Shouldn't we also plumb all the way to
.ci/scripts/unittest-linux-cmake.sh and
https://github.com/pytorch/executorch/blob/main/test/run_oss_cpp_tests.sh?

@@ -124,7 +124,7 @@ build_executorch_runner() {
if [[ $1 == "buck2" ]]; then
build_executorch_runner_buck2
Copy link
Contributor

Choose a reason for hiding this comment

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

for buck we are ignoring and using whatever's default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. I think that whether the code works with optimized/debug build flags is orthogonal to the choice of build system. (The ExecuTorch .buckconfig is configured to produce debug builds by default.)

@swolchok
Copy link
Contributor Author

Shouldn't we also plumb all the way to
.ci/scripts/unittest-linux-cmake.sh and
https://github.com/pytorch/executorch/blob/main/test/run_oss_cpp_tests.sh?

As you can see in the linux release build logs and the linux debug build logs, CMAKE_BUILD_TYPE is correctly set as-is. CMake caches settings, and 1) unittest-linux-cmake.sh does not itself invoke cmake 2) the cmake invocation in run_oss_cpp_tests.sh doesn't set CMAKE_BUILD_TYPE explicitly.

Base automatically changed from gh/swolchok/265/head to main February 19, 2025 17:31
@mergennachin
Copy link
Contributor

Rebase and resolve the conflict

Comment on lines 42 to 45
.ci/scripts/unittest-linux-cmake.sh
elif [[ "$BUILD_TOOL" == "buck2" ]]; then
.ci/scripts/unittest-buck2.sh
else
Copy link
Contributor

Choose a reason for hiding this comment

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

In unittest-macos.sh we are doing this, but why not here?

can we make it consistent/symmetric?

if [[ "$BUILD_TOOL" == "cmake" ]]; then
    .ci/scripts/unittest-macos-cmake.sh "$BUILD_MODE"
elif [[ "$BUILD_TOOL" == "buck2" ]]; then
    .ci/scripts/unittest-buck2.sh "$BUILD_MODE"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch. fix is to remove it in unittest-macos.sh

Comment on lines 43 to 47
if [[ "$BUILD_TOOL" == "cmake" ]]; then
.ci/scripts/unittest-macos-cmake.sh "$BUILD_MODE"
elif [[ "$BUILD_TOOL" == "buck2" ]]; then
.ci/scripts/unittest-buck2.sh "$BUILD_MODE"
else
Copy link
Contributor

Choose a reason for hiding this comment

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

.

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Feb 20, 2025
…ilds

Per discussion in discord with mergennachin.

ghstack-source-id: fc4d769
ghstack-comment-id: 2667086154
Pull Request resolved: #8550
@swolchok
Copy link
Contributor Author

double-checking CMAKE_BUILD_TYPE in the unittest cmake jobs on this diff: all 3 mac jobs are good, all 3 linux jobs are good. found unittest-arm while looking; should talk about whether we need to give that one the same treatment. merging.

@swolchok swolchok merged commit 254eeca into main Feb 20, 2025
141 of 146 checks passed
@swolchok swolchok deleted the gh/swolchok/268/head branch February 20, 2025 20:59
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. topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants