-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Support builds without RTTI #4333
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
Conversation
|
@tiagoshibata can you please quantify the reduction in size after these changes? thx. |
|
Should we do this for ONNX as well? ONNX might not be using RTTI now, but having a compile flag will avoid the usage going undetected. |
|
Just wondering: what if in a single PE file, part of the code was compiled with RTTI, part of it wasn't. Would it cause problem at link time? |
|
@pranavsharma 436K - about the same that I reported before @snnn good question. I believe that, if there's a class with virtual members, and one compilation unit with RTTI disabled and another one with it enabled both use it, there will be a linker error or runtime problems |
8155738 to
1fe335c
Compare
|
I rebased to fix a conflict in the root CMakeLists.txt. Can you take a look again? Thanks! |
1fe335c to
6daf7cb
Compare
|
Rebased again due to Mac pipeline being misconfigured in master. Hopefully this passes now. |
Description: Supporting disabling RTTI and other options for reducing binary size were requested by customers.
The only more relevant change was the inheritance around IControlFlowKernel to avoid casting sideways in the inheritance tree. Previously, control flow kernels would inherit from OpKernel and IControlFlowKernel. Since all IControlFlowKernel were also OpKernel (and no class inherited from IControlFlowKernel only), I made IControlFlowKernel inherit from OpKernel, so a simple downcast/upcast without RTTI can be done.
I believe all breaking changes are restricted to the CPU provider and don't affect any public APIs. Let me know if I'm wrong and we can discuss alternatives.