-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Allow fractional jobs to automatically scale by number of CPUs (200USD Bounty) #3482
Comments
Nice idea. |
Shall we use another flag for this? It's confusing that |
how about |
Bazel supports basic arithmetic and allows things like |
Yeah I think we can take what Brazel uses, specifically in this doc:
It only allows keyword at the beginning and only supports |
Yeah don't even need a real parser, pattern matching on |
Oh that's cool! I didn't know you can do that in Scala. I can try to implement this feature. |
In Maven it is On a 16 core cpu, these three command would all mean the same:
It's basically what @lihaoyi suggested in the first comment, but with a |
@wb14123 go for it. I don't mind either the maven way or the bazel way, either works as long as we document it |
I'm wondering if |
I'm not used to bazel, but I find the term |
Hmm, then I think we can support the format like maven |
Yeah subtraction definitely seems useful. On some further thought i think a bit more verbosity here is good. |
If we mention the "C" in the |
I've pushed a PR which lets you specify fractional thread counts using the |
Resolve com-lihaoyi#3482 Allow jobs param to have following formats: 1. An integer indicates the parallel level. 2. A float N followed by character "C" indicates uses (N * all available cores). e.g. "0.5C" uses half of the available cores. 3. "C-" followed by an integer N indicates uses (all available cores - N). e.g. "C-1" leaves 1 core and uses all the other cores.
Oh I was working on this as well and didn't notice @LvlAndFarm created a PR. Anyway, I pushed my code just in case it helps: #3554 I tried to do some manual test with |
Oh found out |
Going to close this since we have a PR in #3482. |
Resolve #3482 Allow jobs param to have following formats: 1. An integer indicates the parallel level. 2. A float N followed by character "C" indicates uses (N * all available cores). e.g. "0.5C" uses half of the available cores. 3. "C-" followed by an integer N indicates uses (all available cores - N). e.g. "C-1" leaves 1 core and uses all the other cores. --------- Co-authored-by: Li Haoyi <haoyi.sg@gmail.com>
From the maintainer Li Haoyi: I'm putting a 200USD bounty on this issue, payable by bank transfer on a merged PR implementing this.
so
-j 0.5
on a 10 CPU machine would be the same as-j 5
, on a 4 CPU machine the same as-j 2
, etc.-j 1.0
would be the current default, and-j 2.0
would mean twice as many jobs as CPUs (e.g. if they're mostly IO bound).I've wanted
-j 0.5
myself to use in Mill's own CI, because Mill tests are very heavy and use more than one thread per task, and it would be nice if the same-j
config would just do the right thing on different machines with different amounts of available computeThe text was updated successfully, but these errors were encountered: