Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

4.0 KB
Raw Blame
ir_version: 10
graph {
  node {
    input: "query"
    input: ""
    input: ""
    input: "past_key"
    input: "past_value"
    input: "seqlens_k"
    input: "total_sequence_length"
    input: ""
    input: ""
    input: ""
    input: ""
    input: ""
    input: "k_scale"
    input: "v_scale"
    output: "output"
    output: "present_key"
    output: "present_value"
    op_type: "GroupQueryAttention"
    attribute {
      name: "do_rotary"
      i: 0
      type: INT
    }
    attribute {
      name: "k_quant_type"
      s: "PER_CHANNEL"
      type: STRING
    }
    attribute {
      name: "kv_cache_bit_width"
      i: 4
      type: INT
    }
    attribute {
      name: "kv_num_heads"
      i: 1
      type: INT
    }
    attribute {
      name: "num_heads"
      i: 2
      type: INT
    }
    attribute {
      name: "v_quant_type"
      s: "PER_CHANNEL"
      type: STRING
    }
    domain: "com.microsoft"
  }
  name: "GQA_DynQuant"
  initializer {
    dims: 8
    data_type: 1
    float_data: 0.03088
    float_data: 0.05149
    float_data: 0.04601
    float_data: 0.0285
    float_data: 0.06849
    float_data: 0.02605
    float_data: 0.06375
    float_data: 0.02591
    name: "k_scale"
  }
  initializer {
    dims: 8
    data_type: 1
    float_data: 0.03712
    float_data: 0.04729
    float_data: 0.04498
    float_data: 0.06395
    float_data: 0.02376
    float_data: 0.04815
    float_data: 0.02656
    float_data: 0.0619
    name: "v_scale"
  }
  input {
    name: "query"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_param: "batch_size"
          }
          dim {
            dim_param: "sequence_length"
          }
          dim {
            dim_value: 32
          }
        }
      }
    }
  }
  input {
    name: "past_key"
    type {
      tensor_type {
        elem_type: 2
        shape {
          dim {
            dim_param: "batch_size"
          }
          dim {
            dim_value: 1
          }
          dim {
            dim_param: "past_sequence_length"
          }
          dim {
            dim_value: 4
          }
        }
      }
    }
  }
  input {
    name: "past_value"
    type {
      tensor_type {
        elem_type: 2
        shape {
          dim {
            dim_param: "batch_size"
          }
          dim {
            dim_value: 1
          }
          dim {
            dim_param: "past_sequence_length"
          }
          dim {
            dim_value: 4
          }
        }
      }
    }
  }
  input {
    name: "seqlens_k"
    type {
      tensor_type {
        elem_type: 6
        shape {
          dim {
            dim_param: "batch_size"
          }
          dim {
            dim_value: 1
          }
        }
      }
    }
  }
  input {
    name: "total_sequence_length"
    type {
      tensor_type {
        elem_type: 6
        shape {
        }
      }
    }
  }
  output {
    name: "output"
    type {
      tensor_type {
        elem_type: 1
        shape {
          dim {
            dim_param: "batch_size"
          }
          dim {
            dim_param: "sequence_length"
          }
          dim {
            dim_value: 16
          }
        }
      }
    }
  }
  output {
    name: "present_key"
    type {
      tensor_type {
        elem_type: 2
        shape {
          dim {
            dim_param: "batch_size"
          }
          dim {
            dim_value: 1
          }
          dim {
            dim_param: "total_sequence_length"
          }
          dim {
            dim_value: 4
          }
        }
      }
    }
  }
  output {
    name: "present_value"
    type {
      tensor_type {
        elem_type: 2
        shape {
          dim {
            dim_param: "batch_size"
          }
          dim {
            dim_value: 1
          }
          dim {
            dim_param: "total_sequence_length"
          }
          dim {
            dim_value: 4
          }
        }
      }
    }
  }
}
opset_import {
  domain: ""
  version: 21
}
opset_import {
  domain: "com.microsoft"
  version: 1
}