From ade405d5cee29f1c57655a2cd71e5fc44a973489 Mon Sep 17 00:00:00 2001 From: Yongseop Kim Date: Mon, 11 Jul 2022 09:49:20 +0900 Subject: [PATCH] [docs] Introduce HowTo and Glossary documents (#999) * [docs] Introduce HowTo and Glossary documents Let's introduce HowTo and Glossary documents. ONE-vscode-DCO-1.0-Signed-off-by: Yongseop Kim * Update docs/HowToUse.md Co-authored-by: Dayoung Lee * Update docs/HowToUse.md Co-authored-by: Dayoung Lee * Update docs/HowToInstall.md Co-authored-by: Dayoung Lee * Update docs/HowToInstall.md Co-authored-by: Dayoung Lee * Update docs/HowToInstall.md Co-authored-by: Dayoung Lee * Update docs/Glossary.md Co-authored-by: yunjayh <50489513+yunjayh@users.noreply.github.com> * Update docs/Glossary.md Co-authored-by: yunjayh <50489513+yunjayh@users.noreply.github.com> * Update docs/HowToInstall.md Co-authored-by: yunjayh <50489513+yunjayh@users.noreply.github.com> * Update docs/HowToUse.md Co-authored-by: Dayoung Lee Co-authored-by: yunjayh <50489513+yunjayh@users.noreply.github.com> --- docs/Glossary.md | 35 +++++++++++++++++ docs/HowToBuildFromSource.md | 42 ++++++++++++++++++++ docs/HowToInstall.md | 74 ++++++++++++++++++++++++++++++++++++ docs/HowToUse.md | 30 +++++++++++++++ 4 files changed, 181 insertions(+) create mode 100644 docs/Glossary.md create mode 100644 docs/HowToBuildFromSource.md create mode 100644 docs/HowToInstall.md create mode 100644 docs/HowToUse.md diff --git a/docs/Glossary.md b/docs/Glossary.md new file mode 100644 index 00000000..a2746eb5 --- /dev/null +++ b/docs/Glossary.md @@ -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. diff --git a/docs/HowToBuildFromSource.md b/docs/HowToBuildFromSource.md new file mode 100644 index 00000000..f2dbd415 --- /dev/null +++ b/docs/HowToBuildFromSource.md @@ -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'... + +> one-vscode@0.1.0 vscode:prepublish +> npm run compile + + +> one-vscode@0.1.0 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. diff --git a/docs/HowToInstall.md b/docs/HowToInstall.md new file mode 100644 index 00000000..179d4ae1 --- /dev/null +++ b/docs/HowToInstall.md @@ -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 + + + +### 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. diff --git a/docs/HowToUse.md b/docs/HowToUse.md new file mode 100644 index 00000000..b56ed6e2 --- /dev/null +++ b/docs/HowToUse.md @@ -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.) + + + +## 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. + + + +## 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'. + + + +## Trouble-shooting + +How to watch log? +- View -> output -> ONE-vscode + +