Skip to content

[CircleGraph] UI for one-partition #633

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

Open
seanshpark opened this issue May 12, 2022 · 10 comments
Open

[CircleGraph] UI for one-partition #633

seanshpark opened this issue May 12, 2022 · 10 comments

Comments

@seanshpark
Copy link
Contributor

circle graph view is almost ready to provide node selection.
There are some major features to develop but now is a good time to think how to interact for one-partiton tool.

About one-partition (in ONE repo)

  • one-partiton divides input circle model into two or more circle models
  • partitioned model is a portion of the input model
  • partitioned models should work exactly like the input model when connected properly
  • *.part file is a INI format text file which provides information how to partition the input model
  • users can edit *.part file by normal text editor

Relation with one-partition

  • purpose here is to generate the *.part file throught GUI, manually
  • user can view the model in a graph form
  • user can define partitions (two or more, we can set the first one as default for simplicity)
  • for each partition, use can select nodes to be assigned to that partition
  • a node can be assigned only to one partition
  • user can produce *.part file with current state
  • user can read existing *.part file
@seanshpark
Copy link
Contributor Author

seanshpark commented May 13, 2022

How to provide a GUI for model partition? (obsolete)

This feature is about how to parition a model while compiling a model.
I could see that we have great CfgEditor that provides editing of our .cfg file.

There is Compile steps and Additional Jobs
From previous discussion (need to find it), we will put Partition between Quantize and Codegen

  • @lemmaa , do you know which issue was it?

What tool needs; input fields

  • input_fle: input model (which is output model if Quantize)
  • part_file: *.part file name
  • work_path: (optional) where input files exist and outputs are generated

We can provide manual editing of *.part file in Adavanced Options region(I don't know the term for this).
Brief part_file inside (circle-partitioner#readme for detail);

  • [partition] section
    • backends=: list of backends, ex) cpu,acl_cl
    • default=: default backend, ex) cpu
    • comply=: comply how to partition, ex) opcode or opname (opindex when ready`)
  • [OPCODE] section if comply=opcode
    • ex) MAXIMUM=acl_cl
  • [OPNAME] section if comply=opname
    • ex) conv2d_1;relu=acl_cl

@hyunsik-yoon
Copy link
Contributor

/cc @llFreetimell

@seanshpark
Copy link
Contributor Author

seanshpark commented May 13, 2022

How to define the roles between CfgEditor and CircleGraph? (obsolete)

Case 1)

  • CfgEditor does the *.part file creation and editing
  • CfgEditor invokes CircleGraph with model and selection
  • CircleGraph edits the selection
  • CfgEditor receives new selection and saves to *.part file

Case 2)

  • There is PartEditor
  • CfgEditor invokes PartEditor with model and *.part (can be empty for new)
  • PartEditor invokes CircleGraph with model and selection
  • CircleGraph edits the selection
  • PartEditor receives new selection and saves to *.part file
  • CfgEditor receives new/existing *.part path

Case 3)

  • ?

Anyway.. things I need to find out

  • how CfgEditor call CirclrGraph
  • how CirclrGraph return to CfgEditor with selection

@hyunsik-yoon
Copy link
Contributor

hyunsik-yoon commented May 13, 2022

We had a offline discussion on the above.

Discussion summary

  • Short term approach:
    • approach like the following:
      • click circle file on OneExplorer-> "partition" menu -> show PartEditor
        • PartEditor might show the list of partitioned nodes and invoke CircleGraph
  • Long term approach:
    • Install ONERT backend
    • create cfg file on OneExplorer for ONERT -> this will show cfg editor that has UI to invoke PartEditor

@seanshpark
Copy link
Contributor Author

How to provide a GUI for model partition?

This feature is about how to parition a model while compiling a model.

We'll start from a single .circle file

  • by OneExplorer -> .circle file -> context menu -> partition... menuitem
  • by OneExplorer -> .part file -> context menu -> `edit..."
  • by Command Palette -> ONE: partition model -> .circle or .part file

Issue

  • .part file has no strict relation with .circle file
  • that is, any filename can be used and there is no direct link betweeen two
  • so, editing .part itself is OK but cannot utilize .circle model

What tool needs; input fields

  • input_fle: input model (which is output model if Quantize)
  • part_file: *.part file name
  • work_path: (optional) where input files exist and outputs are generated

@lemmaa
Copy link
Member

lemmaa commented May 16, 2022

Basically, it seems that we should first think about the workflow of one-cmds that includes a partitioner. AFAIK, we don't yet have a way in *.cfg to specify a workflow for each partitioned piece individually. For example, if one model is partitioned into three with CPU/GPU/NPU as the backend, the subsequent workflow of the model for CPU/GPU and the model for NPU will be different. Has ONE-vscode ever been discussed for such a workflow?

It is thought that the UI of ONE-vscode for partition support will vary greatly depending on the processing method for this workflow.

@lemmaa
Copy link
Member

lemmaa commented May 16, 2022

#633 (comment)

From previous discussion (need to find it), we will put Partition between Quantize and Codegen

  • @lemmaa , do you know which issue was it?

@seanshpark , Aha! maybe what you are saying is Samsung/ONE#8570 . Right?

If so, I think my #633 (comment) opinion was a bit out of scope. That's a very general case, for example Samsung/ONE#8570 (comment). The current discussion seems to be limited to the case where the backend is an NPU. Sorry for the confusion.

@seanshpark
Copy link
Contributor Author

Aha! maybe what you are saying is Samsung/ONE#8570 . Right?

Yes, this is the one :) Thanks !!!

@seanshpark
Copy link
Contributor Author

seanshpark commented May 16, 2022

I'll start with another extension PartitionEditor named with PartEditor above. --> just PartEditor
--> #641

@seanshpark
Copy link
Contributor Author

About .part file editing in PartEditor (had a little discussion with @hyunsik-yoon)

  • backend information is backend dependent and should be from backend
  • it will be useless like adding "MyFastGPU" and hope backend to understand this. it won't.
  • as how to communicate with backend is not yet defined, just go with fixed items; CPU / ACL_CL / NPU
  • later we can fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants