-
Couldn't load subscription status.
- Fork 25.7k
Closed
Labels
enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixoncall: pt2
Description
In some cases, it is useful to know if a particular frame is running under a specific context. For example, we would like to know _run_ddp_forward is ancestor of the current frame we are analyzing. This enables us to skip/specialize on this additional information during Dynamo bytecode processing.
Conceptually, it could look something like this
Before Dynamo
def fn():
.....
.....
After Dynamo
def wrapper(fn):
def inner(*args, **kwargs):
torchdyanmo.global_ctx.add("ddp_on")
out = torchdynamo.optimize(my_compiler)(fn)(*args, **kwargs)
torchdyanmo.global_ctx.remove("ddp_on")
return out
return inner
Metadata
Metadata
Assignees
Labels
enhancementNot as big of a feature, but technically not a bug. Should be easy to fixNot as big of a feature, but technically not a bug. Should be easy to fixoncall: pt2