SetStepSize

Function

Sets the step of the communication algorithm during fine-grained communication, that is, the number of steps of the communication algorithm executed or to be executed by a sub-communication task at a time. For example, in Figure 1 AlltoAllV communication steps using the pairwise algorithm, the communication step of the AlltoAllV communication task is 1 in the fine-grained communication scenario.

Prototype

1
uint32_t SetStepSize(uint8_t stepSize)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

stepSize

Input

Sets the step of the each communication during fine-grained communication. The value 0 indicates non-fine-grained communication.

Returns

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

Restrictions

The Atlas A2 training products/Atlas A2 inference products does not support this API.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
static ge::graphStatus AllToAllVCustomTilingFunc(gert::TilingContext *context)
{
    AllToAllVCustomV3TilingData *tiling = context->GetTilingData<AllToAllVCustomV3TilingData>();
    const std::string groupName = "testGroup";
    const std::string algConfig = "AlltoAll=level0:fullmesh;level1:pairwise";
    AscendC::Mc2CcTilingConfig mc2CcTilingConfig(groupName, HCCL_CMD_ALLTOALLV, algConfig, 0);
    mc2CcTilingConfig.SetStepSize(1U);
    mc2CcTilingConfig.GetTiling(tiling->mc2InitTiling);
    mc2CcTilingConfig.GetTiling(tiling->mc2CcTiling);
    return ge::GRAPH_SUCCESS;
}