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

[CLangBackend] Meet unsupported operator: Constant #179

Open
robinvanemden opened this issue May 29, 2020 · 2 comments
Open

[CLangBackend] Meet unsupported operator: Constant #179

robinvanemden opened this issue May 29, 2020 · 2 comments

Comments

@robinvanemden
Copy link

What to add:

When converting a model containing a Constant type operator to C using the CLangBackend, onnc exits prematurely with the following message:

Meet unsupported operator: Constant(name="Constant_72")

Why it is necessary:

Constant is a common operator.

How to achieve it:

The "constant" operator is currently commented out in CLangBackend's RegisterLowers():

// FIXME: #include <onnc/Transforms/TensorSel/Standards/ConstantLower.h>
// TODO: #include <onnc/Transforms/TensorSel/Standards/ConstantFillLower.h>

So presumably, fixing ConstantLower would solve this issue?

@robinvanemden robinvanemden changed the title Meet unsupported operator: Constant [CLangBackend] Meet unsupported operator: Constant May 29, 2020
@a127a127
Copy link
Contributor

a127a127 commented Jun 3, 2020

Wow, it's weird. Due to historical reasons, ONNC handles Constant in ONNX IR level.
The "Constant" operator should be removed in ONNX IR level by this pass: https://github.com/ONNC/onnc/blob/master/lib/Transforms/ExtractConstToInitializer.cpp
And that pass should be added in addStandardTensorSel():
https://github.com/ONNC/onnc/blob/master/lib/Target/TargetStandardPasses.cpp#L43
https://github.com/ONNC/onnc/blob/master/lib/Target/CLang/CLangBackend.cpp#L171

Fixing ConstantLower would solve this "Meet unsupported operator" error, but I'm not sure following passes could handle Constant operator correctly.

@robinvanemden
Copy link
Author

Thanks! That ought to help me pinpoint the issue - I will see if I am able to fix it myself using your information.

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