Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/winml/modelkit/pattern/op_input_gen/conv_input_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,38 @@ def get_input_and_infinite_attribute_combinations(
comb = comb_with_bias.copy()
comb.update(optional_subset)
combinations.append(comb)

# Even-kernel upsample patterns (stride == kernel, group=1, C_in==C_out).
# Common in depth-estimation / segmentation decoders (e.g. DPT).
# Shapes from depth-anything ConvTranspose nodes.
for x_shape, w_shape, b_shape, k_shape, strides in [
((1, 96, 37, 37), (96, 96, 2, 2), (96,), (2, 2), [2, 2]),
((1, 48, 37, 37), (48, 48, 4, 4), (48,), (4, 4), [4, 4]),
]:
pads = [0, 0, 0, 0]
dilations = [1, 1]
output_padding = [0, 0]
for bias_opt in [None, InputShapeConstraint(b_shape)]:
base_comb = {
"X": InputShapeConstraint(x_shape),
"W": InputShapeConstraint(w_shape),
"B": bias_opt,
"dilations": dilations,
"group": 1,
"kernel_shape": k_shape,
"strides": strides,
"auto_pad": "NOTSET",
"pads": pads,
}
if bias_opt is None:
del base_comb["B"]
for optional_subset in self._get_optional_combinations(
x_shape, k_shape, strides, dilations, pads, output_padding, "NOTSET"
):
comb = base_comb.copy()
comb.update(optional_subset)
combinations.append(comb)

return combinations

def get_infinite_property_names(self) -> list[str]:
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/analyze/core/test_qdq.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,9 @@ class TestIterQDQCombinations:
), # shape 3 * attrs 4 * 2 * kernel shape 2 * opt B 2 * 16 * B/Y non qdq 4
(
"ConvTranspose",
3072,
), # shape 3 * auto_pad 4 * group_opts 2 * output 4 * optional b 2 * 16
3328,
), # base: shape 3 * auto_pad 4 * group_opts 2 * output 4 * optional b 2 * 16 +
# even-kernel: 2 * output 4 * optional b 2 * 16
(
"CumSum",
2816,
Expand Down
Loading