-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Consider removing DexBuilder's entry from actions with default strategies for better cache hit ratio #7447
Comments
Side question: it seems like this would apply to all defaulted-to-worker
mnemonics, not just DexBuilder?
Certainly seems fine to remove the default config entirely, but it seems
unfortunate to do that (especially if it's done for all supported workers,
see question above), since that degrades the "default" experience or
requires users to set boilerplate flags. Instead it seems what you want
here is to disable workers with --config=remote? Maybe another approach
could be to take out the default but create a new config (e.g.,
--config=local or --config=workers) that we can recommend in documentation.
|
However, this would still be an issue with non-RBE users where they don't use a supplied set of flags. Calling |
On further thought, I think the best approach here is to add |
SGTM |
FYI: There is ongoing work to remove the strategies that are hardcoded in the Bazel source and replace it with a more explicit list of strategies to try. See design doc here: https://docs.google.com/document/d/10D-HGXcTRbideSyMGvn46pc4D6fuEDCzdCRgbod7tZQ/edit?usp=sharing And more examples here: #7480 Would this serve your use case? I will update #7480 once something is released. |
Yes! The issue here is that the worker strategy was chosen over remote, even though remote is available (which can lead to missed opportunities for cache hits). #7480 sounds like it can solve this issue. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 3 years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
Currently, DexBuilder uses the
worker
strategy by default as declared inBazelStrategyModule
. On entirely local builds, we have seen a 10-20% build time improvement with this approach, without having the user specify additional flags.However, this approach is overly aggressive when using RBE, or when building with remote executors in general, because the default strategy selection while using RBE's
--config=remote
still sets DexBuilder to use workers. This reduces the cap of the cache hit ratio.e.g. with the minimize_downloads branch of Bazel (#6862) on the big_connected project, performing a full build after a full and a clean results in 100 uncached worker processes with all other actions (correctly) remotely cached:
100 worker processes out of 987 total (89.87% cache hit), and the build took ~19.99 seconds.
If we remove the default worker strategy setting:
100% cache hit at 17.637s. That's a 1.12x speedup.
Considering that it is simple to force a mnemonic to use a particular strategy with the
--strategy
flag, I propose removingDexBuilder=worker
from Bazel defaults, and ask users to set it explicitly if they want to.@kevin1e100 / @ahumesky wdyt?
@sunyal FYI
The text was updated successfully, but these errors were encountered: