[MacPorts] #58932: py-tensorflow: reduce build time
MacPorts
noreply at macports.org
Sat May 23 03:39:12 UTC 2020
#58932: py-tensorflow: reduce build time
----------------------------+--------------------------
Reporter: ryandesign | Owner: emcrisostomo
Type: enhancement | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: py-tensorflow |
----------------------------+--------------------------
Comment (by ryandesign):
How much memory does your MBP have? I'm guessing more than 8 GB.
Hopefully the tensorflow build process is already respecting the value of
`build.jobs` but I'm not sure what a reasonable number of parallel jobs is
for tensorflow. MacPorts sets `build.jobs` with the assumption that each
compiler process might use up to 1 GB memory and that there should be an
available core for each compiler process so on a machine with 8 cores and
8 GB RAM it will allow 8 parallel jobs. This seems to work for most ports
but there is the odd port that requires much more memory to build, like
tensorflow. If bazel can be told to keep its memory usage to fit within
the amount of memory that the machine has that could help. Otherwise it
might be a start if the portfile could set `build.jobs` to a fraction of
itself, for example:
{{{
if {${build.jobs} > 1} {
build.jobs [expr {${build.jobs} / 2}]
}
}}}
That would reserve 2 GB per job instead of 1. Or a more complicated
formula could be used based on the amount of RAM in the machine if you can
figure out a simple way to determine what that is and what a good formula
would be.
--
Ticket URL: <https://trac.macports.org/ticket/58932#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list