models icon indicating copy to clipboard operation
models copied to clipboard

How do I specify the number of CPU cores bazel uses?

Open adhoc-research opened this issue 10 years ago • 5 comments

I am building syntaxnet with bazel. It's working very slowly and keeps hanging up.

The last time I had this problem(with caffe) someone tolad me to change the number of cores I was using by adding -j4. In bazel this command did not work. Any custom command for bazel like this?

CPU Specs: 3.8ghz clock, Quadcore

CPU Model: AMD 4800(or something along those lines).

Thanks!!

adhoc-research avatar Jun 13 '16 12:06 adhoc-research

I used bazel build --jobs 4 ...

dmansfield avatar Jun 14 '16 19:06 dmansfield

This is a question better suited for StackOverflow. Please in future ask questions there and tag them with the tensorflow tag.

I put the following in my .bazelrc

startup --batch_cpu_scheduling --io_nice_level 7
build --jobs 6 --ram_utilization_factor 50
test --jobs 6

prb12 avatar Jun 21 '16 20:06 prb12

FYI the --ram_utilization_factor flag was deprecated. The new version of @prb12 's .bazelrc is:

startup --batch_cpu_scheduling --io_nice_level 7
build --jobs 6 --local_ram_resources=HOST_RAM*0.5
test --jobs 6

KristianHolsheimer avatar Apr 29 '20 01:04 KristianHolsheimer

What are the default numbers for jobs?

leimao avatar Oct 31 '20 00:10 leimao

What are the default numbers for jobs?

@leimao Seems to be infinite (-1) depending on the number of threads of the machine

flavienbwk avatar Dec 21 '20 13:12 flavienbwk