Browse Source

UI device memory profiling bugfix

1.The memory value is incorrectly calculated when the unit is KiB
2.Tensor namne and size can be sorted in table data
3.The memory displayed in the overview bar is optimized
tags/v1.2.0-rc1
xiayifan 4 years ago
parent
commit
77bf61bf63
3 changed files with 10 additions and 11 deletions
  1. +1
    -0
      mindinsight/ui/src/locales/en-us.json
  2. +1
    -0
      mindinsight/ui/src/locales/zh-cn.json
  3. +8
    -11
      mindinsight/ui/src/views/profiling/memory-detail.vue

+ 1
- 0
mindinsight/ui/src/locales/en-us.json View File

@@ -489,6 +489,7 @@
"memoryGiBUnit": "GiB", "memoryGiBUnit": "GiB",
"memoryMiBUnit": "MiB", "memoryMiBUnit": "MiB",
"memoryKiBUnit": "KiB", "memoryKiBUnit": "KiB",
"memoryByteUnit": "B",
"usedMemory": "Memory Usage", "usedMemory": "Memory Usage",
"operatorMemoryAssign": "Operator Memory Allocation", "operatorMemoryAssign": "Operator Memory Allocation",
"tensorName": "Tensor Name", "tensorName": "Tensor Name",


+ 1
- 0
mindinsight/ui/src/locales/zh-cn.json View File

@@ -488,6 +488,7 @@
"memoryGiBUnit": "GiB", "memoryGiBUnit": "GiB",
"memoryMiBUnit": "MiB", "memoryMiBUnit": "MiB",
"memoryKiBUnit": "KiB", "memoryKiBUnit": "KiB",
"memoryByteUnit": "B",
"usedMemory": "内存使用", "usedMemory": "内存使用",
"operatorMemoryAssign": "算子内存分配", "operatorMemoryAssign": "算子内存分配",
"tensorName": "张量名称", "tensorName": "张量名称",


+ 8
- 11
mindinsight/ui/src/views/profiling/memory-detail.vue View File

@@ -105,7 +105,7 @@ limitations under the License.
height="100%" height="100%"
tooltip-effect="light" tooltip-effect="light"
:empty-text="breakdownsInitOver ? $t('public.noData') : $t('public.dataLoading')"> :empty-text="breakdownsInitOver ? $t('public.noData') : $t('public.dataLoading')">
<el-table-column prop="name">
<el-table-column prop="name" sortable>
<template slot="header"> <template slot="header">
<span :title="$t('profiling.memory.tensorName')"> <span :title="$t('profiling.memory.tensorName')">
{{$t('profiling.memory.tensorName')}} {{$t('profiling.memory.tensorName')}}
@@ -115,7 +115,7 @@ limitations under the License.
<div class="cell">{{scope.row.name}}</div> <div class="cell">{{scope.row.name}}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="size">
<el-table-column prop="size" sortable>
<template slot="header"> <template slot="header">
<span :title="$t('profiling.memory.totalTensorMemoryAssign')"> <span :title="$t('profiling.memory.totalTensorMemoryAssign')">
{{$t('profiling.memory.totalTensorMemoryAssign')}} {{$t('profiling.memory.totalTensorMemoryAssign')}}
@@ -214,6 +214,7 @@ export default {
this.$t('profiling.memory.memoryGiBUnit'), this.$t('profiling.memory.memoryGiBUnit'),
this.$t('profiling.memory.memoryMiBUnit'), this.$t('profiling.memory.memoryMiBUnit'),
this.$t('profiling.memory.memoryKiBUnit'), this.$t('profiling.memory.memoryKiBUnit'),
this.$t('profiling.memory.memoryByteUnit'),
], ],
chartClickListenerOn: false, // Listening on discount click events chartClickListenerOn: false, // Listening on discount click events
curSelectedPointIndex: 0, // Subscript of the current selection point curSelectedPointIndex: 0, // Subscript of the current selection point
@@ -685,9 +686,10 @@ export default {
if (number === baseStr) { if (number === baseStr) {
return baseStr; return baseStr;
} }
const loopCount = this.unitList.length;
const loopCount = this.unitList.length - 1;
const fixedLimit = 2;
let baseNumber = number; let baseNumber = number;
let utilIndex = -1;
let utilIndex = loopCount;
let resultStr = ''; let resultStr = '';
for (let i = 0; i < loopCount; i++) { for (let i = 0; i < loopCount; i++) {
if (baseNumber >= 1) { if (baseNumber >= 1) {
@@ -697,17 +699,12 @@ export default {
baseNumber = baseNumber * this.unitBase; baseNumber = baseNumber * this.unitBase;
} }
} }
if (utilIndex < 0) {
utilIndex = loopCount - 1;
}
if (type === 1) { if (type === 1) {
resultStr = `${this.formmateNummber(baseNumber)}`;
resultStr = `${Number(baseNumber.toFixed(fixedLimit))}`;
} else if (type === 2) { } else if (type === 2) {
resultStr = `${this.unitList[utilIndex]}`; resultStr = `${this.unitList[utilIndex]}`;
} else { } else {
resultStr = `${this.formmateNummber(baseNumber)} ${
this.unitList[utilIndex]
}`;
resultStr = `${Number(baseNumber.toFixed(fixedLimit))} ${this.unitList[utilIndex]}`;
} }
return resultStr; return resultStr;
}, },


Loading…
Cancel
Save