(self, data_length)
| 29 | """ |
| 30 | |
| 31 | def __init__(self, data_length): |
| 32 | super(PPLMetric, self).__init__() |
| 33 | self.clear() |
| 34 | self.data_length = data_length |
| 35 | pipeline_stages = context.get_auto_parallel_context("pipeline_stages") |
| 36 | per_stage_device_num = get_group_size() // pipeline_stages |
| 37 | stage_id = get_rank() // per_stage_device_num |
| 38 | self.is_last_stage = (stage_id == pipeline_stages - 1) |
| 39 | |
| 40 | def clear(self): |
| 41 | """Clear the internal evaluation result.""" |