-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Added diff-view switch #4862
Added diff-view switch #4862
Conversation
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Thanks for the PR, it looks great! Can we keep the source column to make it easier to jump to notebook/scripts? diff-columns.movScritp to generate test data:import mlflow
import random
def random_float():
return random.random()
def random_string():
return random.choice(["a", "b", "c"])
for _ in range(100):
with mlflow.start_run():
mlflow.log_param("p1", 0)
mlflow.log_param("p2", random_string())
mlflow.log_metric("m1", 0)
mlflow.log_metric("m2", random_float())
mlflow.set_tag("t1", 0)
mlflow.set_tag("t2", random_string())
|
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Removed the source column from the diff view (it will be always visible unless unchecked by the user). Also moved the |
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
@dbczumar sounds good, looking forward to the design mock! |
Hi @marijncv , apologies for the delay. Here is the mock: Please ignore the slightly different UI styling used in our mockup tools. For consistency with the rest of the MLflow UI, we can keep using the existing toggle element from your PR. The only practical differences are the text next to the toggle and the text displayed on hover. |
mlflow/server/js/src/experiment-tracking/components/ExperimentViewUtil.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Thanks for the design @dbczumar! I've updated the PR accordingly |
@marijncv Thanks for the updates! @dbczumar @jinzhang21 It looks like this now: diff-column-view.mov
|
I found a bug that's related to column selection: column-selection-bug.movIn this video, I did the following
|
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
@harupy thanks for pointing out the bug! I think it's fixed with my latest commit. But I'm curious about a difference I see in your video and the code on my machine. For me the position of the column changes to the end of the list when I check/uncheck it, but for you that seems to not be the case (it just returns back to it's old position). Do you have any idea why that could be the case? |
@marijncv Thanks for the quick fix! Can you take a screen recording of what happens on your machine and share it with us? |
mlflow.mp4In the video I use the switch, then select username, it shows up but at the end of the list of columns instead of in it's original position |
@marijncv Thanks for the video. Let me pull the latest commit and try again. |
column-select-2.movOn my machine, the column shows up in the right position. |
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
mlflow/server/js/src/experiment-tracking/components/ExperimentView.js
Outdated
Show resolved
Hide resolved
…View.js correct comment Co-authored-by: Harutaka Kawamura <hkawamura0130@gmail.com> Signed-off-by: Marijn Valk <marijncv@hotmail.com>
ff6c922
to
701af4a
Compare
mlflow/server/js/src/experiment-tracking/components/ExperimentViewUtil.js
Outdated
Show resolved
Hide resolved
mlflow/server/js/src/experiment-tracking/components/ExperimentViewUtil.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
mlflow/server/js/src/experiment-tracking/components/ExperimentViewUtil.js
Outdated
Show resolved
Hide resolved
mlflow/server/js/src/experiment-tracking/components/ExperimentViewUtil.js
Outdated
Show resolved
Hide resolved
mlflow/server/js/src/experiment-tracking/components/ExperimentView.test.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
Hey @marijncv, thanks for patiently applying our feedback! bug-2.movWe found another bug. Here are the steps to reproduce the issue.
The Code to populate dataimport mlflow
import random
def random_float():
return random.random()
def random_string():
return random.choice(["a", "b", "c"])
for _ in range(100):
with mlflow.start_run():
mlflow.log_param("p3", random_float())
mlflow.log_metric("m3", random_float())
mlflow.set_tag("t3", random_float())
for _ in range(100):
with mlflow.start_run():
mlflow.log_param("p1", 0)
mlflow.log_param("p2", random_float())
mlflow.log_metric("m1", 0)
mlflow.log_metric("m2", random_float())
mlflow.set_tag("t1", 0)
mlflow.set_tag("t2", random_float()) |
[COLUMN_TYPES.ATTRIBUTES]: _.concat( | ||
categorizedUncheckedKeys[COLUMN_TYPES.ATTRIBUTES], | ||
attributeKeyList.filter((v, index) => { | ||
return allEqual(attributes[index]); | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to hide attribute columns only when they are empty?
Here's an example:
a1 | a2 | a3 |
---|---|---|
- | - | 1 |
- | 1 | 1 |
- | 1 | 1 |
For the table above, the diff switch should hide the a1
column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's possible. With that addition, should I also add the Models attribute to be considered to be removed if all values are empty? Right now only Run Name, User and Version are considered.
Version and User will never be empty so they can probably be left out of consideration all together. But on the other hand I can still image that the user would like to hide these columns if they contain the same value for each row.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I also add the Models attribute to be considered to be removed if all values are empty?
Yes!
Version and User will never be empty so they can probably be left out of consideration all together.
User and Source, right? Version can be empty (e.g. run mlflow code in a non-git directory). Makes sense to exclude them from consideration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But on the other hand I can still image that the user would like to hide these columns if they contain the same value for each row.
I do understand that some users prefer to hide constant attribute columns to obtain more space for param, metric, and tag columns. On the other hand, the version, user, and run-name columns seem useful even if they are constant.
- user: tells us who creates the displayed runs
- version: tells us the code that creates the displayed runs
- run-name: ??? (I couldn't come up with a useful use case)
We could argue you can show attribute columns after turning on the diff switch
though.
@dbczumar Any thoughts on this?
No worries, it's a great learning experience :). Will look into this today. Edit: it should be addressed by 9990804 |
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
* Obtain the categorized columns for which the values in them | ||
* have only a single value (or are undefined) | ||
*/ | ||
static getCategorizedUncheckedKeysDiffView({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw I'm considering how we can improve/simplify this function. Here's my attempt:
Commit: harupy@6f61045
Branch: https://github.com/harupy/mlflow/tree/improve-diff-column-search
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! We could even add a short-circuit in the loop over runInfos if we find there are no longer any columns to consider.
And then for attributes we can add a dropNonEmptyColumns function and incorporate it in the same loop over runInfos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied your proposal and integrated the points I mentioned above. I'm doubting whether the toAttributesMap
method should be made more generic (i.e. include all attributes). Also, maybe the comments in dropNonEmptyColumns
might be a bit overkill since it's so similar to dropDiffColumns
.
Signed-off-by: Marijn Valk <marijncv@hotmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @marijncv !
@marijncv I found several unrelated CI checks failed. We can just ignore them in this PR. |
const dropNonEmptyColumns = (columns, prevRow, currRow) => { | ||
// # What each argument represents: | ||
// | a | b | c | d | e | <- columns | ||
// | --- | --- | --- | --- | --- | | ||
// | - | 1 | - | 1 | 1 | <- prevRow | ||
// | - | - | 1 | 1 | 2 | <- currRow | ||
// | ? | ? | ? | ? | ? | | ||
|
||
// a: may be an empty column, we need to take a look at the next row | ||
// b: is not an empty column, we don't need to take a look at the next row | ||
// c: is not an empty column | ||
// d: is not an empty column | ||
// e: is not an empty column | ||
|
||
return columns.filter((col) => { | ||
const prevValue = prevRow[col]; | ||
const currValue = currRow[col]; | ||
if ((!prevValue && !currValue) || (!currValue.length && !currValue.length)) { | ||
// Case a | ||
return true; | ||
} else { | ||
// Case b, c, d & e | ||
return false; | ||
} | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For detecting empty attribute columns, I don't think we need to compare the previous and current rows. We can just take a look at the current row.
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
@marijncv I pushed a commit to fix a couple of minior issues. |
mlflow/server/js/src/experiment-tracking/components/ExperimentViewUtil.js
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for the contribution!
Signed-off-by: Marijn Valk marijncv@hotmail.com
What changes are proposed in this pull request?
Added a checkbox for switching between diff-only view and regular view. closes #4819
How is this patch tested?
Create a couple of runs with params, metrics and tag of which some are different accross runs and some which are the same across runs. Mark/unmark the checkbox and see the columns disappear for which the value across all the runs is the same
Release Notes
Is this a user-facing change?
Added a checkbox that will filter out all columns for which every run has the same value
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/artifacts
: Artifact stores and artifact loggingarea/build
: Build and test infrastructure for MLflowarea/docs
: MLflow documentation pagesarea/examples
: Example codearea/model-registry
: Model Registry service, APIs, and the fluent client calls for Model Registryarea/models
: MLmodel format, model serialization/deserialization, flavorsarea/projects
: MLproject format, project running backendsarea/scoring
: MLflow Model server, model deployment tools, Spark UDFsarea/server-infra
: MLflow Tracking server backendarea/tracking
: Tracking Service, tracking client APIs, autologgingInterface
area/uiux
: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/docker
: Docker use across MLflow's components, such as MLflow Projects and MLflow Modelsarea/sqlalchemy
: Use of SQLAlchemy in the Tracking Service or Model Registryarea/windows
: Windows supportLanguage
language/r
: R APIs and clientslanguage/java
: Java APIs and clientslanguage/new
: Proposals for new client languagesIntegrations
integrations/azure
: Azure and Azure ML integrationsintegrations/sagemaker
: SageMaker integrationsintegrations/databricks
: Databricks integrationsHow should the PR be classified in the release notes? Choose one:
rn/breaking-change
- The PR will be mentioned in the "Breaking Changes" sectionrn/none
- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/feature
- A new user-facing feature worth mentioning in the release notesrn/bug-fix
- A user-facing bug fix worth mentioning in the release notesrn/documentation
- A user-facing documentation change worth mentioning in the release notes