Lightning-AI/lightning-thunder

How do I access the `ThunderModule` if I'm compiling a function?

Open

#121 geöffnet am 2. Apr. 2024

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Python (114 Forks)github user discovery
enhancementhelp wanted

Repository-Metriken

Stars
 (1.460 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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

Contributor Guide