diff --git a/tb_plugins/profiling/tb_plugin/fe/src/components/charts/NewLineChart.tsx b/tb_plugins/profiling/tb_plugin/fe/src/components/charts/NewLineChart.tsx index 526efe0bb0855daf13974ada37929ff022bba2d9..a9579027227e6a779eccc47266ab362569dc7766 100644 --- a/tb_plugins/profiling/tb_plugin/fe/src/components/charts/NewLineChart.tsx +++ b/tb_plugins/profiling/tb_plugin/fe/src/components/charts/NewLineChart.tsx @@ -128,35 +128,29 @@ export const LineChart: React.FC = (props) => { ) } } else if (graph.columns.length === 5) { - const datasetTitle1: Array = [] - const datasetTitle2: Array = [] - graph.columns.forEach((column, index) => { - if (index === 0 || index < 3) { - datasetTitle1.push(column.name) - } - if (index === 0 || index >= 3) { - datasetTitle2.push(column.name) - } + const datasetTitle = graph.columns.map(item => item.name) + const mergedGERows = graph.rows['GE'].map((item: Array) => { + return [item[0], null, null, item[1], item[2]] + }) + const finalRows = graph.rows['PTA'].concat(mergedGERows).sort((a: any, b: any) => { + return a[0] - b[0] }) option = { ...option, - dataset: [ - { - source: [ - datasetTitle1, - ...graph.rows['PTA'] - ] - }, - { - source: [ - datasetTitle2, - ...graph.rows['GE'] - ] - } - ], - series: Array(2).fill( + dataset: + { + source: [ + datasetTitle, + ...finalRows + ] + }, + tooltip: { + show: false + }, + series: Array(4).fill( { type: 'line', + connectNulls: true, select: { itemStyle: { borderWidth: 5, @@ -171,24 +165,7 @@ export const LineChart: React.FC = (props) => { }, selectedMode: 'single', datasetIndex: 0 - }).concat(Array(2).fill( - { - type: 'line', - select: { - itemStyle: { - borderWidth: 5, - shadowBlur: 5 - } - }, - emphasis: { - itemStyle: { - borderWidth: 5, - shadowBlur: 5 - } - }, - selectedMode: 'single', - datasetIndex: 1 - })) + }) } } } else { diff --git a/tb_plugins/profiling/tb_plugin/torch_tb_profiler/profiler/data.py b/tb_plugins/profiling/tb_plugin/torch_tb_profiler/profiler/data.py index 442578c16ccd6fbf9a29f92132eba1d0088fbecf..f699f43b0fe0c72ad0cd859502efc979b04110e3 100644 --- a/tb_plugins/profiling/tb_plugin/torch_tb_profiler/profiler/data.py +++ b/tb_plugins/profiling/tb_plugin/torch_tb_profiler/profiler/data.py @@ -201,12 +201,13 @@ class RunProfileData(object): for i in reversed(range(len(event_list))): if event_list[i].get('ts') is not None: start_ts = min(start_ts, event_list[i]['ts']) - if event_list[i]['name'] == 'Record Window End': - end_index = i - elif event_list[i]['name'].startswith('Iteration Start:'): - start_index = i - if start_index is not None and end_index is not None: - break + if device_target != 'Ascend': + if event_list[i]['name'] == 'Record Window End': + end_index = i + elif event_list[i]['name'].startswith('Iteration Start:'): + start_index = i + if start_index is not None and end_index is not None: + break if start_index is not None and end_index is not None: dur = event_list[end_index]['ts'] - event_list[start_index]['ts']