google / google/heir

Fuse multiplication by a splat into conv2d and similar ops

Open
#3,025 1 comment 0 reactions 0 assignees View on GitHub
optimization
Dominant language
MLIR
Stars
906
Forks
171
Avg merge
4d 12h
Merged PRs (30d)
32

Description

_Cf. the comment thread by @mdgrs in https://github.com/google/heir/pull/3006#discussion_r3325235127_

https://github.com/google/heir/pull/3006 implemented fusion of batchnorm1d into preceding convolution and linear ops. The operations that batchnorm1d lowers to are multiplication by general tensors, which only make sense to fuse into channel-wise operations.

However, some constructions (reportedly average pooling and sum pooling) reduce to multiplication by a splat after a non-channel ops like conv2d and conv1d. These splats can be fused into the filter matrix of the convolution. This issue is to add support for that.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.