Skip to content

Split CUDA TBE backward libraries by optimizer (#6866) - #6866

Open
q10 wants to merge 1 commit into
pytorch:mainfrom
q10:export-D133657924
Open

q10 wants to merge 1 commit into
pytorch:mainfrom
q10:export-D133657924

Conversation

@q10

@q10 q10 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

X-link: https://github.com/facebookresearch/FBGEMM/pull/3684

Prevent the multi-architecture TBE backward link from combining all optimizer fatbinaries into one oversized shared library. CUDA builds use one shared library per GPU optimizer, a shared library for the three other helpers, and the existing CPU-registration facade. Compile the small gradient-helper translation unit inside each optimizer because its kernel templates inherit hidden visibility from PyTorch packed-accessor types. This avoids the undefined grad_mean_kernel failure across shared-library boundaries.

Retain the shards as DT_NEEDED dependencies by putting Linux --no-as-needed/--as-needed flags around their dependency list. Install the shards alongside the facade with the existing $ORIGIN postbuild processing. CPU and ROCm keep their current source grouping.

Independent CUDA packaging fix. The signed-comparison warning-policy stack does not require this library split; CPU and ROCm retain their existing grouping. The oversized-library evidence is a controlled padded fixture, not a before/after full-wheel reproduction.

Differential Revision: D133657924

@meta-cla meta-cla Bot added the cla signed label Nov 21, 2026
@meta-codesync

meta-codesync Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@q10 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D133657924.

q10 added a commit to q10/FBGEMM that referenced this pull request Nov 21, 2026
Summary:

X-link: https://github.com/facebookresearch/FBGEMM/pull/3684

Prevent the multi-architecture TBE backward link from combining all optimizer fatbinaries into one oversized shared library. CUDA builds use one shared library per GPU optimizer, a shared library for the three other helpers, and the existing CPU-registration facade. Compile the small gradient-helper translation unit inside each optimizer because its kernel templates inherit hidden visibility from PyTorch packed-accessor types. This avoids the undefined `grad_mean_kernel` failure across shared-library boundaries.

Retain the shards as `DT_NEEDED` dependencies by putting Linux `--no-as-needed`/`--as-needed` flags around their dependency list. Install the shards alongside the facade with the existing `$ORIGIN` postbuild processing. CPU and ROCm keep their current source grouping.

Differential Revision: D133657924
@meta-codesync meta-codesync Bot changed the title Split CUDA TBE backward libraries by optimizer Split CUDA TBE backward libraries by optimizer (#6866) Nov 24, 2026
@q10
q10 force-pushed the export-D133657924 branch from 2632aae to f2b97b2 Compare November 24, 2026 00:53
q10 added a commit to q10/FBGEMM that referenced this pull request Nov 24, 2026
Summary:

X-link: https://github.com/facebookresearch/FBGEMM/pull/3684

Prevent the multi-architecture TBE backward link from combining all optimizer fatbinaries into one oversized shared library. CUDA builds use one shared library per GPU optimizer, a shared library for the three other helpers, and the existing CPU-registration facade. Compile the small gradient-helper translation unit inside each optimizer because its kernel templates inherit hidden visibility from PyTorch packed-accessor types. This avoids the undefined `grad_mean_kernel` failure across shared-library boundaries.

Retain the shards as `DT_NEEDED` dependencies by putting Linux `--no-as-needed`/`--as-needed` flags around their dependency list. Install the shards alongside the facade with the existing `$ORIGIN` postbuild processing. CPU and ROCm keep their current source grouping.

Differential Revision: D133657924
q10 added a commit to q10/FBGEMM that referenced this pull request Nov 29, 2026
Summary:

X-link: https://github.com/facebookresearch/FBGEMM/pull/3684

Prevent the multi-architecture TBE backward link from combining all optimizer fatbinaries into one oversized shared library. CUDA builds use one shared library per GPU optimizer, a shared library for the three other helpers, and the existing CPU-registration facade. Compile the small gradient-helper translation unit inside each optimizer because its kernel templates inherit hidden visibility from PyTorch packed-accessor types. This avoids the undefined `grad_mean_kernel` failure across shared-library boundaries.

Retain the shards as `DT_NEEDED` dependencies by putting Linux `--no-as-needed`/`--as-needed` flags around their dependency list. Install the shards alongside the facade with the existing `$ORIGIN` postbuild processing. CPU and ROCm keep their current source grouping.

Differential Revision: D133657924
q10 added a commit to q10/FBGEMM that referenced this pull request Nov 29, 2026
Summary:

X-link: https://github.com/facebookresearch/FBGEMM/pull/3684

Prevent the multi-architecture TBE backward link from combining all optimizer fatbinaries into one oversized shared library. CUDA builds use one shared library per GPU optimizer, a shared library for the three other helpers, and the existing CPU-registration facade. Compile the small gradient-helper translation unit inside each optimizer because its kernel templates inherit hidden visibility from PyTorch packed-accessor types. This avoids the undefined `grad_mean_kernel` failure across shared-library boundaries.

Retain the shards as `DT_NEEDED` dependencies by putting Linux `--no-as-needed`/`--as-needed` flags around their dependency list. Install the shards alongside the facade with the existing `$ORIGIN` postbuild processing. CPU and ROCm keep their current source grouping.

Differential Revision: D133657924
@q10
q10 force-pushed the export-D133657924 branch from f2b97b2 to 3960ac3 Compare November 29, 2026 03:31
Summary:

X-link: https://github.com/facebookresearch/FBGEMM/pull/3684

Prevent the multi-architecture TBE backward link from combining all optimizer fatbinaries into one oversized shared library. CUDA builds use one shared library per GPU optimizer, a shared library for the three other helpers, and the existing CPU-registration facade. Compile the small gradient-helper translation unit inside each optimizer because its kernel templates inherit hidden visibility from PyTorch packed-accessor types. This avoids the undefined `grad_mean_kernel` failure across shared-library boundaries.

Retain the shards as `DT_NEEDED` dependencies by putting Linux `--no-as-needed`/`--as-needed` flags around their dependency list. Install the shards alongside the facade with the existing `$ORIGIN` postbuild processing. CPU and ROCm keep their current source grouping.

Independent CUDA packaging fix. The signed-comparison warning-policy stack does not require this library split; CPU and ROCm retain their existing grouping. The oversized-library evidence is a controlled padded fixture, not a before/after full-wheel reproduction.

Differential Revision: D133657924
@q10
q10 force-pushed the export-D133657924 branch from 3960ac3 to 6e4e3b0 Compare November 29, 2026 09:55

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant