未验证 提交 e368bb7b 编写于 作者: C chenjian 提交者: GitHub

robust distributed data fetch (#1224)

上级 22e859e8
...@@ -1804,6 +1804,8 @@ class DistributedProfilerData: ...@@ -1804,6 +1804,8 @@ class DistributedProfilerData:
device_infos = profile_data.device_infos device_infos = profile_data.device_infos
if not device_infos: if not device_infos:
return data return data
if not profile_data.has_gpu:
continue
gpu_id = int(next(iter(profile_data.gpu_ids))) gpu_id = int(next(iter(profile_data.gpu_ids)))
data.append({ data.append({
'worker_name': 'worker_name':
...@@ -1835,6 +1837,8 @@ class DistributedProfilerData: ...@@ -1835,6 +1837,8 @@ class DistributedProfilerData:
data['data'] = [] data['data'] = []
new_data = defaultdict(list) new_data = defaultdict(list)
for profile_data in self.profile_datas: for profile_data in self.profile_datas:
if not profile_data.distributed_parser:
continue
data['worker_name'].append(profile_data.worker_name) data['worker_name'].append(profile_data.worker_name)
if step != 'All': if step != 'All':
new_data['ProfileStep'].append( new_data['ProfileStep'].append(
...@@ -1867,6 +1871,8 @@ class DistributedProfilerData: ...@@ -1867,6 +1871,8 @@ class DistributedProfilerData:
def get_distributed_steps(self): def get_distributed_steps(self):
for profile_data in self.profile_datas: for profile_data in self.profile_datas:
if not profile_data.distributed_parser:
continue
steps = list(profile_data.distributed_time.keys()) steps = list(profile_data.distributed_time.keys())
final_steps = ['All'] + sorted( final_steps = ['All'] + sorted(
[int(step) for step in steps if step != 'All']) [int(step) for step in steps if step != 'All'])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册