Repository navigation
Description
Bug Report
Description
I added a couple of experiments with different parameters to queue. I wanted to run them sequentially with dvc exp run --run-all but I got some unexpected results:
-
I realize
dvc checkoutis runned automatically for each experiment. I think this is bad since I have to wait all my images and annotations were "checkout" once per experiment. I did not know why this was happening until I read this line in the source code:
https://github.com/iterative/dvc/blob/master/dvc/command/experiments.py#L1293
That implies--tempmeans that "each exp is runned in a separate temporary directory instead of your workspace". I guess this is related with parallelizing different runs... but I consider it should be possible to avoid it since it does not scale with large datasets. -
The error I am pointing in the issue name
python: can't open file 'src/train.py'is appearing because of--tempparameters that forces to commit in both dvc and git thesrc/train.pyso file is present later in the tmp copy (this is only my current belief, I could not confirm this yet) Everything works fine withdvc repro.
Reproduce
- dvc init
- import and add dataset
- create
src/train.pyscript - dvc exp run --queue
- dvc exp run --queue -S optimizer.lr=0.1
- dvc exp run --run-all
Expected
I expected that my experiment runned in sequential order without duplicating my data in another tmp directory.
Environment information
Output of dvc doctor:
$ dvc doctor
DVC version: 2.5.4 (conda)
---------------------------------
Platform: Python 3.8.10 on Linux-4.15.0-96-generic-x86_64-with-glibc2.10
Supports:
gdrive (pydrive2 = 1.9.1),
http (requests = 2.26.0),
https (requests = 2.26.0)
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/sdb1
Caches: local
Remotes: None
Workspace directory: ext4 on /dev/sdb1
Repo: dvc, gitAdditional Information (if any):
$ dvc exp show
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
┃ Experiment ┃ Created ┃ test_split.split ┃ optimizer.lr ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
│ workspace │ - │ - │ - │
│ main │ Aug 19, 2021 │ - │ - │
│ ├── *098b5bc │ 01:07 PM │ 0.1 │ 0.1 │
│ └── *6980253 │ 01:06 PM │ - │ - │
└──────────────┴──────────────┴──────────────────┴──────────────┘
Activity
pmrowla commentedon Aug 23, 2021
This is expected behavior since
src/train.pyis not tracked by git - from theexp rundocs (https://dvc.org/doc/command-reference/exp/run#queueing-and-parallel-execution):As you noted, the
--queue/--run-allfunctionality is limited right now, and only supports running experiments in their own separate tempdir workspaces. This this behavior is also documented:To run an experiment in your main repo working directory, currently you cannot use the
--queue/--run-allfunctionality. But if you just doit will run in your workspace the same way as
dvc repro(and it will work properly even with an untrackedsrc/train.pyfile).pmrowla commentedon Aug 23, 2021
Regarding:
This can be mitigated depending on the link type you have configured for your cache. It sounds like DVC is copying files on
checkoutin your configuration which, as you noted, will be slow. But if you are able to configure DVC to use reflinks/symlinks/hardlinks (depending on your environment), the checkout step would be much faster, and is recommended when you are working with large datasets (see: https://dvc.org/doc/user-guide/large-dataset-optimization#file-link-types-for-the-dvc-cache)pmrowla commentedon Aug 23, 2021
Closing this as expected behavior
mmeendez8 commentedon Aug 24, 2021
Hi @pmrowla, sorry but I have been playing with dvc exp trying to understand what is going on and I cannot figure out what is happening.
Following your suggestion I have done the following:
Note those large differences in time are due to that "computing file/dir hashes" step. Furthermore, if I once again run
dvc exp run, even thoughComputing file/dir hashes (only done once)clearly says this is only done once, dvc is again hashing my files so it spends a large time before actually running my task.I might be missing something but I really cannot understand what is going on here and I would appretiate any orientation with this. Thanks!
pmrowla commentedon Aug 25, 2021
It's hard to tell what's going on just from that. I wouldn't expect DVC to be recomputing hashes on
exp runin this case, so it's possible there's a separate bug/issue there, but without more information I can't really say what might be causing it.If you just run
dvc checkoutin your usual workspace, what happens?mmeendez8 commentedon Aug 25, 2021
dvc checkoutneeds one second to finish.If I run
dvc exp runaftewards, it agains shows:This cloning step and the hashing that happens inmediately after it seems to contradict what you said before:
daavoo commentedon Aug 25, 2021
This might be related: #6490
mmeendez8 commentedon Aug 25, 2021
Oh, yes that might be definetely related. I forgot to mention that I used
dvc importfor attaching my data. I didn't think it was relevant 🙃