Samsung / ONE-vscode

Visual Studio Code Extension of ONE compiler toolchain
Apache License 2.0
48 stars 50 forks source link

[Circle Editor] Plans for new Circle Editor feature #1269

Open yoojincha opened 2 years ago

yoojincha commented 2 years ago

[Circle Editor] Plans for new Circle Editor feature

WHAT

We are planning to implement an editor feature to the currently embedded netron circle viewer.

WHY

There were demands for modifying data in circle file. However, it is difficult to manipulate data in circle file, which is in binary format. Therefore, we plan to increase convenience by enabling modification on the current circle viewer in GUI form.

HOW

We plan to add an edit button to the sidebar that appears when Circle graph is clicked. Our goal is to let users modify the data in Attribute/Input/Output sections by turning them into input areas when clicking the edit button.

Current Circle Viewer is set to be Read-Only, and does not allow modification. We plan to expand the existing CustomViewer, Provider, CustomDocument codes to enable data CRUD. Once the edit button is clicked on our new GUI, user input data will be transferred to our CustomEditor(updated version of the current CircleViewer) to apply the changes to the original Circle file.

Below are two designs we are considering for the edit button:

1) Pencil icon pencil icon

2) VS Code style button bluebutton

llFreetimell commented 2 years ago

Test Model File

If you follow below steps, you can can inception_v3 circle model file!

YuyeonHan commented 2 years ago

[Circle Editor] Add files for making Circle model object #1305

We have completed issue https://github.com/Samsung/ONE-vscode/issues/1269 and now ready to send pull request per each function.

These are brief explanations of the files we would like to merge:

  1. src/CircleEditor/circle_schema_generated.ts
    • ts file auto generated with flatbuffers according to circle schema.
    • Used for generating model object which is necessary for saving, editing and loading binary circle file.
    • This should be updated if circle schema is modified.
  2. src/CircleEditor/CircleTypes.ts
    • Resolved naming convention conflict with circle schema and webview
    • To receive value dynamically in which cases the value is referring to enum. For instance, builtinOptionsType from operators could refer to enum BuilinOptions.

TODO

YuyeonHan commented 2 years ago

[Circle Editor] Add files for activating Circle custom editor

These are brief explanations of the files we would like to merge in pull request #1328

src/CircleEditor

  1. CircleEditorProvider.ts

    • Custom editor provider that implements vscode extension API
    • Creates customEditorDocument and webview
    • Receives changes or messages from webview and calls appropriate function in CircleCustomDocument
  2. CircleEditorDocument.ts

    • Custom editor document that implements vscode extension API
    • Manages temporary model states opened in webviews
    • Maintains _model object so that binary circle data can be computed as an object
  3. CircleEditorException.ts

    • Custom Exception for circle editor
  4. MessageType.ts

    • Custom message types to communicate with vscode and webviews

src/Utils

  1. Dispose.ts
    • Register disposable events and release them all at once.

TODO

  1. CircleEditorDocument.ts
    • Additional functions that we already completed will be requested for review.
    • Functions will include
    • Editing operator attributes and tensors
    • Editing model through json format