thunder.dynamo.ThunderFXCompiledObject

class thunder.dynamo.ThunderFXCompiledObject(backend, func)[source]

Bases: object

A wrapper around the result of thunderfx() compilation.

This object wraps the function compiled with torch.compile() using Thunder as a backend (see ThunderCompiler). It provides access to Thunder traces generated during execution, while maintaining the callable interface of the original compiled function.

Note: This is the return type of thunderfx, not thunder.jit().

Parameters:
__init__(backend, func)[source]
Parameters:

Methods

__init__(backend, func)

Attributes

last_backward_traces

Get the Thunder traces for all the backward subgraphs of a ThunderFX callable.

last_traces

Get the Thunder traces for all the forward subgraphs of a ThunderFX callable.

__call__(*args, **kwargs)[source]

Call self as a function.

property last_backward_traces: list[thunder.core.trace.TraceCtx][source]

Get the Thunder traces for all the backward subgraphs of a ThunderFX callable.

Note

The object must have been invoked before calling this function.

property last_traces: list[thunder.core.trace.TraceCtx][source]

Get the Thunder traces for all the forward subgraphs of a ThunderFX callable.

Note

The object must have been invoked before calling this function.