Collective Key

Utility functions for AllReduceSynchronizer.

get_collective_keys()[source]

Return a singleton instance of CollectiveKey.

class CollectiveKey(group_key_start=1)[source]

Bases: object

A hash that generates group key and instance key for AllReduce.

get_group_key(canonical_devices)[source]

Generate or retrieve the group key based on a list of strings of the participating devices.

get_instance_key(var_op_name)[source]

Generate or retrieve the instance key based on the original variable op name.