Skip to content
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

Allow partitioning, quantization and compilation for graphs with multiple subgraphs #45

Open
FireFox317 opened this issue Jun 7, 2021 · 1 comment

Comments

@FireFox317
Copy link

The current state of the code does not allow for all kinds of operations (partitioning, quantization and compilation) to be performed on a graph with multiple subgraphs. For example the yolov4-tiny model, has split operations which are not supported by the DPU, thus the graph should be split into multiple subgraphs and each of these subgraphs should be quantized and compiled to IR for the DPU.

The problem already starts in partitioning. After partitioning the graph into subgraphs, the code figure out what the biggest subgraph is and then throws away all the other subgraphs, such that only one subgraph is left. This however, completely changes the behavior of the model and is not resulting in the intended behavior. The following code deletes all the other subgraphs:

largest_xp, largest_xp_size = "", 0
for xp in sorted(par_2_names.keys()):
if len(par_2_names[xp]) > largest_xp_size:
largest_xp = xp
largest_xp_size = len(par_2_names[xp])
for xp in list(par_2_names.keys()):
if xp != largest_xp:
del par_2_names[xp]
for xname, xp_lst in list(name_2_pars.items()):
if xp_lst[0] != largest_xp:
del name_2_pars[xname]

By removing this code, is is possible to generate a graph with multiple subgraphs, but then in the next stage (quantization), it doesn't work, since that code assumes that only one subgraph is present. There seems to be some code written that should be able to quantize a graph with multiple subgraphs, but that currently doesn't work either. (See base_subgraph_quantizer.py)

It would be nice if the pyXIR flow would support this use case. I'm currently looking into this and figuring out if I can get this to work.

@ssunrt
Copy link

ssunrt commented May 24, 2024

Hi, is there any progress on this issue?

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

2 participants