Skip to content

Conversation

@yujiaoliang
Copy link
Contributor

@yujiaoliang yujiaoliang commented Jan 14, 2026

Summary

Do not strip in RelWithDebInfo builds for llama main.

Fixes #16572

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 14, 2026

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 7f300c5 with merge base a9d8230 (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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

@meta-cla meta-cla 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 Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the symbol stripping behavior in the llama_main executable build configuration. Previously, symbols were stripped for all non-Debug builds, which incorrectly included RelWithDebInfo. The fix ensures symbols are only stripped for Release and MinSizeRel builds, preserving debug information in RelWithDebInfo builds.

Changes:

  • Modified the conditional check for symbol stripping from a negative check (NOT Debug) to a positive check (Release OR MinSizeRel)
  • Added a clarifying comment explaining the stripping behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")

# Only strip symbols for Release and MinSizeRel builds.
if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The same symbol stripping issue exists in other model CMakeLists files (gemma3, llava, whisper, parakeet, voxtral) which still use if(NOT CMAKE_BUILD_TYPE STREQUAL \"Debug\"). For consistency and to prevent the same RelWithDebInfo stripping issue across the codebase, consider applying this fix to those files as well.

Copilot uses AI. Check for mistakes.
Copy link
Member

@GregoryComer GregoryComer left a comment

Choose a reason for hiding this comment

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

Thanks! Can you resolve the lint issue? I can go ahead and merge once that's updated. Instructions for installing and running the linter are here: https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#lintrunner. Alternatively, you can just run cmake-format -i examples/models/llama/CMakeLists.txt, if that's easier.

@yujiaoliang yujiaoliang force-pushed the FixCmakeListForLlamaMain branch from c3b0025 to 7f300c5 Compare January 15, 2026 14:32
@yujiaoliang
Copy link
Contributor Author

Thanks! Can you resolve the lint issue? I can go ahead and merge once that's updated. Instructions for installing and running the linter are here: https://github.com/pytorch/executorch/blob/main/CONTRIBUTING.md#lintrunner. Alternatively, you can just run cmake-format -i examples/models/llama/CMakeLists.txt, if that's easier.

Done. I’ve run cmake-format and pushed an updated commit.
Thanks!

@yujiaoliang
Copy link
Contributor Author

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot bot added the release notes: none Do not include this in the release notes label Jan 15, 2026
@GregoryComer
Copy link
Member

Looks good. I'll go ahead and merge. Thanks for the contribution!

@GregoryComer GregoryComer merged commit beab00e into pytorch:main Jan 15, 2026
144 of 145 checks passed
@yujiaoliang yujiaoliang deleted the FixCmakeListForLlamaMain branch January 16, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Llama_main strips symbols in RelWithDebInfo mode

2 participants