-
Notifications
You must be signed in to change notification settings - Fork 51
[MPQEditor] Create or edit mixed precision quantization json file. #1505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
stamalakhov
wants to merge
1
commit into
Samsung:main
Choose a base branch
from
stamalakhov:manual_MPQ_BR
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# MixedPrecisionQantizationEditor (MPQEditor for short) | ||
|
||
## About | ||
|
||
MPQEditor povides easy way of creation/editing MPQ json files, suitable for | ||
Quantization step in CfgEditor. Also it gives the ability to select the most | ||
sensitive to quantization layers using `visq` data. | ||
|
||
## How to use | ||
|
||
Currently MPQEditor is integrated into EXPLORER view by context menu item | ||
"Create MPQ json". | ||
|
||
In order to use it: | ||
1) call context menu for a `.circle` model in EXPLORER view | ||
2) call "Create MPQ json" | ||
3) give a name to MPQ json | ||
4) edit MPQ json using MPQEditor | ||
5) all layers from 'layers' section in json are shown in grid-table, so | ||
that their options for quantization can be edited using their respective | ||
dropdowns. Layers which don't belong to 'layers' section will be quantized | ||
using default parameters. | ||
6) to make 'model-graph-view' more informative the user may use 'visq' | ||
information, it shows which layers are more sensitive to quantization than | ||
others | ||
|
||
## Screen layout | ||
Layout is divided into three main parts: | ||
1) Default Quantization Parameters | ||
|
||
<img src="images/MpqDefaultSection.png" width=500> | ||
|
||
2) 'Layers' section | ||
|
||
<img src="images/MpqLayersSectionGen.png" width=500> | ||
|
||
3) Model graph view | ||
|
||
<img src="images/MpqModelGraphView.png" width=500> | ||
|
||
### Layers section | ||
<img src="images/MpqLayersSection.png" width=500> | ||
|
||
1. `Add more layers` | ||
- use it to add more layers for editing their quantization properties | ||
2. `VISQ control` | ||
- info | ||
- actual path | ||
- 'load visq' button | ||
- 'clear visq' button | ||
3. `Model graph is shown/hidden` | ||
- use this to enable selection on `Model graph view` | ||
4. `Individual layer` | ||
- it consists of quantization properties set for each layer | ||
5. `Quantization properties of layer` | ||
- quantization and granularity fields for each layer | ||
6. `Restore layer` | ||
- use it to restore the layer to default state | ||
|
||
|
||
For the whole workflow see: | ||
|
||
<img src="images/MpqWorkflow.gif" width=1000/> | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<!-- | ||
Copyright (c) 2023 Samsung Electronics Co., Ltd. All Rights Reserved | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta | ||
http-equiv="Content-Security-Policy" | ||
content="img-src vscode; | ||
style-src 'unsafe-inline' ${webview.cspSource}; | ||
script-src 'nonce-${nonce}';"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Mixed Precision Quantization editor</title> | ||
<link rel="stylesheet" href="${cssUri}"> | ||
<link rel="stylesheet" href="${codiconUri}"> | ||
<script nonce="${nonce}" type="module" src="${toolkitUri}"></script> | ||
<script nonce="${nonce}" type="module" src="${scriptUri}"></script> | ||
</head> | ||
<body> | ||
<div class="maintitle"> | ||
<span>Edit mixed precision quantization json file</span> | ||
</div> | ||
<div> | ||
<div> | ||
<div> | ||
<vscode-radio-group id="DefaultDtype"> | ||
<label slot="label">Quantized Data Type</label> | ||
<vscode-radio value="uint8">uint8</vscode-radio> | ||
<vscode-radio value="int16">int16</vscode-radio> | ||
</vscode-radio-group> | ||
</div> | ||
<div> | ||
<vscode-radio-group id="DefaultGranularity"> | ||
<label slot="label">Granularity</label> | ||
<vscode-radio value="layer">layer</vscode-radio> | ||
<vscode-radio value="channel">channel</vscode-radio> | ||
</vscode-radio-group> | ||
</div> | ||
</div> | ||
</div> | ||
<div> | ||
<vscode-divider></vscode-divider> | ||
</div> | ||
<div> | ||
<div class="leftbtns"> | ||
<vscode-button id="AddSpecificLayer" appearance="icon"> | ||
<span slot="start" class="codicon codicon-add"></span> | ||
</vscode-button> | ||
</div> | ||
<div class="rightbtns"> | ||
<vscode-text-field id="VisqInputPath" startIcon="true" placeholder="visq path" readonly="true"> | ||
<span slot="start" class="codicon codicon-question" style="cursor: pointer"> | ||
<span class="help"> | ||
visq.json file with layer-wise quantization errors | ||
</span> | ||
</span> | ||
<span id="visq-file" slot="end" class="codicon codicon-search" style="cursor: pointer"></span> | ||
<span id="visq-delete" slot="end" class="codicon codicon-chrome-close" style="cursor: pointer"></span> | ||
</vscode-text-field> | ||
<vscode-checkbox id="circle-graph">Model Graph</vscode-checkbox> | ||
</div> | ||
</div> | ||
<div> | ||
<vscode-data-grid id="LayersTable" class="layers" generate-header="default" aria-label="Default Header" grid-template-columns="1fr 110px 120px 40px"> | ||
<vscode-data-grid-row row-type="header"> | ||
<vscode-data-grid-cell cell-type="columnheader" grid-column="1">Name</vscode-data-grid-cell> | ||
<vscode-data-grid-cell cell-type="columnheader" grid-column="2">Quantization</vscode-data-grid-cell> | ||
<vscode-data-grid-cell cell-type="columnheader" grid-column="3">Granularity</vscode-data-grid-cell> | ||
<vscode-data-grid-cell cell-type="columnheader" grid-column="4"> </vscode-data-grid-cell> | ||
</vscode-data-grid-row> | ||
</vscode-data-grid> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets' make the image a bit smaller and text bigger
OUTPUT
windowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok