Validate total_num_blocks divisibility by my_size in block_bucketize (#5646)#5649
Open
q10 wants to merge 1 commit intopytorch:mainfrom
Open
Validate total_num_blocks divisibility by my_size in block_bucketize (#5646)#5649q10 wants to merge 1 commit intopytorch:mainfrom
q10 wants to merge 1 commit intopytorch:mainfrom
Conversation
…ytorch#5646) Summary: X-link: facebookresearch/FBGEMM#2596 Add input validation for `total_num_blocks` divisibility by `my_size` in `block_bucketize_sparse_features` to prevent silent buffer overflows. Test Plan: # Full Suites # Requires: Any CUDA GPU (has CPU fallback) buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize_2d_weights # Individual Tests (new in this diff) buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize -- -k test_block_bucketize_sparse_features_total_num_blocks_not_divisible buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize_2d_weights -- -k test_block_bucketize_sparse_features_2d_weights_total_num_blocks_not_divisible # Related Tests (validates existing behavior not broken) buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize -- -k total_num_blocks # Benchmark (does NOT pass total_num_blocks, zero overhead on common path) buck2 run @//mode/opt fbcode//deeplearning/fbgemm/fbgemm_gpu/bench:sparse_ops -- block-bucketize-sparse-features-bench Reviewed By: henrylhtsang Differential Revision: D101141810 Pulled By: q10
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/2596
Add input validation for
total_num_blocksdivisibility bymy_sizeinblock_bucketize_sparse_featuresto prevent silent buffer overflows.Test Plan:
Full Suites
Requires: Any CUDA GPU (has CPU fallback)
buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize
buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize_2d_weights
Individual Tests (new in this diff)
buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize -- -k test_block_bucketize_sparse_features_total_num_blocks_not_divisible
buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize_2d_weights -- -k test_block_bucketize_sparse_features_2d_weights_total_num_blocks_not_divisible
Related Tests (validates existing behavior not broken)
buck2 test fbcode//deeplearning/fbgemm/fbgemm_gpu/test/sparse:block_bucketize -- -k total_num_blocks
Benchmark (does NOT pass total_num_blocks, zero overhead on common path)
buck2 run @//mode/opt fbcode//deeplearning/fbgemm/fbgemm_gpu/bench:sparse_ops -- block-bucketize-sparse-features-bench
Reviewed By: henrylhtsang
Differential Revision: D101141810
Pulled By: q10