From cd19adf75330a751d3334ad8be6e2d7769838206 Mon Sep 17 00:00:00 2001 From: Belem Zhang Date: Wed, 13 Sep 2023 15:10:03 +0800 Subject: [PATCH] test queue --- src/lib/assets/css/global.css | 105 ++++++++++++++-- src/lib/assets/js/utils.js | 18 ++- src/lib/components/TestQueue.svelte | 186 ++++++++++++++++++++++++++++ src/lib/config.js | 2 +- src/routes/+page.svelte | 115 ++++------------- 5 files changed, 322 insertions(+), 104 deletions(-) create mode 100644 src/lib/components/TestQueue.svelte diff --git a/src/lib/assets/css/global.css b/src/lib/assets/css/global.css index 1236e17..5cb16ed 100644 --- a/src/lib/assets/css/global.css +++ b/src/lib/assets/css/global.css @@ -68,7 +68,11 @@ header nav { grid-row-gap: 8px; padding: 10px; align-items: center; - border-bottom: 1px solid var(--grey-border); + border: 1px solid var(--grey-02); +} + +.config:hover { + border: 1px solid var(--red); } .config label { @@ -92,10 +96,6 @@ header nav { justify-self: flex-start; } -.config .title { - justify-self: center; -} - .config .title label { min-width: 76px; } @@ -145,7 +145,19 @@ header nav { color: var(--font); } -.config label:hover { +.config .title { + display: grid; + width: 100%; + height: 100%; + align-items: center; + justify-items: center; +} +.config .title:hover { + background-color: var(--red-01); + color: var(--red); +} + +.config .backends label:hover, .config .types label:hover, .config .backends label:hover, .config .models label:hover { background-color: var(--red-01); color: var(--red); } @@ -185,6 +197,83 @@ header nav { height: 14px; } +.tq { + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-template-rows:auto; + grid-column-gap: 20px; + grid-row-gap: 0px; +} + +.tq svg { + display: inline-block; + height: 13px; +} + +.tq .onnx svg, .tq .tflite svg, .tq .npy svg, .tq .pt svg { + width: 16px; +} + +.tq #logo_onnx { + margin: 0 0 -1px 0px; +} + +.tq #logo_tflite { + margin: 0 0 -1px 0px; +} + +.tq #logo_npy { + margin: 0 0 -1px -2px; +} + +.tq #logo_pt { + margin: 0 0 -1px 2px; +} + +.q div { + display: inline-block; + text-align: center; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.q { + padding-top: 3px; + margin-bottom: 2px; + border: 1px solid var(--grey-02); +} + +.q:hover { + border: 1px solid var(--red); +} + +.tq .m, .tq .mt, .tq .dt, .tq .bk { + height: 18px; +} + +.tq .m, .tq .dt, .tq .bk { +padding: 2px 4px 2px 4px; +} + +.tq .mt { + padding: 2px 2px 2px 2px; + width: 18px; + margin-bottom: -1px; +} + +.q .m { + width: 200px; +} + +.q .dt { + width: 60px; +} + +.q .bk { + width: 100px; +} + .types svg#logo_pt { width: 60px; margin-bottom: -3px; @@ -219,10 +308,10 @@ header nav { fill: var(--red) !important; } -.types .npy-1 { +.npy-1 { fill: rgb(77, 171, 207); } -.types .npy-2 { +.npy-2 { fill: rgb(77, 119, 207); } diff --git a/src/lib/assets/js/utils.js b/src/lib/assets/js/utils.js index 40f92c4..a620e7b 100644 --- a/src/lib/assets/js/utils.js +++ b/src/lib/assets/js/utils.js @@ -41,6 +41,16 @@ export const updateStore = (numOfRuns, backends, dataTypes, modelTypes, models) modelsStore.update(() => models); } +export const resetStore = () => { + autoStore.update(() => false); + numberOfRunsStore.update(() => 1); + backendsStore.update(() => []); + dataTypesStore.update(() => []); + modelTypesStore.update(() => []); + modelsStore.update(() => []); + testQueueStore.update(() => []); +} + /** * @type {boolean} */ @@ -144,10 +154,10 @@ export const testQueue = () => { let testQueue = []; if (selectedModels) { let id = 1; - for (const b of selectedBackends) { + for (const m of selectedModels) { for (const dt of selectedDataTypes) { - for (const mt of selectedModelTypes) { - for (const m of selectedModels) { + for (const b of selectedBackends) { + for (const mt of selectedModelTypes) { const matchedModels = models.filter( (model) => model.id === m && model.format === mt && model.datatype === dt ); @@ -159,8 +169,8 @@ export const testQueue = () => { let t = { id: id, - modeltype: mt, model: m, + modeltype: mt, datatype: dt, backend: b } diff --git a/src/lib/components/TestQueue.svelte b/src/lib/components/TestQueue.svelte new file mode 100644 index 0000000..720e897 --- /dev/null +++ b/src/lib/components/TestQueue.svelte @@ -0,0 +1,186 @@ + + +
+ {#if testQueue.length > 0} + models to be tested + {/if} +
+
+ {#each testQueue as { id, model, modeltype, datatype, backend }, i} +
+
{model.replaceAll('_', ' ')}
+ {#if modeltype === 'onnx'} +
+ +
+ {/if} + + {#if modeltype === 'tflite'} +
+ +
+ {/if} + + {#if modeltype === 'npy'} +
+ +
+ {/if} + + {#if modeltype === 'pt'} +
+ +
+ {/if} +
{datatype}
+
{backend.replaceAll('_', ' ')}
+
+ {/each} +
+ + diff --git a/src/lib/config.js b/src/lib/config.js index 0ddb6ad..686ca3e 100644 --- a/src/lib/config.js +++ b/src/lib/config.js @@ -115,7 +115,7 @@ export let models = [ id: 'fns_candy', name: 'FNS Candy', url: 'https://github.com/microsoft/Windows-Machine-Learning/raw/master/Samples/CustomTensorization/CustomTensorization/fns-candy.onnx', - format: 'onnx', + format: 'pt', datatype: 'fp32' }, ]; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8a1d61e..636f90d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,65 +1,13 @@