nvalchemi.distributed.current_dd_context#

nvalchemi.distributed.current_dd_context()[source]#

Return the live DD context for the current forward.

Inside a DomainParallel / DistributedModel forward this is the framework’s per-step context (policy, halo metadata, counts). Outside one — single-process code, or before the first forward — it is the inert NOT_DISTRIBUTED sentinel.

Read it in eager code (or under @torch._dynamo.disable) only. Inside a compiled region the varying fields would bake as stale constants; code there receives what it needs as threaded graph inputs instead.

Return type:

DistributedContext