Skip to content

[FEATURE] Load from Slimmable Containers #701

Description

@heracurd

Is your feature request related to a problem? Please describe.
The current model loading does not appear to handle deserializing SlimmableContainer from JSON. This includes the standard A2 model format being shared by users and creators. I am currently experimenting with some ideas building on A2 models, and I would like to be able to load trained models back into a pytorch environment for evaluation, etc.

Describe the solution you'd like
I would like _from_nam.py to handle SlimmableContainer as it does other serialized model types. I created PR #693 that extended the types there with the A2/PackedWaveNet case, but @sdatkinson pointed out that the format is more flexible than that, i.e. is not bijective with PackedWaveNet. He suggested raising this issue instead.

Assuming the SlimmableContainer format is sufficiently self-describing, it seems reasonable for the comprehensive solution to aim for a more general deserialization approach, proceeding piecewise through the config. If SlimmableContainer could in principle contain further SlimmableContainer, recursion seems like a natural fit. Some adjustment of the interior parsing may be needed for the weights being placed other than at the top level.

Describe alternatives you've considered
One workaround to handle the A2/PackedWaveNet case would be to deserialize that config only in an initial patch, throwing an exception for an incompatible config.

Additional context
I am fairly easily able to workaround this issue by using code similar to #693 in my project. But not supporting round trips in the now widely-adopted A2 format seems like a gap that is worth filling.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority:lowLow-priority issuesunreadThis issue is new and hasn't been seen by the maintainers yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions