Copybara import of the project: - #11133
Open
copybara-service[bot] wants to merge 1 commit into
Open
Conversation
copybara-service
Bot
force-pushed
the
test_975821639
branch
from
September 3, 2026 22:40
52aa291 to
6d3dcc4
Compare
-- 041763c by tinhien11 <thanhtinpk092007@gmail.com>: subgraph: validate filter shape dims[1..3] in conv/deconv/depthwise-conv xnn_define_convolution_2d validated only filter_value->shape.dim[0] (== group_output_channels * groups) but not dims[1..3] against kernel_height, kernel_width, and group_input_channels. When a filter tensor is declared with dims[1..3] smaller than the convolution's kernel parameters, weight packing (xnn_pack_f32_conv_goki_w) reads nc * ks * kc elements from the filter buffer — where ks comes from the convolution parameters, not the filter's declared shape — causing a heap out-of-bounds read during xnn_create_runtime_v2. xnn_define_deconvolution_2d and xnn_define_depthwise_convolution_2d had no filter shape validation at all. Add full 4D filter shape validation to all three operators, rejecting mismatched shapes at define-time with xnn_status_invalid_parameter. Fixes #11118 -- c2ec208 by tinhien11 <thanhtinpk092007@gmail.com>: subgraph tests: fix filter shapes rejected by define-time validation The new conv/deconv/depthwise filter shape checks reject the dummy geometry used by three structural tests that never execute the graph: - SUBGRAPH_FP16.convolution_{weights,bias}_used_by_another_node declared a 1x1 filter ({2, 1, 1, 3}) against Kernel{3, 3}; use a 1x1 kernel so the shapes are self-consistent. Output extents are unchanged. - SUBGRAPH_NCHW.bottleneck declared filter #10 as {4, 1, 1, 4} for a convolution with group_input_channels=8; use {4, 1, 1, 8}. FUTURE_COPYBARA_INTEGRATE_REVIEW=#11119 from tinhien11:fix/filter-shape-validation c2ec208 PiperOrigin-RevId: 975821639
copybara-service
Bot
force-pushed
the
test_975821639
branch
from
September 4, 2026 13:18
6d3dcc4 to
d1c21bd
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.
Copybara import of the project:
--
041763c by tinhien11 thanhtinpk092007@gmail.com:
subgraph: validate filter shape dims[1..3] in conv/deconv/depthwise-conv
xnn_define_convolution_2d validated only filter_value->shape.dim[0]
(== group_output_channels * groups) but not dims[1..3] against
kernel_height, kernel_width, and group_input_channels. When a filter
tensor is declared with dims[1..3] smaller than the convolution's
kernel parameters, weight packing (xnn_pack_f32_conv_goki_w) reads
nc * ks * kc elements from the filter buffer — where ks comes from
the convolution parameters, not the filter's declared shape — causing
a heap out-of-bounds read during xnn_create_runtime_v2.
xnn_define_deconvolution_2d and xnn_define_depthwise_convolution_2d
had no filter shape validation at all.
Add full 4D filter shape validation to all three operators, rejecting
mismatched shapes at define-time with xnn_status_invalid_parameter.
Fixes #11118
--
c2ec208 by tinhien11 thanhtinpk092007@gmail.com:
subgraph tests: fix filter shapes rejected by define-time validation
The new conv/deconv/depthwise filter shape checks reject the dummy
geometry used by three structural tests that never execute the graph:
a 1x1 filter ({2, 1, 1, 3}) against Kernel{3, 3}; use a 1x1 kernel so
the shapes are self-consistent. Output extents are unchanged.
convolution with group_input_channels=8; use {4, 1, 1, 8}.
FUTURE_COPYBARA_INTEGRATE_REVIEW=#11119 from tinhien11:fix/filter-shape-validation c2ec208