Skip to content

Conversation

bhearsum
Copy link
Contributor

@bhearsum bhearsum commented Sep 5, 2025

This is a slightly updated version of #738 + #744, which were backed out a few weeks ago due to not working correctly on Windows. In a conversation I had today it was suggested that we should just not support multiprocess on Windows so we can at least take the win elsewhere. This patch does that, and surely no other issues will arise...

@bhearsum
Copy link
Contributor Author

bhearsum commented Sep 5, 2025

This still needs more testing in Gecko; I'm opening it as a draft for now to sanity check CI on the taskgraph side.

@bhearsum
Copy link
Contributor Author

bhearsum commented Sep 5, 2025

For posterity, I did try using a ThreadPoolExecutor as an alternative solution on Windows (which ought to have brought similar perf gains if using a free threaded Python). That seemed to run into concurrency issues that the multiprocess version didn't, so I didn't pursue it further. I don't think it's a bad idea to look at this again in the future, when we're already using free threaded python.

@bhearsum
Copy link
Contributor Author

bhearsum commented Sep 5, 2025

Looks like this "works" on Windows this time: https://treeherder.mozilla.org/jobs?repo=try&revision=7eb3590d144a7720e1b4f4714c6429f9eb258fdf (aka: it uses the old serial generation).

@bhearsum bhearsum marked this pull request as ready for review September 5, 2025 16:12
@bhearsum bhearsum requested a review from a team as a code owner September 5, 2025 16:12
@bhearsum bhearsum requested review from ahal and removed request for abhishekmadan30 September 8, 2025 13:03
Copy link
Contributor

@jcristau jcristau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc

bhearsum and others added 2 commits September 10, 2025 09:21
This is a cleaned up and slightly improved version of @ahal's original patch. Most notably, it uses `wait` to resubmit new kinds as soon as they become available (instead of waiting for all kinds in each round to be completed). This means that if a slow kind gets submitted before all other (non-downstream) kinds have been submitted, that it won't block them. In the case of Gecko, the effect of this is that the `test` kind begins to process very quickly, and all other kinds are finished processing before that has completed.

Locally, this took `./mach taskgraph tasks` from 1m26s to 1m9s (measured from command start to the final "Generated xxx tasks" message.

On try the results were a bit more mixed. The minimum time I observed without this patch was 140s, while the maximum was 291s (which seems to have been caused by bugbug slowness...which I'm willing to throw out). Outside of that outlier, the maximum was 146s and the mean was 143s. The minimum time I observed with this patch was 130s, while the maximum was 144s and the mean was 138s.

I presume the difference in results locally vs. Try is that locally I'm on a 64-core SSD machine, and the decision tasks run on lowered powered machines on Try, so there ends up being some resource contention (I/O, I suspect, because the ProcessPoolExecutor will only run one process per CPU core) when we process kinds in parallel there.

Despite this disappointing result on Try, this may still be worth taking, as `./mach taskgraph` runs twice in the critical path of many try pushes (once on a developer's machine, and again in the decision task).

raw data:
Over 5 runs on try I got, without this patch: 291s, 146s, 146s, 140s, 140s

In each of those, there were 241s, 92s, 94s, 90s, 90s between "Loading tasks for kind test" and "Generated xxxxxx tasks for kind test"

Which means we spent the following amount of time doing non-test kind things in the critical path: 50s, 54s, 52s, 50s, 50s

With this patch: 130s, 141s, and 144s, 140s, 135s

In each of those, there were 105s, 114s, 115s, 114s, 109s between "Loading tasks for kind test" and "Generated xxxxxx tasks for kind test"

Which means we spent the following amount of time doing non-test kind things, but it was almost entirely out of the critical path: 25s, 27s, 29s, 26s, 26s
@bhearsum bhearsum merged commit f561b87 into taskcluster:main Sep 10, 2025
15 of 17 checks passed
bhearsum added a commit to bhearsum/taskgraph that referenced this pull request Sep 11, 2025
…ocess kind generation

This was supposed to be done in taskcluster#765, but clearly I didn't push it before merging.
bhearsum added a commit to bhearsum/taskgraph that referenced this pull request Sep 11, 2025
…ocess kind generation

This was supposed to be done in taskcluster#765, but clearly I didn't push it before merging.
bhearsum added a commit that referenced this pull request Sep 11, 2025
…ocess kind generation (#773)

This was supposed to be done in #765, but clearly I didn't push it before merging.
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.

4 participants