core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order#

Ordered sequence with indexed item lookup.

Module Contents#

Classes#

IndexedOrder

Insertion order with weakly held items and successor lookup.

Data#

T

API#

core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T#

‘TypeVar(…)’

class core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.IndexedOrder#

Bases: typing.Generic[core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T]

Insertion order with weakly held items and successor lookup.

Initialization

Create an empty indexed order.

append(
item: core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T,
) None#

Append item to the order.

Parameters:

item – Item to append.

Raises:

ValueError – If item is already present in the order.

__iter__() collections.abc.Iterator[core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T]#

Iterate over live items in order.

next_item(
item: core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T,
) core.distributed.fsdp.src.megatron_fsdp.experimental.indexed_order.T | None#

Return the live item that follows item, if any.