Skip to content

Commit

Permalink
increase cl mpcount since Compilation is moved on CPU machine (micros…
Browse files Browse the repository at this point in the history
…oft#20116)

### Description
The CPU machine has 16 cores, so we can increase the parallel count.
Compared with 2 runs.
1.
https://dev.azure.com/aiinfra/Lotus/_build/results?buildId=432328&view=results
2.
https://dev.azure.com/aiinfra/Lotus/_build/results?buildId=432331&view=results
The compilation took about 25 minutes if the parallel count is 15, while
it took 41 minutes if the parallel count is 3


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

Co-authored-by: Yi Zhang <[email protected]>
  • Loading branch information
mszhanyi and Yi Zhang authored Mar 28, 2024
1 parent c5d7310 commit 2a38168
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/ci_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1701,12 +1701,12 @@ def build_targets(args, cmake_path, build_dir, configs, num_parallel_jobs, targe
# https://github.com/Microsoft/checkedc-clang/wiki/Parallel-builds-of-clang-on-Windows suggests
# not maxing out CL_MPCount
# Start by having one less than num_parallel_jobs (default is num logical cores),
# limited to a range of 1..3
# that gives maxcpucount projects building using up to 3 cl.exe instances each
# limited to a range of 1..15
# that gives maxcpucount projects building using up to 15 cl.exe instances each
build_tool_args += [
f"/maxcpucount:{num_parallel_jobs}",
# one less than num_parallel_jobs, at least 1, up to 3
f"/p:CL_MPCount={min(max(num_parallel_jobs - 1, 1), 3)}",
# one less than num_parallel_jobs, at least 1, up to 15
f"/p:CL_MPCount={min(max(num_parallel_jobs - 1, 1), 15)}",
# if nodeReuse is true, msbuild processes will stay around for a bit after the build completes
"/nodeReuse:False",
]
Expand Down

0 comments on commit 2a38168

Please sign in to comment.