Lightning-AI/lightning-thunder

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

Open

#121 创建于 2024年4月2日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Python (114 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (1,460 star)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南