Skip to content

Whitelisting columns#38

Open
rom1504 wants to merge 1 commit into
criteo-masterfrom
whitelisting_columns
Open

Whitelisting columns#38
rom1504 wants to merge 1 commit into
criteo-masterfrom
whitelisting_columns

Conversation

@rom1504

@rom1504 rom1504 commented Nov 13, 2019

Copy link
Copy Markdown

What changes are proposed in this pull request?

Introduce new whitelisting feature for tags, params and metrics in search_runs

This feature makes it possible to keep only some of the tags,
params and metrics in search_runs.

This is useful particularly in case of retrieving many runs but only few columns.

This commit is mostly split in 2 parts :

  1. Adding tags_whitelist, metrics_whitelist, params_whitelist to the API as a non-breaking change : they default to None which mean keep all fields
  2. Actually implement it in stores and in particular the sqlalchemy store

The second part is a bit subtle because the subquery loading strategy used in mlflow sqlalchemy store does not support filtering.
As a consequence I reimplemented a "disjoint_load" function that
is a simple implementation of subquery loading, adding the filtering functionality. I added many comments in it to explain how it works.
An additional change is removing the unneeded distinct in search_runs to avoid from_self from
propagating the column from ordering to the main fields of the main select. (it's not required to put fields from order by in select if the distinct keyword is not used h
ttps://dba.stackexchange.com/a/34970)

This change makes it possible to decrease the search_run time from 30s to 2s for an experiment with many runs (7000) and keeping only a few columns.

How is this patch tested?

  • adapted the existing tests
  • added tests in sql alchemy store tests and file store tests to test the whitelisting

Release Notes

Is this a user-facing change?

  • 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.

Add tags_whitelist params_whitelist metrics_whitelist optional options in search_runs.

What component(s) does this PR affect?

  • UI
  • CLI
  • API
  • REST-API
  • Examples
  • Docs
  • Tracking
  • Projects
  • Artifacts
  • Models
  • Scoring
  • Serving
  • R
  • Java
  • Python

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
  • 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

@rom1504
rom1504 force-pushed the whitelisting_columns branch 2 times, most recently from 92e0801 to 2894041 Compare November 13, 2019 12:08
Comment thread mlflow/store/tracking/abstract_store.py Outdated
@rom1504
rom1504 force-pushed the whitelisting_columns branch 2 times, most recently from 4db0d65 to c23f511 Compare November 15, 2019 16:07
@codecov-io

codecov-io commented Nov 15, 2019

Copy link
Copy Markdown

Codecov Report

Merging #38 into criteo-master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##           criteo-master      #38   +/-   ##
==============================================
  Coverage          83.46%   83.46%           
==============================================
  Files                 20       20           
  Lines               1010     1010           
==============================================
  Hits                 843      843           
  Misses               167      167

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26510a6...66e3ea1. Read the comment docs.

@rom1504
rom1504 force-pushed the whitelisting_columns branch 3 times, most recently from f47e982 to e489909 Compare November 15, 2019 17:58
@rom1504
rom1504 requested review from jdlesage and vguerra November 15, 2019 22:21
…arch_runs

This feature makes it possible to keep only some of the tags,
params and metrics in search_runs.

This is useful particularly in case of retrieving many runs but only few columns.

This commit is mostly split in 2 parts :
1. Adding whitelist_tags, whitelist_metrics, whitelist_params to the API as a non-breaking change : they default to None which mean keep all fields
2. Actually implement it in stores and in particular the sqlalchemy store

The second part is a bit subtle because the subquery loading strategy used in mlflow sqlalchemy store does not support filtering.
As a consequence I reimplemented a "disjoint_load" function that
is a simple implementation of subquery loading, adding the filtering functionality. I added many comments in it to explain how it works.

This change makes it possible to decrease the search_run time from 30s to 2s for an experiment with many runs (7000) and keeping only a few columns.
@rom1504
rom1504 force-pushed the whitelisting_columns branch from e489909 to 66e3ea1 Compare November 18, 2019 13:28
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.

3 participants