forked from Samsung/ONE-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Introduce HowTo and Glossary documents (Samsung#999)
* [docs] Introduce HowTo and Glossary documents Let's introduce HowTo and Glossary documents. ONE-vscode-DCO-1.0-Signed-off-by: Yongseop Kim <[email protected]> * Update docs/HowToUse.md Co-authored-by: Dayoung Lee <[email protected]> * Update docs/HowToUse.md Co-authored-by: Dayoung Lee <[email protected]> * Update docs/HowToInstall.md Co-authored-by: Dayoung Lee <[email protected]> * Update docs/HowToInstall.md Co-authored-by: Dayoung Lee <[email protected]> * Update docs/HowToInstall.md Co-authored-by: Dayoung Lee <[email protected]> * Update docs/Glossary.md Co-authored-by: yunjayh <[email protected]> * Update docs/Glossary.md Co-authored-by: yunjayh <[email protected]> * Update docs/HowToInstall.md Co-authored-by: yunjayh <[email protected]> * Update docs/HowToUse.md Co-authored-by: Dayoung Lee <[email protected]> Co-authored-by: yunjayh <[email protected]>
- Loading branch information
1 parent
0f0530d
commit ade405d
Showing
4 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,35 @@ | ||
# Glossary | ||
|
||
A glossary for(or used in) ONE-vscode | ||
|
||
## Concepts of ONE-vscode that You Must Know | ||
|
||
There are concepts only used in ONE-vscode. Let's investigate them. | ||
|
||
### Toolchain | ||
|
||
`Toolchain` is a collection of tools. Now you could think it as `ONE` itself. | ||
|
||
### Backend | ||
|
||
The word `Backend` is used to a concept to wrap `Toolchain` and others that related to `Toolchain`. | ||
|
||
### ONE Explorer View | ||
|
||
`ONE Explorer View` is a tree view for NN models and config file. | ||
|
||
### Compile | ||
|
||
`Compile` in ONE-vscode is doing `Compile Steps` in a config file with `Toolchain`. | ||
|
||
#### Compile Steps | ||
|
||
- Import: Import a NN model to convert it to `circle` model. | ||
- Optimization: Try optimizing as possible by using `circle2circle`. | ||
- Quantization: Quantize `circle` model. | ||
- Codegen: Generate code as output for backend. | ||
- Profile: Profile output with backend. | ||
|
||
### ONE Config File(*.cfg) | ||
|
||
The above `Compile Steps` is described in a ONE config file. The ONE config file is basically based on [ini](https://en.wikipedia.org/wiki/INI_file) format. |
This file contains 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,42 @@ | ||
# How to build from source? | ||
|
||
If you want to use the latest version of ONE-vscode, let's do the following: | ||
|
||
## STEP1. Install vsce | ||
|
||
[vsce](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) is `Visual Studio Code Extension`. | ||
- You should install [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) before installing vsce | ||
|
||
```console | ||
$ npm install -g vsce | ||
``` | ||
|
||
## STEP2. Clone repository | ||
|
||
git clone `ONE-vscode` | ||
|
||
```console | ||
$ git clone https://github.com/Samsung/ONE-vscode.git | ||
``` | ||
|
||
## STEP3. Create vsix package | ||
|
||
```console | ||
ONE-vscode$ npm install | ||
... | ||
|
||
ONE-vscode$ vsce package | ||
Executing prepublish script 'npm run vscode:prepublish'... | ||
|
||
> [email protected] vscode:prepublish | ||
> npm run compile | ||
|
||
|
||
> [email protected] compile | ||
> tsc -p ./ | ||
|
||
This extension consists of 1282 files, out of which 653 are JavaScript files. For performance reasons, you should bundle your extension: https://aka.ms/vscode-bundle-extension . You should also exclude unnecessary files by adding them to your .vscodeignore: https://aka.ms/vscode-vscodeignore | ||
DONE Packaged: /home/dragon/Works/ONE-vscode/one-vscode-0.1.0.vsix (1282 files, 340.49MB) | ||
``` | ||
|
||
Now you get the latest vsix file. |
This file contains 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,74 @@ | ||
# How to install? | ||
|
||
## Prerequisite | ||
|
||
ONE-vscode is an [extension](https://code.visualstudio.com/docs/editor/extension-marketplace) of [vscode](https://code.visualstudio.com/). To use ONE-vscode, you should install vscode first. | ||
|
||
### VS Code and its extensions | ||
|
||
Let's install vscode. | ||
- You can download vscode [here](https://code.visualstudio.com/download) | ||
- Refer [official document](https://code.visualstudio.com/docs/setup/setup-overview) for installing vscode. | ||
|
||
### ssh extension in vscode | ||
|
||
Now [ONE](https://github.com/Samsung/ONE) officially releases on linux/ubuntu only. If your development environment is on Windows, you should use ssh extension in vscode. Let's follow [tutorial](https://code.visualstudio.com/docs/remote/ssh-tutorial). | ||
|
||
### Environment setting on linux/ubuntu | ||
|
||
Linux machine must have `aptitude` package. | ||
|
||
### Workspace | ||
|
||
Prepare workspace according to the [document](https://code.visualstudio.com/docs/editor/workspaces). ONE-vscode has been developed based on workspace. | ||
Typically, a workspace for ONE-vscode has the following files: | ||
- your model files | ||
- Tensorflow model file(*.pb, saved model or Keras model) | ||
- Tensorflow Lite model (*.tflite) | ||
- Onnx model (*.onnx) | ||
- ONE *.cfg files | ||
- intermediate files during compilation (e.g., *.circle) or compiled output files after compilation | ||
|
||
## How to install? | ||
|
||
If you are a user(who just wants to use ONE-vscode not to develop ONE-vscode), installing ONE-vscode and a backend extension is enough. Let's install ONE-vscode with vsix file. | ||
|
||
### Installing with GUI | ||
|
||
Extensions(Ctrl+Shift+x) -> Views and More Actions -> Install from VSIX | ||
|
||
<img src="https://user-images.githubusercontent.com/10216715/174781792-fa3fbe47-708b-4977-974c-578b65f689ee.gif" width=600 /> | ||
|
||
### Installing with CLI | ||
|
||
```console | ||
$ ls | ||
one-vscode-0.1.0.vsix | ||
|
||
$ code --install-extension ./one-vscode-0.1.0.vsix | ||
Installing extensions... | ||
... | ||
Extension 'one-vscode-0.1.0.vsix' was successfully installed. | ||
|
||
$ code --list-extensions | ||
ms-vscode-remote.remote-containers | ||
ms-vscode-remote.remote-ssh | ||
ms-vscode-remote.remote-ssh-edit | ||
ms-vscode-remote.remote-wsl | ||
ms-vscode-remote.vscode-remote-extensionpack | ||
Samsung.one-vscode # YOU MUST SEE THIS | ||
``` | ||
|
||
### How to get the vsix package? | ||
|
||
Find the official vsix package: [Release Page](https://github.com/Samsung/ONE-vscode/releases) | ||
|
||
Some developers may want to build the latest vsix file by themselves. In such case, read [How To Build From Source](./HowToBuildFromSource.md) document. | ||
|
||
### Installing a backend extension | ||
|
||
To make ONE-vscode work feature-rich, you should install a backend extension. Now it supports by the in-house project. | ||
|
||
### Reload | ||
|
||
Please reload vscode after intalling ONE-vscode. |
This file contains 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,30 @@ | ||
# How to use? | ||
|
||
Let's compile an example by using ONE-vscode. | ||
|
||
## Install the toolchain | ||
|
||
First, you need the ONE toolchain. Let's install the ONE toolchain. (You should install the in-house backend to follow this.) | ||
|
||
<img src="https://user-images.githubusercontent.com/7223627/174947559-71ab213c-68c4-4700-bcec-e55f6a2203bf.gif" width=600 /> | ||
|
||
## Prepare a NN model and a config file | ||
|
||
Second, you need a NN model and a config file to run compiling. Now you can get one from [res/modelDir/truediv](../res/modelDir/truediv/). Add it to your workspace. Now you can see a model and a config. | ||
|
||
<img src="https://user-images.githubusercontent.com/10216715/174798969-eee44fea-bd71-4e6a-8e2c-9e1de37ad74a.gif" width=600 /> | ||
|
||
## Compile models | ||
|
||
Last, you can compile the model by pushing Run button. | ||
|
||
Depends on backend, you may be able to infer or profile a model by 'running config'. | ||
|
||
<img src="https://user-images.githubusercontent.com/10216715/174796457-4dae4a77-04e1-4e5c-9453-77ebfb65182a.gif" width=600 /> | ||
|
||
## Trouble-shooting | ||
|
||
How to watch log? | ||
- View -> output -> ONE-vscode | ||
|
||
<img src="https://user-images.githubusercontent.com/10216715/174795531-9868f1e0-25ab-4ae3-bf65-fe8385a7ba76.gif" width=600 /> |