-
Notifications
You must be signed in to change notification settings - Fork 1.3k
exp: refactor show behavior #9170
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
Conversation
|
The rows marked |
|
The new json format currently looks like: [
{
"rev":"workspace",
"name":null,
"data":{
"rev":"workspace",
"timestamp":null,
"params":{
"params.yaml":{
"data":{
"prepare":{
"split":0.2,
"seed":20170428
},
"featurize":{
"max_features":400,
"ngrams":2
},
"train":{
"seed":20170428,
"n_est":50,
"min_split":0.01
}
}
}
},
"metrics":{...},
"deps":{...},
"outs":{...}
},
"error":null,
"children":null
},
{
"rev":"079882fbd3281bd26983fb5768db5d4628e3a34b",
"name":"main",
"data":{
"rev":"079882fbd3281bd26983fb5768db5d4628e3a34b",
"timestamp":"2023-02-20T13:36:53",
"params":{...},
"metrics":{...},
"deps":{...},
"outs":{...},
"error":null,
"children":[
{
"revs":[
{
"rev":"e8f17cec96b03357fbb87af553c335009019a7e8",
"name":"swish-purl",
"data":{
"rev":"e8f17cec96b03357fbb87af553c335009019a7e8",
"timestamp":"2023-03-14T19:32:22",
"params":{...},
"metrics":{...},
"deps":{...},
"outs":{...},
"error":null,
"children":null
}
],
"executor":null,
"name":"swish-purl"
},
...
]
}
]There are two basic dict structures here, and the entire table/mapping of baseline+exp revs can is represented by nesting them: ExpState (git commit state) If we add plots support for vscode, we would probably want to add something like ExpRange (ordered range of git (or exp) commits that should be grouped together) For regular dvc experiments, Example executor states:
"executor":{"state":"failed"}
"executor":{
"state":"queued",
"name":null,
"local":null
}
"executor":{
"state":"running",
"name":"dvc-task",
"local":{
"root":"/Users/pmrowla/git/example-get-started/.dvc/tmp/exps/tmpp07ed2zm",
"log":"/Users/pmrowla/git/example-get-started/.dvc/tmp/exps/run/4a75a0bf....out",
"pid":2036,
"returncode":null
}
}For our current purposes, DVC experiments won't ever have @mattseddon I think this covers everything vscode currently consumes (aside from plots), but I'm not really tied to this data schema so feel free to suggest/request any changes |
855806c to
abd2d42
Compare
|
For testing purposes, the current PR should handle all of the current CLI use cases except for the |
|
One other thing to note is that with this PR git fetch for running experiments is disabled by default now (so what used to be (This does mean that vscode filewatcher will have to watch |
I think we previously showed the task id here, which I think is the sha of the queued changes? Is that still what we show for failed experiments? If so, can we keep that like |
Yeah we can do this, but I wasn't sure if we wanted some better way of indicating that a row was live/current and not a commit. The task ID is technically the SHA for the queued experiment stash commit. For failed experiments it makes sense to display that SHA, since it also allows the user to see the params/deps settings from that queued stash commit (so they can determine if the params/deps were related to why it failed) But in the live/running case we'd be displaying the active (tempdir) workspace state and not the queued state, but also still displaying the same label as the queued state |
abd2d42 to
216a876
Compare
|
I went through the points that I listed in #8478 (comment) and tried to group bullet points with things that were mentioned above.
How will we determine that a non-checkpoint experiment with a logger attached (e.g If yes will there be some associated UI changes? Or will this information still be in the
Is
How difficult would it be to add in a
Is it possible to get this from the data if
Could display Would there be any reason to include the original task_id in the data? [N] One thing that jumped out just from looking at the data is that rev is duplicated under the data key: "rev":"079882fbd3281bd26983fb5768db5d4628e3a34b",
"name":"main",
"data":{
"rev":"079882fbd3281bd26983fb5768db5d4628e3a34b",
|
Yes, I dropped the use of |
We could do this but display name in the CLI is just (Honestly I don't think vscode should even feel tied to this display format, given that you have more UI space and could always display both revs and names if you wanted) |
It's not possible right now, but we could add fields in Maybe something like {"data": {"meta": {"has_checkpoints": true}}} |
If you think it could be useful in vscode I can add this to the |
This is intentional for now as it is useful for how things are organized and cached internally in DVC, but for vscode's purposes the outer |
This is all good stuff, means I can drop a lot of replicated logic from the extension (especially code relating to adding ππ» Thanks for explaining. I'll update our UI as well. [Q] (only partially related). Now that we are collecting data from temporary directories. Is there much of a reason to provide the option to run experiments in the workspace? Should
ππ»
This would be very useful.
Sounds good. |
|
My primary focus right now is making sure that I can integrate #9146. That should only take a couple of days. After that, I'll be able to work on consuming this new format and making the appropriate updates. That work will give me a lot more insights on the shape of the API. Mentioning this because it would be good to coordinate releasing this ππ». |
There's certain repo/pipeline setups where tempdir runs don't work, mostly due to users relying on relative paths to files that aren't tracked by git or DVC and aren't actually listed as pipeline dependencies, so keeping workspace support is probably still required. |
fe2ab13 to
9a8499b
Compare
|
Re: plots, @skshetry do you think collecting live plots for queued experiments should be part of this or should we do it some other way? Should @daavoo If we expose this as an API, could we use it in get started to analyze the completed experiments in the notebook? |
Regarding resuming experiments. In the extension we use With the dropping of the two fields will the entry for Asking because it would be great to drop the continuation logic in treeverse/vscode-dvc#3466. |
Yes, after the changes the resumed experiment now just contains the duplicated revisions. So each exp can be handled separately, you don't have to worry about the continuation stuff. In the CLI it looks like: (where |
9a8499b to
ab5cb4e
Compare
@dberenbaum, is there anything more to live plots than Since it is part of experiments, it feels like it should be part of |
I think that pretty much covers it, except that it is needed for multiple queued experiments at once. I don't think there's any strong product reason to prefer one implementation over another here since I doubt users will bother monitoring live plots from the CLI. |
|
I think the executor typing should be something like type Executor =
| {
state: 'queued'
name: null
local: null
}
| {
state: 'running' | 'failed' | 'success'
name: 'dvc-task' | 'workspace' | null
local: {
root: string
log: string
task_id: string
pid: number
returncode: null
} | null
}
| null // assume success for nullWhether or not Other than that the types look correct. You can double check things against typed DVC dataclasses as well: https://github.com/pmrowla/dvc/blob/exp-live-metrics/dvc/repo/experiments/serialize.py |
|
That's definitely a bug, I'll look into it today |
1d056d7 to
f2f6aaf
Compare
|
@mattseddon I can't reproduce that state w/this PR rebased against the latest DVC main |
|
@pmrowla I'm unable to call |
It happens because there is no experiment commit generated yet (and no experiment ref with that name). Is there a reason you need to pass the actual name? Just doing |
When an experiment starts running in the workspace we auto-select it for plotting. We had logic for checkpoint experiments that would select the workspace under that condition. I was hoping to remove/simplify that logic but we can keep it as a workaround. All that means we end up with this behaviour: Screen.Recording.2023-04-19.at.3.49.04.pm.mov |
|
We should be ready to accept these changes on the VS Code side tomorrow. Can we schedule a release soon? ππ» |
|
@mattseddon I just need to update some tests in this PR and then we can merge/release on the DVC side, should be able to push a release out tomorrow |
|
Found an edge case where running an experiment in the workspace along with the queue stops the record in the workspace from being shown until the queue finishes processing: Screen.Recording.2023-04-20.at.8.42.50.am.mov
Not a blocker for me but others may disagree. LMK if you want me to raise a separate issue to track ππ». Edit: I did also confirm this happens via CLI only. |
f2f6aaf to
c9d358c
Compare
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.
The removed tests here are all duplicated tests/func/experiments/test_show or no longer needed.
The output format specific CLI unit tests are no longer needed, since all of the output is now generated as a standard rich table and then converted to csv/md using rich. So what we need to test in DVC is that the correct flags to generate the expected table are passed into experiments.show from the CLI, and that we generate the table data correctly (and not that rich knows how to output properly formatted markdown)
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.
This was tests for functions that no longer exist after the standardized collection/data structure changes
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #9170 +/- ##
==========================================
- Coverage 92.94% 92.66% -0.29%
==========================================
Files 461 461
Lines 37317 37199 -118
Branches 5372 5370 -2
==========================================
- Hits 34685 34470 -215
- Misses 2097 2187 +90
- Partials 535 542 +7
... and 3 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. β View full report in Codecov by Sentry. |
- Updates 'dvc exp show --json' to use new data format
c9d358c to
8ff6290
Compare
This will be fixed in the release (issue was replacing the list of workspace runs with the list of queue runs instead of concatenating the two lists together) |
|
This is released in DVC |




β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. π
Closes #8478
Closes #9348