"...composable_kernel.git" did not exist on "ae1b4ee6187b42230c830274308920cb697a9fba"
Unverified Commit 08edcfbb authored by Lijiaoa's avatar Lijiaoa Committed by GitHub
Browse files

[v1.8 bug-bash] fix webui error (#2808)



* fix bug bash error

* review by self

* also Trial stdout NFS name issue
Co-authored-by: default avatarLijiao <Lijiaoa@outlook.com>
parent 7be60532
...@@ -85,8 +85,10 @@ class Compare extends React.Component<CompareProps, {}> { ...@@ -85,8 +85,10 @@ class Compare extends React.Component<CompareProps, {}> {
containLabel: true containLabel: true
}, },
legend: { legend: {
// more than 10 trials will hide legend type: 'scroll',
data: idsList.length > 10 ? null : idsList right: 40,
left: idsList.length > 6 ? 80 : null,
data: idsList
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
...@@ -135,8 +137,17 @@ class Compare extends React.Component<CompareProps, {}> { ...@@ -135,8 +137,17 @@ class Compare extends React.Component<CompareProps, {}> {
isComplexSearchSpace = (typeof parameterList[0][parameterKeys[0]] === 'object') isComplexSearchSpace = (typeof parameterList[0][parameterKeys[0]] === 'object')
? true : false; ? true : false;
} }
const width = this.getWebUIWidth();
let scrollClass;
if (width > 1200) {
scrollClass = idList.length > 3 ? 'flex' : '';
} else if (width < 700) {
scrollClass = idList.length > 1 ? 'flex' : '';
} else {
scrollClass = idList.length > 2 ? 'flex' : '';
}
return ( return (
<table className="compare-modal-table"> <table className={`compare-modal-table ${scrollClass}`}>
<tbody> <tbody>
<tr> <tr>
<td className="column">Id</td> <td className="column">Id</td>
...@@ -200,6 +211,10 @@ class Compare extends React.Component<CompareProps, {}> { ...@@ -200,6 +211,10 @@ class Compare extends React.Component<CompareProps, {}> {
); );
} }
getWebUIWidth = (): number => {
return window.innerWidth;
}
componentDidMount(): void { componentDidMount(): void {
this._isCompareMount = true; this._isCompareMount = true;
} }
......
import * as React from 'react'; import * as React from 'react';
import { DOWNLOAD_IP } from '../../static/const'; import { DOWNLOAD_IP } from '../../static/const';
import LogPathChild from './LogPathChild';
interface PaiTrialChildProps { interface PaiTrialChildProps {
logString: string; logString: string;
...@@ -21,7 +22,7 @@ class PaiTrialChild extends React.Component<PaiTrialChildProps, {}> { ...@@ -21,7 +22,7 @@ class PaiTrialChild extends React.Component<PaiTrialChildProps, {}> {
{ {
logString === '' logString === ''
? ?
<div /> null
: :
<div> <div>
{ {
...@@ -33,10 +34,13 @@ class PaiTrialChild extends React.Component<PaiTrialChildProps, {}> { ...@@ -33,10 +34,13 @@ class PaiTrialChild extends React.Component<PaiTrialChildProps, {}> {
href={`${DOWNLOAD_IP}/trial_${id}.log`} href={`${DOWNLOAD_IP}/trial_${id}.log`}
style={{ marginRight: 10 }} style={{ marginRight: 10 }}
> >
trial stdout Trial stdout
</a> </a>
: :
<span>trial stdout: {logString}</span> <LogPathChild
eachLogpath={logString}
logName="Trial stdout:"
/>
} }
</div> </div>
} }
......
...@@ -42,7 +42,7 @@ class PaitrialLog extends React.Component<PaitrialLogProps, {}> { ...@@ -42,7 +42,7 @@ class PaitrialLog extends React.Component<PaitrialLogProps, {}> {
> >
Trial stdout Trial stdout
</a> </a>
<a target="_blank" rel="noopener noreferrer" href={logStr.split(',')[1]}>hdfsLog</a> <a target="_blank" rel="noopener noreferrer" href={logStr.split(',')[1]}>NFS log</a>
</div> </div>
: :
<div> <div>
...@@ -52,7 +52,7 @@ class PaitrialLog extends React.Component<PaitrialLogProps, {}> { ...@@ -52,7 +52,7 @@ class PaitrialLog extends React.Component<PaitrialLogProps, {}> {
/> />
<LogPathChild <LogPathChild
eachLogpath={logStr.split(',')[1]} eachLogpath={logStr.split(',')[1]}
logName="Log on HDFS:" logName="Log on NFS:"
/> />
</div> </div>
} }
......
...@@ -112,14 +112,14 @@ class Trial implements TableObj { ...@@ -112,14 +112,14 @@ class Trial implements TableObj {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const duration = (endTime - this.info.startTime!) / 1000; const duration = (endTime - this.info.startTime!) / 1000;
let accuracy; let accuracy;
if(this.acc !== undefined && this.acc.default !== undefined){ if (this.acc !== undefined && this.acc.default !== undefined) {
if(typeof this.acc.default === 'number'){ if (typeof this.acc.default === 'number') {
accuracy = JSON5.parse(this.acc.default); accuracy = JSON5.parse(this.acc.default);
}else { } else {
accuracy = this.acc.default; accuracy = this.acc.default;
} }
} }
return { return {
key: this.info.id, key: this.info.id,
sequenceId: this.info.sequenceId, sequenceId: this.info.sequenceId,
...@@ -227,7 +227,7 @@ class Trial implements TableObj { ...@@ -227,7 +227,7 @@ class Trial implements TableObj {
Object.entries(acc).forEach(item => { Object.entries(acc).forEach(item => {
const [k, v] = item; const [k, v] = item;
const column = space.axes.get(k); const column = space.axes.get(k);
if (column !== undefined) { if (column !== undefined) {
ret.set(column, v); ret.set(column, v);
} else { } else {
...@@ -245,7 +245,7 @@ class Trial implements TableObj { ...@@ -245,7 +245,7 @@ class Trial implements TableObj {
} }
public finalKeys(): string[] { public finalKeys(): string[] {
if(this.acc !== undefined){ if (this.acc !== undefined) {
return Object.keys(this.acc); return Object.keys(this.acc);
} else { } else {
return []; return [];
...@@ -304,11 +304,16 @@ class Trial implements TableObj { ...@@ -304,11 +304,16 @@ class Trial implements TableObj {
} }
private renderNumber(val: any): string { private renderNumber(val: any): string {
if(typeof val === 'number'){ if (typeof val === 'number') {
if (isNaNorInfinity(val)) { if (isNaNorInfinity(val)) {
return `${val}`; // show 'NaN' or 'Infinity' return `${val}`; // show 'NaN' or 'Infinity'
} else { } else {
return `${formatAccuracy(val)} (FINAL)`; if (this.accuracy === undefined) {
return `${formatAccuracy(val)} (LATEST)`;
} else {
return `${formatAccuracy(val)} (FINAL)`;
}
} }
} else { } else {
// show other types, such as {tensor: {data: }} // show other types, such as {tensor: {data: }}
...@@ -317,8 +322,8 @@ class Trial implements TableObj { ...@@ -317,8 +322,8 @@ class Trial implements TableObj {
} }
public formatLatestAccuracy(): string { // TODO: this should be private public formatLatestAccuracy(): string { // TODO: this should be private
if(this.status === 'SUCCEEDED'){ if (this.status === 'SUCCEEDED') {
return (this.accuracy === undefined ? '--': this.renderNumber(this.accuracy)); return (this.accuracy === undefined ? '--' : this.renderNumber(this.accuracy));
} else { } else {
if (this.accuracy !== undefined) { if (this.accuracy !== undefined) {
return this.renderNumber(this.accuracy); return this.renderNumber(this.accuracy);
...@@ -330,7 +335,7 @@ class Trial implements TableObj { ...@@ -330,7 +335,7 @@ class Trial implements TableObj {
return this.renderNumber(metricAccuracy(latest)); return this.renderNumber(metricAccuracy(latest));
} }
} }
} }
} }
......
...@@ -2,16 +2,21 @@ ...@@ -2,16 +2,21 @@
/* decide modal size */ /* decide modal size */
.ms-Dialog-main{ .ms-Dialog-main{
width: 50%; width: 50%;
overflow: hidden; min-width: 450px;
}
.ms-Modal-scrollableContent{
overflow-x: hidden;
} }
/* compare-md: table style */ /* compare-md: table style */
.flex{
display: flex;
}
&-table{ &-table{
width: 92%; width: 92%;
margin: 0 auto; margin: 0 auto;
margin-bottom: 20px; margin-bottom: 20px;
border: 1px solid transparent; border: 1px solid transparent;
overflow: auto; overflow: auto hidden;
color: #333; color: #333;
tr{ tr{
line-height: 30px; line-height: 30px;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment