Skip to content

Remove syncs from segment candidate metrics - #4500

Open
Zhihan-Lu wants to merge 1 commit into
meta-pytorch:mainfrom
Zhihan-Lu:export-D113910954
Open

Remove syncs from segment candidate metrics#4500
Zhihan-Lu wants to merge 1 commit into
meta-pytorch:mainfrom
Zhihan-Lu:export-D113910954

Conversation

@Zhihan-Lu

Copy link
Copy Markdown

Summary:
Add a flag-gated fixed-shape candidate-count path for segment metrics. Reuse a CPU-resident max-candidate bound for GAUC so the compiled update path avoids CUDA scalar reads and data-dependent indexing.

Preserve the existing behavior when ENABLE_SEGMENT_METRICS_NUM_CANDIDATES_OPT is disabled.

Differential Revision: D113910954

Summary:
Add a flag-gated fixed-shape candidate-count path for segment metrics. Reuse a CPU-resident max-candidate bound for GAUC so the compiled update path avoids CUDA scalar reads and data-dependent indexing.

Preserve the existing behavior when `ENABLE_SEGMENT_METRICS_NUM_CANDIDATES_OPT` is disabled.

Differential Revision: D113910954
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 6, 2026
@meta-codesync

meta-codesync Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@Zhihan-Lu has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113910954.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant