-
Notifications
You must be signed in to change notification settings - Fork 157
Add framework fallback ability to execute in sparseml #413
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch on this necessary functionality. I'm a little worried about how coupled the attempt_num logic is in detect_framework with the execute function. Is there a specific reason for doing it this way? Any thoughts on having a detect function that returns all possible frameworks for an item, and then having execute return the first valid in-framework run of the function between the possible frameworks?
The original reason why I went this route is that I'm worried about performance for evaluating of a model. Evaluation of model could involve full loading of the model to check if it is tensorflow or keras for example. It is a very fair point that this pathway reduces readability and adds complexity. This is additionally a preoptimization for a performance use case we haven't hit yet, so I'll migrate the code over to return a list of frameworks instead of this more complicated pathway for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. If we see performance issues when trying to load large models in the wrong framework, let's definitely update the detect_frameworks function to use what you had before, or maybe a generator if that would work
* Add framework fallback ability to execute in sparseml * remove unused variable * decrease complexity of falling back on framework execution * quality and test fixes * update docs * fix tests
No description provided.