Skip to content

Fix issues in handling flexible numpy datatypes in TensorSpec#4147

Merged
arjundc-db merged 8 commits intomlflow:masterfrom
arjundc-db:new_test
Feb 26, 2021
Merged

Fix issues in handling flexible numpy datatypes in TensorSpec#4147
arjundc-db merged 8 commits intomlflow:masterfrom
arjundc-db:new_test

Conversation

@arjundc-db
Copy link
Copy Markdown
Contributor

@arjundc-db arjundc-db commented Feb 26, 2021

Signed-off-by: Arjun DCunha arjun.dcunha@databricks.com

What changes are proposed in this pull request?

The serialization and deserialization of flexible numpy data types was failing due to numpy adding the size dynamically to the dtype.
The PR strips the flexible numpy dtypes of all size based information before creating the tensorSpec.

How is this patch tested?

Unit tests.

Release Notes

Is this a user-facing change?

  • [ x] No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

(Details in 1-2 sentences. You can just refer to another PR with a description if this PR is part of a larger change.)

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • [x ] area/models: MLmodel format, model serialization/deserialization, flavors
  • area/projects: MLproject format, project running backends
  • area/scoring: Local serving, model deployment tools, spark UDFs
  • area/server-infra: MLflow server, JavaScript dev server
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, JavaScript, plotting
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

How should the PR be classified in the release notes? Choose one:

  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • [ x] rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
@arjundc-db arjundc-db changed the title Improve Fix issues in handling flexible numpy datatypes in TensorSpec Feb 26, 2021
@github-actions github-actions Bot added area/models MLmodel format, model serialization/deserialization, flavors rn/none List under Small Changes in Changelogs. labels Feb 26, 2021
Copy link
Copy Markdown
Contributor

@wentinghu wentinghu left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for working on this!!

Comment thread tests/types/test_schema.py
Comment thread tests/types/test_schema.py
Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Copy link
Copy Markdown
Contributor

@tomasatdatabricks tomasatdatabricks left a comment

Choose a reason for hiding this comment

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

Looks good, I left some comments.

In addition, we should also test that schema enforcement works for all types. I think it would make sense to extend your test_all_numpy_types tests to also call _enforce_tensor_schema. It's a bit unfortunate that it is defined in pyfunc. I think we can consider moving it down the line but for now I would just call it from this test.

Comment thread mlflow/types/utils.py Outdated
Comment thread mlflow/types/schema.py
Comment thread mlflow/types/schema.py Outdated
Comment thread mlflow/types/utils.py Outdated
Comment thread tests/types/test_schema.py
Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Copy link
Copy Markdown
Contributor

@tomasatdatabricks tomasatdatabricks left a comment

Choose a reason for hiding this comment

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

lgtm!

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
@arjundc-db arjundc-db merged commit d029e2c into mlflow:master Feb 26, 2021
harupy pushed a commit to harupy/mlflow that referenced this pull request Mar 1, 2021
…#4147)

* Improve

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Comments

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* LINT

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* indent

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Small improve

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Tomas comments

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* retrigger tets

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* PLease

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
harupy added a commit that referenced this pull request Mar 1, 2021
…#4151)

* Improve

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Comments

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* LINT

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* indent

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Small improve

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Tomas comments

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* retrigger tets

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* PLease

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>

Co-authored-by: Arjun DCunha <61438563+arjundc-db@users.noreply.github.com>
harupy pushed a commit to chauhang/mlflow that referenced this pull request Apr 8, 2021
…#4147)

* Improve

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Comments

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* LINT

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* indent

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Small improve

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Tomas comments

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* retrigger tets

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* PLease

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
harupy pushed a commit to wamartin-aml/mlflow that referenced this pull request Jun 7, 2021
…#4147)

* Improve

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Comments

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* LINT

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* indent

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Small improve

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* Tomas comments

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* retrigger tets

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>

* PLease

Signed-off-by: Arjun DCunha <arjun.dcunha@databricks.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/models MLmodel format, model serialization/deserialization, flavors rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants