Assert bad offsets in bounds_check_indices (Part 2) (#5895)#5895
Open
gchalump wants to merge 1 commit into
Open
Assert bad offsets in bounds_check_indices (Part 2) (#5895)#5895gchalump wants to merge 1 commit into
gchalump wants to merge 1 commit into
Conversation
Contributor
|
@gchalump has exported this pull request. If you are a Meta employee, you can view the originating Diff in D106829384. |
9cf59a6 to
ccf2155
Compare
gchalump
added a commit
to gchalump/FBGEMM
that referenced
this pull request
Jun 14, 2026
Summary: X-link: facebookresearch/FBGEMM#2814 Alternate version of D101843208 with a JustKnobs killswitch (`DISABLE_OFFSETS_ADJUSTMENT`, default `true`) gating the assert path, so we can recover production jobs without a code revert if any turn out to depend on the legacy silent-correction behavior. Default behavior matches D101843208: malformed offsets (`indices_start < 0`, `indices_start > indices_end`, or `indices_end > num_indices`) trigger CUDA_KERNEL_ASSERT in all bounds-check modes. Per-b_t asserts are lane-0-guarded (32x redundant asserts are wasteful). See D101843208 for the full motivation — the legacy path has known intra-warp races on the offsets buffer and incorrect assumptions about bag size. Plumbed via a `const static bool` JK lookup in the host wrapper, passed through both v1 and v2 launchers/kernels as a runtime arg. The kernel predicate is `disable_offsets_adjustment || mode == FATAL`; the else branch preserves the legacy printf + `adjust_offset_kernel` path. Differential Revision: D106829384
gchalump
added a commit
to gchalump/FBGEMM
that referenced
this pull request
Jun 14, 2026
Summary: X-link: facebookresearch/FBGEMM#2814 Alternate version of D101843208 with a JustKnobs killswitch (`DISABLE_OFFSETS_ADJUSTMENT`, default `true`) gating the assert path, so we can recover production jobs without a code revert if any turn out to depend on the legacy silent-correction behavior. Default behavior matches D101843208: malformed offsets (`indices_start < 0`, `indices_start > indices_end`, or `indices_end > num_indices`) trigger CUDA_KERNEL_ASSERT in all bounds-check modes. Per-b_t asserts are lane-0-guarded (32x redundant asserts are wasteful). See D101843208 for the full motivation — the legacy path has known intra-warp races on the offsets buffer and incorrect assumptions about bag size. Plumbed via a `const static bool` JK lookup in the host wrapper, passed through both v1 and v2 launchers/kernels as a runtime arg. The kernel predicate is `disable_offsets_adjustment || mode == FATAL`; the else branch preserves the legacy printf + `adjust_offset_kernel` path. Differential Revision: D106829384
ccf2155 to
410ecda
Compare
Summary: X-link: facebookresearch/FBGEMM#2814 Alternate version of D101843208 with a JustKnobs killswitch (`DISABLE_OFFSETS_ADJUSTMENT`, default `true`) gating the assert path, so we can recover production jobs without a code revert if any turn out to depend on the legacy silent-correction behavior. Default behavior matches D101843208: malformed offsets (`indices_start < 0`, `indices_start > indices_end`, or `indices_end > num_indices`) trigger CUDA_KERNEL_ASSERT in all bounds-check modes. Per-b_t asserts are lane-0-guarded (32x redundant asserts are wasteful). See D101843208 for the full motivation — the legacy path has known intra-warp races on the offsets buffer and incorrect assumptions about bag size. Plumbed via a `const static bool` JK lookup in the host wrapper, passed through both v1 and v2 launchers/kernels as a runtime arg. The kernel predicate is `disable_offsets_adjustment || mode == FATAL`; the else branch preserves the legacy printf + `adjust_offset_kernel` path. Differential Revision: D106829384
410ecda to
1bf3b4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: https://github.com/facebookresearch/FBGEMM/pull/2814
Alternate version of D101843208 with a JustKnobs killswitch
(
DISABLE_OFFSETS_ADJUSTMENT, defaulttrue) gating the assert path,so we can recover production jobs without a code revert if any turn out
to depend on the legacy silent-correction behavior.
Default behavior matches D101843208: malformed offsets
(
indices_start < 0,indices_start > indices_end, orindices_end > num_indices) trigger CUDA_KERNEL_ASSERT in all bounds-checkmodes. Per-b_t asserts are lane-0-guarded (32x redundant asserts are
wasteful). See D101843208 for the full motivation — the legacy path has
known intra-warp races on the offsets buffer and incorrect assumptions
about bag size.
Plumbed via a
const static boolJK lookup in the host wrapper, passedthrough both v1 and v2 launchers/kernels as a runtime arg. The kernel
predicate is
disable_offsets_adjustment || mode == FATAL; the elsebranch preserves the legacy printf +
adjust_offset_kernelpath.Differential Revision: D106829384