Repository navigation
Don't log an error when there are no CUDA backend symbols to promote - #23895
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.
|
|
|
|
@pytorchbot label "release notes: backends" |
74cfbd1 to
b5207cf
Compare
|
@edmundshieh could you update the branch and ping when ready for review? |
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.
a3a0e0e to
a83f0e1
Compare
|
@nil-is-all Rebased onto the latest main, ready for review. The CI workflows are waiting for maintainer approval to run. |
|
@nil-is-all Sorry I updated the branch after the CI run was approved, which reset the workflow approval. Could you approve the runs again? On the previous commit (a83f0e1) everything passed except the same two jobs that also fail on main (Test WebGPU Backend and unittest-cuda-muse-glimmer-batching). |
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