def maybe_unpack_qkv(self):
        """Unpack the QKV projection matrix into separate projections for models like phi3."""
        for layer_wrapper in self.get_layer_wrappers():
            attn_inputs, attn_input_names = layer_wrapper.get_attention_inputs()

            if len(attn_inputs) != 1 or not isinstance(attn_inputs[0], nn.Linear):
                return

            set_attr(
                layer_wrapper.layer,
                attn_input_names[0],
                UnpackedQKV(
                    attn_inputs[0],
                    self.num_attention_heads,
                    self.num_key_value_heads,
                    self.head_dim,
                ),
            )
Unpack the QKV projection matrix into separate projections for models like phi3.
olive/common/hf/wrapper.py