You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.nn.DistributedGradReducer.rst 905 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920
  1. mindspore.nn.DistributedGradReducer
  2. ===================================
  3. .. py:class:: mindspore.nn.DistributedGradReducer(parameters, mean=True, degree=None, fusion_type=1, group=GlobalComm.WORLD_COMM_GROUP)
  4. 分布式优化器。
  5. 用于数据并行模式中,对所有卡的梯度利用AllReduce进行聚合。
  6. **参数:**
  7. - **parameters** (list) - 需要更新的参数。
  8. - **mean** (bool) - 当mean为True时,对AllReduce之后的梯度求均值。默认值:False。
  9. - **degree** (int) - 平均系数,通常等于设备编号。默认值:None。
  10. - **fusion_type** (int) - AllReduce算子的融合类型。默认值:1。
  11. - **group** (str) - AllReduce算子的通信域,若需要自定义通信域,需要调用create_group接口。默认值:GlobalComm.WORLD_COMM_GROUP。
  12. **异常:**
  13. **ValueError**:如果degree不是int或小于0。