Skip to content
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

Sync metadata with MLflow's model signature #285

Merged
merged 28 commits into from Sep 21, 2021

Conversation

adriangonz
Copy link
Contributor

@adriangonz adriangonz commented Aug 25, 2021

Fixes #164
Fixes #162

Changelog

  • Sync input and output metadata from MLflow's model signature
  • Add Base64 and Datetime codecs (to account for MLflow's binary and datetime types)
  • Refactor packing / unpacking code outside of StringCodec

Copy link
Member

@sakoush sakoush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

all minor comments really.

The only comment to double check is why to_metadata is not being used apart from tests?

mlserver/codecs/base64.py Show resolved Hide resolved
mlserver/codecs/base64.py Show resolved Hide resolved
mlserver/codecs/datetime.py Show resolved Hide resolved
if common_length == -1:
common_length = elem_length

if common_length != elem_length:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how restrictive is it that we cannot pass different length strings at this stage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot. That is partly a limitation of the v2 protocol (and / or gRPC and protobuf). Since we pass everything as a tensor, we only have a flattened list of elements and a shape. Thus, is not possible to have variable lengths.

Having said that I do think that, at the moment, it will accept variable inputs if you use JSON (the codec will also accept inputs looking like ["asd", "hello world", "etc"]). However, that won't work on the way back when we serialise the response.

runtimes/mlflow/mlserver_mlflow/metadata.py Outdated Show resolved Hide resolved
tests/codecs/test_base64.py Show resolved Hide resolved
tests/codecs/test_base64.py Outdated Show resolved Hide resolved
tests/codecs/test_datetime.py Show resolved Hide resolved
tests/codecs/test_datetime.py Show resolved Hide resolved
tests/codecs/test_datetime.py Show resolved Hide resolved
Copy link
Member

@sakoush sakoush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adriangonz adriangonz merged commit a284e93 into SeldonIO:master Sep 21, 2021
@adriangonz adriangonz deleted the sync-metadata branch September 21, 2021 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose MLflow's model signature as metadata Convert input types based on MLflow's model signature
2 participants