Skip to content

Build Fix: Avoid invalid make -j 0 in NCCL EP submodule build#3243

Merged
phu0ngng merged 2 commits into
NVIDIA:mainfrom
phu0ngng:ep_jax
Jul 23, 2026
Merged

Build Fix: Avoid invalid make -j 0 in NCCL EP submodule build#3243
phu0ngng merged 2 commits into
NVIDIA:mainfrom
phu0ngng:ep_jax

Conversation

@phu0ngng

Copy link
Copy Markdown
Collaborator

Description

Avoid invalid make -j 0 in NCCL EP submodule build

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
@phu0ngng

Copy link
Copy Markdown
Collaborator Author

/te-ci L0

@jberchtold-nvidia jberchtold-nvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending CI, thanks!

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a build failure in the NCCL EP submodule build step where make -j 0 was being passed when no explicit job limit was configured. make -j 0 is invalid in GNU make; the fix replaces the two-argument form ("-j", str(nproc)) with a single combined flag (-j{nproc}) when nproc > 0, or just -j (unlimited parallelism) when nproc == 0 (the default from get_max_jobs_for_parallel_build()).

  • Replaces ["make", "-j", str(nproc), ...] with make_jobs = f"-j{nproc}" if nproc else "-j" to produce valid make invocations in all cases.
  • The else "-j" branch is reachable: get_max_jobs_for_parallel_build() defaults to 0 when no NVTE_BUILD_MAX_JOBS, MAX_JOBS, or --parallel= argument is provided, making nproc falsy and triggering unlimited parallelism as intended.

Confidence Score: 5/5

Safe to merge — a minimal, targeted fix to a build-time subprocess invocation with no runtime or API surface changes.

The change is a single-line fix that replaces an invalid make -j 0 call (which causes build failures when no explicit job limit is configured) with a correctly formed make -j or make -jN invocation. The logic maps cleanly to get_max_jobs_for_parallel_build()'s documented return values, the else "-j" branch is genuinely reachable, and no other code paths are affected.

No files require special attention.

Important Files Changed

Filename Overview
setup.py Minimal one-line fix: introduces make_jobs variable that emits -j{nproc} for a positive job count or -j (unlimited) when nproc is 0, eliminating the invalid make -j 0 invocation.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[build_nccl_ep_submodule] --> B[get_max_jobs_for_parallel_build]
    B --> C{NVTE_BUILD_MAX_JOBS\nor MAX_JOBS\nor --parallel=N set?}
    C -- Yes --> D[nproc = N]
    C -- No --> E[nproc = 0]
    D --> F{nproc truthy?}
    E --> F
    F -- Yes, nproc > 0 --> G[make_jobs = '-jN']
    F -- No, nproc == 0 --> H[make_jobs = '-j' unlimited]
    G --> I["make -jN -C nccl_ep lib"]
    H --> J["make -j -C nccl_ep lib"]
Loading

Reviews (2): Last reviewed commit: "Merge branch 'main' into ep_jax" | Re-trigger Greptile

Comment thread setup.py
@phu0ngng
phu0ngng merged commit c39f36d into NVIDIA:main Jul 23, 2026
10 of 16 checks passed
@phu0ngng
phu0ngng deleted the ep_jax branch July 23, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants