Class ov::pass::ConvertWeightCompressedConv1x1ToMatmul#
-
class ConvertWeightCompressedConv1x1ToMatmul : public ov::pass::MatcherPass#
ConvertWeightCompressedConv1x1ToMatmul transformation matches a weight-compressed Convolution with a 1x1 kernel and replaces it with a MatMul operation.
The transformation identifies the following pattern:
and replaces it with:+---------+ +-----------+ +------+ | Weights | | ZeroPoint | |Scale | +---------+ +-----------+ +------+ | | | v v | +-------+ +-------+ | |Convert| |Convert| | +-------+ +-------+ | | | | +-----+ +----+ | | | | +------------+ v v | | Activation | +--------+ | +------------+ |Subtract| (optional) | | +--------+ | v | | +-------------+ v | | Transpose/ | +----------+ | | Reshape | | Multiply |<--------------+ +-------------+ +----------+ | | | *-----------+ | | Reshape | (optional) | +-----------+ | | | v | +-----------+ +----------------->|Convolution| | (1x1) | +-----------+ | v +----------+ |Add (Bias)| (optional) +----------+ | v +-----------+ | Convert | (optional) +-----------+ | v +------------+ | Transpose/ | | Reshape | +------------+
+————+ | Activation | +————+ | | +———+ +——–—+ +——+ | | Weights | | ZeroPoint | |Scale | | +———+ +——–—+ +——+ | | | | | v v | | +—-—+ +—-—+ | | |Convert| |Convert| | | +—-—+ +—-—+ | | | | | | +–—+ +-—+ | | | | | | v v | | +—–—+ | | |Subtract| (optional) | | +—–—+ | | | | | v | | +——-—+ | | | Multiply |<———–—+ | +——-—+ | | | v | *——-—+ | | Reshape | (optional) | +——-—+ | | | v | +—–—+ +———-—> | MatMul | +—–—+ | v +——-—+ |Add (Bias)| (optional) +——-—+ | v +——–—+ | Convert | (optional) +——–—+ | v +————+ | Reshape | (optional) +————+