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

Adds SeparableConv2D support #11

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

florentduchesne
Copy link
Contributor

I also needed this one for my project. Hope it can be useful for someone else.

Note : I didn't use quantization and didn't test it, but the general approach works fine for the models I used it with, and I don't think the quantize method would differ from that of the regular Conv2D node.

@OliverUrbann
Copy link
Collaborator

Thx again, an important layer for embedded systems! In train.py of the daimler example a small network is defined for tests. In compiler_test.py this is used for a github workflow to automatically test it. Could you add a modified net (and apply the test in compiler_test.py) that uses your new featuers?

@florentduchesne
Copy link
Contributor Author

Alright. I don't know where that error in the regular model comes from, but I expected an error in the compilation of the separable model.
There is an assertion failed on line 184 of controlflow.py. I figured out that by lowering the desired_unroll variable from 4 to 3 on line 220 of nncg.py, it would fix it, but I have little to no clue on what impact it would have exactly over the rest of the code, and why is it necessary while it wasn't on the version I developped the separable layer on. For now both tests run fine on my machine with that modification.
Do you have an idea on what would cause that assert to fail?

@OliverUrbann
Copy link
Collaborator

I had a quick look, but the bug doesn't seem to be easy to find. Setting it to 3 means that the optimization cannot go that deep, so it is very likely it is only a workaround.

When your network doesn't crash, probably that means your network cannot be optimized for some reason and the compiler stops trying before this crash. In your resulting .c, are there any assembler instructions or unrolled loops? Probably your filters numbers are not dividable by 4 or something else that makes it unoptimizable?

@OliverUrbann
Copy link
Collaborator

Could you please rerun the check? I don't see a button for that, maybe just committing something? The last check failed because of a failed download, but that seems to work (again).

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

Successfully merging this pull request may close these issues.

3 participants