As we support several backends and we can think of this in the frontend,
Currently I'm not clear of this task. Let's do some prototyping and see...
Let's begin with a simple Model
With this, I could prepare/build-up necessary methods for basic tasks.
--> it may not be possible to verify with _luci-interpreter_ as sin/cos is not supported...
--> Sqrt, Rsqrt are implemented
For the first step, lets assume model has only one subgraph with above Input - Sqrt- Rsqrt- Output network.
Then we can use IF or WHILE for multiple subgraphs.
https://github.com/Samsung/ONE/pull/6231#issuecomment-799037972 commit stores to two circle files like

Let's now try to group graphs with same kind of group(backend).
Cases of source circle model graph
Things to do from 10,000 feet
ConnectNodeQueryOpCodeCloneNodethat may produce recursive situation: where Sqrt is assigned to different group(backend)

Things to do from 100 feet
CircleConst ?Net_InstanceNorm_003check with a model that may produce recursive situation
Rsqrt - Rsqrt sequnce should have one input and two outputs: one from first Rsqrt and another from second RsqrtLet's try with this one: Net_Sqrt_Rsqrt_Add_001.circle

Problem(s) to solve
With first one solved, https://github.com/Samsung/ONE/pull/6231#issuecomment-800719125 commit result
./circle-partitioner \
--partition Net_Sqrt_Rsqrt_Add_001.part \
Net_Sqrt_Rsqrt_Add_001.circle Net_Sqrt_Rsqrt_Add_001.part.circle

Remove unused outputs : need to remove rsqrt2 from outputstodo : Remove unused outputs
Let's think this with save connection information file together...
@hseok-oh wrote https://github.com/Samsung/ONE/pull/6231#issuecomment-800762497
My draft based on partitioned model: MANIFEST and Net_Sqrt_Rsqrt_001.part.config(json)
MANIFEST
{
"major-version" : "1",
"minor-version" : "1",
"patch-version" : "0",
"models" : [ "Net_Sqrt_Rsqrt_001.part.00001_acl_cl.circle" , "Net_Sqrt_Rsqrt_001.part.00002_cpu.circle" ],
"partition" : "Net_Sqrt_Rsqrt_001.part.config",
"model-types" : [ "circle", "circle" ]
}
Net_Sqrt_Rsqrt_001.part.config
{
"source" : {
"file" : "Net_Sqrt_Rsqrt_001.circle",
"inputs" : [ "ifm" ],
"outputs" : [ "sqrt", "rsqrt", "ofm" ]
},
"parts" : [
{
"file" : "Net_Sqrt_Rsqrt_001.part.00001_acl_cl.circle",
"inputs" : [ "ifm" ],
"outputs" : [ "sqrt2", "sqrt" ],
},
{
"file" : "Net_Sqrt_Rsqrt_001.part.00002_cpu.circle",
"inputs" : [ "sqrt2" ],
"outputs" : [ "ofm", "rsqrt"]
}
]
}
This (Part_Sqrt_Rsqrt_Add_002) fails with SQRT assigned to different group(backend)

--> seems fixed
This (Part_Sqrt_Rsqrt_Add_003) (all cpu) should produce only one but three

This (Part_Add_Sub_000) (Sub in different group) doesn't work

--> https://github.com/Samsung/ONE/pull/6231#issuecomment-801726402
Rename Net_ to Part_ for testing partitioning...
Need to find a model that needs to cleanup for there are unused input...
--> checked with force adding all inputs and do cleanup to remove unused inputs
But still would be nice to find a model for this case.
Started posting PRs that seems stable.
CircleConst ?Net_InstanceNorm_003CircleConst
use node (successor of CircleConst)CircleConst is group neutraluse nodes? --> make a clone? --> seems a bit complicatednode2group conflicts.CircleConst ?build_graph, we can check each inputs, check if it's CircleConst, find or clone it.To verify Net_InstanceNorm_003 network, need to add SquaredDifference in luci_interpreter
Let's add model validation: all nodes must have a name, all names must be unique
Current status
tflite converter
Hmm...
About terms...
.part : describes how to partition the circle model.conn : describes how to connect partitioned circle modelsini or json file formatcrew library is a library to read/write partition configuration files.
CC @hseok-oh
circle-part-eval generated connection file seems needs some touch
Let's revise circle-partitioner working path and arguments
partition file is madatory: let's use positional like circle input file@seanshpark I've confirmed that model partitioning test results are generated in ${NNCC_WORKSPACE}/compiler/circle-part-eval. I'll use this for runtime loading draft #6274. Thanks.
How to manage CircleConst
Current issue
As for now, let's try with this change
CircleConst is used by only one node, let that CircleConst follow that nodeCircleConst is shared by two or more nodes, let's make clones so that one CircleConst is used for one node.CircleConst in checking same groupTo be sure this change and any other change is working correclty, we need some validation method in test process...
How to validate?
For first step, number of output circle files can be used for our CircleConst issue.