Synchronizes all ranks in a communication domain. xRef is used only to build tensor dependencies. No operation is performed on xRef in the API.
Compared with the [object Object] API, this API has the following changes:
- Dynamic scale-in support: The operator can run normally without recompilation after faulty ranks are removed after the communication domain is created. Enable this feature by passing the
[object Object]parameter. - Timeout detection support:
- Enable this feature by passing a
[object Object]parameter greater than 0 microseconds, with a maximum supported value of INT32_MAX. When the internal synchronization wait time of the operator exceeds the given[object Object], a timeout exception occurs on the rank that runs the operator.
- Enable this feature by passing a
Each operator has calls. First, [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] is called to perform computation.
Parameters
[object Object]- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: For these products,
[object Object]and[object Object]only takes null pointers.
- [object Object]Atlas A2 training products/Atlas A2 inference products[object Object]: For these products,
Returns
aclnnStatus status code. For details, see .
The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
Deterministic computing:
[object Object]defaults to a deterministic implementation.
Constraints on the use of the communication domain:
[object Object]in a model requires an independent communication domain, and no other operators are allowed in the communication domain.
Application scenarios:
- Calling this operator in a network model that requires all-rank synchronization can mask performance fluctuations caused by fast and slow ranks, assisting in performance analysis.
- This operator can be called continuously. When building a graph, the input of the previous operator and the output of the next operator should be passed as input parameters to the API.
- The dynamic scale-in feature cannot be enabled in the tensor parallelism scenario.
Parameter consistency constraint:
- When
[object Object]is enabled, ensure that[object Object]and[object Object]or[object Object]also enable this parameter, and their values remain consistent with the corresponding[object Object]parameter.
- When
Prepare files.
Create a
[object Object]directory. Follow the instructions to create[object Object]and[object Object]files in the[object Object]directory and modify them according to the code.Install the CANN package and compile and run barrierDemo.
Compilation script:
[object Object]Compilation and execution:
[object Object]The example code is as follows:
[object Object]