set_split_strategy_by_idx
产品支持情况
| 产品 | 是否支持 | 
|---|---|
| √ | |
| √ | |
| x | |
| x | |
| √ | |
| √ | 
 
 针对
功能说明
基于梯度的索引id,在集合通信group内设置反向梯度切分策略,实现allreduce的融合,用于进行集合通信的性能调优。
函数原型
| 1 | def set_split_strategy_by_idx(idxList, group="hccl_world_group") | 
参数说明
| 参数名 | 输入/输出 | 描述 | 
|---|---|---|
| idxList | 输入 | list类型。 梯度的索引id列表。 
 | 
| group | 输入 | String类型。 group名称,可以为"hccl_world_group"或自定义group,默认为"hccl_world_group"。 | 
返回值
无。
约束说明
调用示例
以下仅为代码片段,不可执行,调用HCCL Python接口进行集合通信操作的完整示例可参见样例代码。
| 1 2 | from hccl.split.api import * set_split_strategy_by_idx([20, 100, 159], "group") | 
父主题: hccl.split.api