-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Develop MVP of model bundle #3482
Comments
@CPBridge this is the current PR to expand model metadata. |
Hi @wyli @ericspod @rijobro @atbenmurray , I updated the ticket description to make it more clear. Thanks. |
We've discussed that the MVP should focus on the minimal structure, including model weights, basic environment/system info, maintaining changelog/versioning, how to ensure accessibility for both human and machine. |
Hi @wyli , Sure, I added these items to the MVP task list. Thanks. |
@MMelQin @gigony @GreySeaWolf @CPBridge @mocsharp @joshliberty @vikashg thoughts on proposed MVP? |
We should discuss a clear definition of requirements and objectives. We want to define a format of a single file or multiples files which contains the model weights at least with secondary information describing how to use it for various use cases. This will allow a human or a program to determine what sort of model it is, how to use the model, and what tasks to use it for. For our MVP we want to consider the starting position of what the model weight storage and metadata storage would look like and if it would achieve that objective to some degree. The base level set of requirements I would suggest are:
One use case for this information is a human user looking into how the model is used in a particular task. They would want a clear idea of what inputs are expected and what the outputs mean. Whatever format this information is can be either easily read by a human or easily converted into a convenient format using included tools. A second use case is a deployment environment which automatically constructs whatever infrastructure is needed around a model to present it through a standard interface. This would require generating transform sequences automatically to pre- and post-process data, and load the model through some script defining the workflow. This would used by MONAI Deploy to automatically generate a MAP from the package, or another script automatically create a Docker image to serve the model as a command line tool or through Flask, or another script to interface with existing hosting services to upload the model and whatever other information is needed. |
Hi @ericspod , Thanks very much for your detailed description. Thanks. |
I'd strongly recommend that the MVP should support the essential features for fast prototyping of model packages. The following uses the popular
These are mainly to ensure a good flexibility and extensibility of the packaging. |
Hi @wyli , Thanks for your great suggestions. Thanks. |
Hi @wyli @ericspod @atbenmurray @rijobro , I tried to prepare a draft model package structure for the first step of this ticket in the tutorial PR. Thanks in advance. |
for the record, we could consider this cache dataset config vs content Integrity issue #999. |
We'll certainly want to check the format of specific fields in the json data so that they correctly adhere to a standard way of describing transforms and inference so that code can be generated from them. With the other data that can be added it would be preferrable that this can be as free-form as people like, so I would expect standardized elements in the metadat adhering to our format mixed in with ones that are application-specific in any format. |
@ericspod sounds good to me! We can do that when we finalized the first MVP MMAR example. Thanks. |
As for the machine consumer of the model package, specifically TrochScript, we do have a specific one, Triton Inference Server. Triton can automatically generate runtime config for all the backends it supports, except PyTorch. Triton team had logged an issue for PyTorch, though based on the discussions we've already had here, the requested metadata are covered in the MONAI model package. Here is the PyTorch issue 38273, |
For deployment of AI apps/models in clinical environment, there are a number of persona and user stories.
|
Another related PR relating to the configuration parsing: #3822. Thanks. |
Related PR for common training, evaluation and inference: #3832 . Thanks. |
As we are still developing the
I think we can try to support 3 with enhanced idea: use the "@" mark to define a placeholder, then parser gives the value. For other features we may consider later. Thanks. |
I think #3822 is now intuitive and flexible after a few rounds of refactoring. We may want to provide a system-wide flag to optionally disable |
I put all the links of related PRs to the task steps in the above ticket description. Thanks. |
Related PR for inference example bundle: Project-MONAI/tutorials#604. Thanks. |
follow-up from the dev meeting:
|
Revising this tutorial to use our bundle would be a good exemplar: https://github.com/Project-MONAI/tutorials/blob/e3eea8704f5d002002f79cffec112c5c280476b4/modules/transfer_mmar.ipynb |
After sharing with the internal NVIDIA Clara team, I put 2 missing features in the task feature.
Thanks. |
Feedback from MONAI deploy team:
Welcome more testing and feedback later. Thanks. |
Most of the tasks are completed, I created several new tickets to track the left items, and let's close this big first ticket now. Thanks. |
Is your feature request related to a problem? Please describe.
Thanks for the interesting technical discussion with @ericspod @wyli @atbenmurray @rijobro , as we still have many unclear requirements and unknown use cases, we plan to develop the model package feature step by step, May adjust the design based on feedback during the development.
For the initial step, the core team aligned to develop a small but typical example for
inference
first, it will use JSON config files to define environments, components and workflow, save the config and model into TorchScript model. then other projects can easily reconstruct the exact same python program and parameters to reproduce the inference. When the small MVP is ready, will share and discuss within the team for the next steps.I will try to implement the MVP referring to some existing solutions, like NVIDIA Clara MMAR, ignite online package, etc. Basic task steps:
name
/path
&args
. PR: 3482 AddConfigComponent
for config parsing #3720{"dataset": {"<name>": "Dataset", "<args>": {"data": "$load_datalist()"}}, "dataloader": {"<name>": "DataLoader", "<args>": {"data": "@dataset"}}}
. PR: 3482 Add ReferenceResolver to manage config items #3818, 3482 3829 AddConfigParser
to recursively parse config content #3822metadata
#3865metadata
).run
API for common training, evaluation and inference #3832huggingface
(Pretrained Models #3451)."test": "@###data#1"
, 1#
means current level, 2##
means upper level, etc. PR: 3482 Add support for relative IDs in the config content #3974ConfigItem
andReferenceResolver
in theConfigParser
. PR: 3482 Add support for customized ConfigItem and resolver #3980_requires_
keyword for config component (adds a_requires_
key forConfigComponent
#3942).The text was updated successfully, but these errors were encountered: