Skip to content

Don't log an error when there are no CUDA backend symbols to promote - #23895

Open
edmundshieh wants to merge 2 commits into
pytorch:mainfrom
edmundshieh:cuda-quiet-symbol-promotion
Open

edmundshieh wants to merge 2 commits into
pytorch:mainfrom
edmundshieh:cuda-quiet-symbol-promotion

Conversation

@edmundshieh

@edmundshieh edmundshieh commented Oct 15, 2026 •

Copy link
Copy Markdown

Summary

load_library re-opens the library that holds the CUDA 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, dladdr names the executable, and dlopen finds 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 when dlopen reports 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.cpp compiles (g++ -std=c++17 -fsyntax-only -Wall -Wextra). The dlopen behavior the change relies on, checked with a small program that calls dlopen(<its own path>, RTLD_NOW | RTLD_GLOBAL | RTLD_NOLOAD) on glibc 2.39 (Jetson AGX Thor, Ubuntu 24.04):

dli_fname=./noload handle=(nil) dlerror=(null)

cc @cccclai @nil-is-all @Gasoonjia @digantdesai

@pytorch-bot

pytorch-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🔗 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.

⚠️ 21 Awaiting Approval

As of commit a3a0e0e with merge base 20fa24e (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

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

Copilot AI balanced review requested due to automatic review settings October 15, 2026 15:16
@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: edmundshieh / name: edmundshieh (74cfbd1)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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 Oct 15, 2026
@edmundshieh

Copy link
Copy Markdown
Author

@pytorchbot label "release notes: backends"

@executorch-triage executorch-triage Bot added the community: contribution PRs coming from community (excluding hardware partners) label Oct 15, 2026
@nil-is-all nil-is-all added module: backend Issues related to backend APIs or requests for new backends module: cuda Issues related to the AOTI CUDA backend and removed module: backend Issues related to backend APIs or requests for new backends labels Oct 16, 2026
Comment thread backends/cuda/runtime/platform/platform.cpp Outdated
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.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 22:38
@edmundshieh
edmundshieh force-pushed the cuda-quiet-symbol-promotion branch from 74cfbd1 to b5207cf Compare October 16, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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. community: contribution PRs coming from community (excluding hardware partners) module: cuda Issues related to the AOTI CUDA backend release notes: backends

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants