Repository navigation
Don't log an error when there are no CUDA backend symbols to promote - #23895
Open
edmundshieh wants to merge 2 commits into
Open
edmundshieh wants to merge 2 commits into
edmundshieh wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23895
Note: Links to docs will display an error until the docs builds have been completed.
|
|
|
Author
|
@pytorchbot label "release notes: backends" |
Gasoonjia
approved these changes
Oct 16, 2026
load_library re-opens the library that holds the backend with RTLD_NOLOAD | RTLD_GLOBAL to make its symbols global. When the backend is linked into the executable, as in a statically linked runner, dlopen finds no library and sets no error, so every first load logged "Failed to promote symbols: (null)". The executable's symbols are already global then. Log an error only when dlopen reports one, and log the case where it finds no library at Info level.
edmundshieh
force-pushed
the
cuda-quiet-symbol-promotion
branch
from
October 16, 2026 22:38
74cfbd1 to
b5207cf
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
load_libraryre-opens the library that holds the CUDA backend withRTLD_NOLOAD | RTLD_GLOBALto make its symbols global. When the backend is linked into the executable, as in a statically linked runner,dladdrnames the executable, anddlopenfinds no library to re-open and sets no error. So every first load logged "Failed to promote symbols: (null)", although the executable's symbols are already global and there is nothing to promote. The error is now logged only whendlopenreports one;dlerror()is cleared before the call so a stale error is not reported.This PR was authored with AI (Claude Code).
Test plan
backends/cuda/runtime/platform/platform.cppcompiles (g++ -std=c++17 -fsyntax-only -Wall -Wextra). Thedlopenbehavior the change relies on, checked with a small program that callsdlopen(<its own path>, RTLD_NOW | RTLD_GLOBAL | RTLD_NOLOAD)on glibc 2.39 (Jetson AGX Thor, Ubuntu 24.04):cc @cccclai @nil-is-all @Gasoonjia @digantdesai