Open
Description
It turns out the solution I implemented for automatic ops registration in C++ is not robust enough.
If falls apart when the actual torchvision code is enclosed in a static library, which is then meant to be consumed by an executable. This indirect hop through a library exposes the pruning problem all over again. Apologies for not realizing earlier and implementing it this way :/.
In the end, I think the only two viable solutions are the ones we discussed a while ago:
- Force include all symbols through linker commands (eg.
--whole-archive
) - Add, only for the C++ API, a
register_operators
function that must be called in order to explicitly load the operators, and stop relying on the implicit behavior
As before my preference goes to 2 because it's simpler to implement and maintain, and it doesn't risk bloating the binary with unneeded symbols. However, option 1 is what torch already does (sadly).
Activity