For evaluating quantized program, the Stablehlo reference interpreter depends on StablehloLegalizeQuantToInt pass which introduces Chlo broadcast operations for scale multiplication/division and zero-point addition. Legalizing the Chlo operations to StableHLO operations amount to including shape operations which needs to be canonicalized away using a bunch of canonicalization passes.
We believe that for statically shaped program we can avoid the need for chlo broadcast operations altogether and that would simply the decomposition pipeline for quantized operations.
For evaluating quantized program, the Stablehlo reference interpreter depends on StablehloLegalizeQuantToInt pass which introduces Chlo broadcast operations for scale multiplication/division and zero-point addition. Legalizing the Chlo operations to StableHLO operations amount to including shape operations which needs to be canonicalized away using a bunch of canonicalization passes.
We believe that for statically shaped program we can avoid the need for chlo broadcast operations altogether and that would simply the decomposition pipeline for quantized operations.
For example, the following program
needs to go through the following passes to convert to a fully stablehlo program