SetAlgConfig

Function

Sets the communication algorithm.

Prototype

1
uint32_t SetAlgConfig(const std::string &algConfig)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

algConfig

Input

Communication algorithm configuration. The value is of the string type and can contain a maximum of 128 bytes.

For the Atlas A3 training products / Atlas A3 inference products , the following values are supported:

  • "AllReduce=level0:doublering": AllReduce communication task.
  • "AllGather=level0:doublering": AllGather communication task.
  • "ReduceScatter=level0:doublering": ReduceScatter communication task.
  • "AlltoAll=level0:fullmesh;level1:pairwise": AlltoAllV and AlltoAllcommunication tasks.
  • "BatchWrite=level0:fullmesh": BatchWrite communication task.

For the Atlas A2 training products / Atlas A2 inference products , this parameter is reserved and does not take effect after being configured. By default, only the FullMesh algorithm is supported. Full-mesh algorithm. Full-mesh connections are established between NPUs, that is, data can be directly transmitted between any two NPUs. For details about the algorithm of "Collective Communication Algorithm Introduction" in .

Returns

  • 0: Setting succeeded.
  • Other values: Setting failed.

Restrictions

None

Example

For details about the calling example of this API, see Example.