-
Notifications
You must be signed in to change notification settings - Fork 749
[aoti-et] Store symbols from dlopen into AOTIDelegateHandle #15172
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
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15172
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 6 PendingAs of commit 17f213f with merge base 2c706f1 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Gasoonjia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for making the container functions nice, safe and clean!
| using AOTInductorModelContainerGetInputNameFunc = AOTIRuntimeError (*)( | ||
| AOTInductorModelContainerHandle container_handle, | ||
| size_t input_idx, | ||
| const char** input_name); | ||
|
|
||
| // Retrieves the number of constants from the AOTI model container. | ||
| // Needed by Metal backend |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@manuelcandales see if Metal should also save this inside the handle
This pull request refactors how function pointers for AOTI model container operations are managed and loaded in the CUDA backend. Instead of relying on global/static function pointers, function pointers are now stored per-instance in the
AOTIDelegateHandlestructure. This change enables safe handling of multiple shared libraries within the same process and improves encapsulation and maintainability.Refactoring function pointer management:
aoti_model_container.cppandaoti_model_container.h, and moved them into theAOTIDelegateHandlestruct as per-instance members. [1] [2] [3]CUDA backend updates:
cuda_backend.cpp) to load function pointers into eachAOTIDelegateHandleinstance using a newload_function_pointers_into_handlemethod, replacing the previous global symbol registration logic. All calls to model container functions now use the handle's member function pointers. [1] [2] [3] [4] [5]Build system adjustments:
aoti_model_container.cppfrom the build targets and library sources, as global function pointer definitions are no longer needed. [1] [2]