Commit cfea02e
committed
build: throttle torch source compilation via Ninja job pool
Each generated `<op>.cc` instantiates `at::<op>_out(...)`, which
expands roughly 0.5-1 GB of ATen template metaprogramming. With 451
ops compiled in parallel at Ninja's default `-j$(nproc)`, peak
memory can exceed 30 GB and the OOM killer drops `cc1plus` on
build hosts that allocate less RAM (observed on metax, moore, and
cambricon CI containers).
Add a Ninja job pool `torch_compile=4` and apply it to:
- the vendor-system-g++ `add_custom_command` recompile loop
(metax / moore), via `JOB_POOL`;
- a new `infiniops_torch_objs` OBJECT library for the regular
cmake build path (cambricon / nvidia / iluvatar), via
`JOB_POOL_COMPILE`.
The rest of the build keeps full parallelism.1 parent 800619d commit cfea02e
1 file changed
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
282 | 293 | | |
283 | 294 | | |
284 | 295 | | |
| |||
330 | 341 | | |
331 | 342 | | |
332 | 343 | | |
| 344 | + | |
333 | 345 | | |
334 | 346 | | |
335 | 347 | | |
| |||
338 | 350 | | |
339 | 351 | | |
340 | 352 | | |
341 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
342 | 365 | | |
343 | 366 | | |
344 | 367 | | |
| |||
0 commit comments