Skip to content

Deduplicate check to reduce binary size#5474

Open
spcyppt wants to merge 1 commit intopytorch:mainfrom
spcyppt:export-D96034242
Open

Deduplicate check to reduce binary size#5474
spcyppt wants to merge 1 commit intopytorch:mainfrom
spcyppt:export-D96034242

Conversation

@spcyppt
Copy link
Copy Markdown
Contributor

@spcyppt spcyppt commented Mar 12, 2026

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

TLDR;

The fix wraps the TORCH_CHECK call in a C10_NOINLINE helper function
(check_fp8_params), so the exception-throwing code exists only once in the
binary. Call sites are reduced to a simple function call, to reduce binary size.
This keeps the binary within the size limit while preserving runtime assertion
checking.

Differential Revision: D96034242

Summary:
X-link: facebookresearch/FBGEMM#2447

# TLDR;

The fix wraps the `TORCH_CHECK` call in a `C10_NOINLINE` helper function
(`check_fp8_params`), so the exception-throwing code exists only once in the
binary. Call sites are reduced to a simple function call, to reduce binary size.
This keeps the binary within the size limit while preserving runtime assertion 
checking.

Differential Revision: D96034242
@meta-cla meta-cla bot added the cla signed label Mar 12, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Mar 12, 2026

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

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