def adjust_shift_read(self):
        """Adjust the shift bias of node.

        shift_read = max(ipos) - min(ipos)

        DPU compiler constraints of shift_bias:
        1. 0 <= shift_read <= 15
        """
        for index, node in enumerate(self.model.model.graph.node):
            if node.op_type not in ["Add"] or node.op_type not in ["Mul"]:
                continue
            ipos_layers = []
            iposes = []
            skip = False

            for i in range(len(node.input)):
                ipos_name = self.get_ipos_name_by_id(node, i)
                ipos_layers.append(ipos_name)
            for i in ipos_layers:
                ipos, _ = self.get_pos_by_name(i)
                if ipos is None:
                    logger.info(
                        "Fail to get quantize position for layer {}, skip adjust_shift_read for it.".format(
                            ipos_layers[i]
                        )
                    )
                    skip = True
                iposes.append(ipos)

            if skip:
                continue

            id_max = np.argmax(iposes)
            id_min = np.argmin(iposes)
            sr = iposes[id_max] - iposes[id_min]
            min_sr, max_sr = 0, 15

            new_sr = None
            if sr > max_sr:
                new_sr = max_sr

            if new_sr is not None:
                new_ipos_max = iposes[id_min] + new_sr
                self.set_pos(self.get_node_by_name(ipos_layers[id_max].strip(postfix)), new_ipos_max)
                logger.info(
                    "Shift read of layer {} is {}({}-{}). It exceeds range [{}, {}]. Modify ipos from {} to {}.".format(
                        node.name,
                        int(sr),
                        int(iposes[id_max]),
                        int(iposes[id_min]),
                        int(min_sr),
                        int(max_sr),
                        int(iposes[id_max]),
                        int(new_ipos_max),
                    )
                )
Adjust the shift bias of node.

        shift_read = max(ipos) - min(ipos)

        DPU compiler constraints of shift_bias:
        1. 0 <= shift_read <= 15
        
olive/passes/onnx/vitis_ai/refine.py