Skip to content

repro: parallel execution of stages#10922

Closed
sjawhar wants to merge 1 commit into
treeverse:mainfrom
sjawhar:feature/parallel-repro
Closed

repro: parallel execution of stages#10922
sjawhar wants to merge 1 commit into
treeverse:mainfrom
sjawhar:feature/parallel-repro

Conversation

@sjawhar

@sjawhar sjawhar commented Dec 7, 2025

Copy link
Copy Markdown
Contributor

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

TODO

  • Tests
  • Add --jobs argument to CLI

OTHER THOUGHTS

Obviously, when adding a feature like parallel execution, one of the first objections will be something like "but what if two stages can't run in parallel?". The quick answer is: then don't run in parallel!

But I think it would also be pretty easy to accommodate this in a fairly generic way. For example:

stages:
  foo:
    cmd: python blah.py
    mutex: [foobar]
    # other stage properties

  bar:
    cmd: python other_thing.py
    mutex: [foobar, also_another_one]

Probably self-explanatory, but the idea behind this is:

  • No two stages that belong to the same mutex group should be run concurrently
  • A stage can belong to arbitrarily many mutex groups
  • You can call the mutex groups whatever you want, so that they make sense to you

I'd be happy to contribute a follow-up PR with the mutex feature, if you like the idea

@github-project-automation github-project-automation Bot moved this to Backlog in DVC Dec 7, 2025
@codecov

codecov Bot commented Dec 7, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.90210% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.99%. Comparing base (2431ec6) to head (3a821ca).
⚠️ Report is 192 commits behind head on main.

Files with missing lines Patch % Lines
dvc/repo/reproduce.py 95.89% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10922      +/-   ##
==========================================
+ Coverage   90.68%   90.99%   +0.31%     
==========================================
  Files         504      505       +1     
  Lines       39795    41112    +1317     
  Branches     3141     3255     +114     
==========================================
+ Hits        36087    37410    +1323     
- Misses       3042     3064      +22     
+ Partials      666      638      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sjawhar sjawhar force-pushed the feature/parallel-repro branch 8 times, most recently from ed33d83 to 10383e1 Compare December 14, 2025 02:28
@sjawhar sjawhar force-pushed the feature/parallel-repro branch from 10383e1 to 312753e Compare December 25, 2025 10:00
@sjawhar sjawhar force-pushed the feature/parallel-repro branch from 312753e to 37398ea Compare January 2, 2026 03:21
@sjawhar sjawhar force-pushed the feature/parallel-repro branch from 37398ea to 3a821ca Compare January 3, 2026 00:35
@sjawhar

sjawhar commented Jan 3, 2026

Copy link
Copy Markdown
Contributor Author

I think there are some flaky tests :(

@sjawhar sjawhar closed this Feb 8, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in DVC Feb 8, 2026
@sjawhar sjawhar deleted the feature/parallel-repro branch February 8, 2026 21:55
@startibartfast

Copy link
Copy Markdown

Looking at the code I noticed that you're using the ThreadPoolExecutor which implements async-based parallelism. This is certainly good for I/O bound tasks but, according to our experience, DVC stages are mainly dealing with CPU bound tasks.
We have built a framework to support our MLOps processes which is designed around the standard DVC package. This framework, among other features, implements parallelism based on multiprocessing to overcome the limitations introduced by Python's GIL (see here for some more infos about our approach https://www.linkedin.com/pulse/rateracer-smarter-pipelines-faster-pricing-carlo-ieva-phd-cfcje/?trackingId=3%2F5ij4ihQemsx3O1EDJ%2B5w%3D%3D).

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.

2 participants