core.distributed.fsdp.src.megatron_fsdp.experimental.execution_order#
Weak, phase-tagged execution sequences with a sequential cursor.
Module Contents#
Classes#
A module and its compute phase. |
|
Store an execution trace with one sequential cursor across all phases. |
API#
- class core.distributed.fsdp.src.megatron_fsdp.experimental.execution_order.ExecutionEvent#
Bases:
typing.NamedTupleA module and its compute phase.
- module: torch.nn.Module#
None
- class core.distributed.fsdp.src.megatron_fsdp.experimental.execution_order.ExecutionOrder(
- items: collections.abc.Iterable[core.distributed.fsdp.src.megatron_fsdp.experimental.execution_order.ExecutionEvent] = (),
Store an execution trace with one sequential cursor across all phases.
Initialization
Create a weak sequence, preserving every repeated occurrence.
- property position: int#
Index of the next event to consume.
- append( ) None#
Append an event without consuming it.
- __iter__() collections.abc.Iterator[core.distributed.fsdp.src.megatron_fsdp.experimental.execution_order.ExecutionEvent]#
Iterate over live occurrences without retaining their modules.
- peek(
- offset: int = 0,
Read an event relative to the cursor without wrapping or advancing.
- successors() collections.abc.Iterator[core.distributed.fsdp.src.megatron_fsdp.experimental.execution_order.ExecutionEvent]#
Look ahead from the current occurrence without wrapping or advancing.
- advance() None#
Consume one occurrence and automatically wrap at the end of the trace.