-
Notifications
You must be signed in to change notification settings - Fork 376
Description
We recently had experience with a model that has an implicit maximum size of a dynamic variable. Right now, if users exceed this size, the model crash. This user error results in users believing that the compiler is bad, when it is actually not the case.
I think we should have a way to add asserts in our model (with a friendly error message) that let us gracefully refuse bad input sizes.
If there is a way to express this in ONNX, great; If not, then I would suggest that we "augment" our current json input file of placement/quantization choices to include bounds on dynamic variable, including a min/max size and an error message. The input json file functionality could be expended to also include default compile options...
We should then have default on the adding of asserts that test these conditions; maybe we could also add checking of parameters that are supposed to be identical (e.g. the BS of all the inputs that have BS should match. And parameters that are constant match the actual size of the input parameters.
If this is seen as too expensive; then we could also have a new custom function that test the inputs, and have it called default in our python interface before a "run"... but maybe that is being too smart for our own good.