Lightning-AI/lightning-thunder
View on GitHubHow do I access the `ThunderModule` if I'm compiling a function?
Open
#121 opened on Apr 2, 2024
enhancementhelp wanted
Repository metrics
- Stars
- (1,460 stars)
- PR merge metrics
- (PR metrics pending)
Description
🚀 Feature
Motivation
Sometimes the code requires that a ThunderModule is passed, however, if the user is compiling a function that takes the module as an argument, the user doesn't have a way to get a reference to it.
For example, #96 implements a workaround for this issue with the no_sync context manager.
Pitch
Provide an API to get this reference. Maybe it's something like thunder.compile_data(jitted_function).module.
Additional context
The design might need to consider the presence of multiple ThunderModules.