{
  "input_model": {
    "type": "PyTorchModel",
    "config": {
      "model_path": "",
      "model_loader": "text_encoder_2_load",
      "model_script": "modules/olive_script.py",
      "io_config": {
        "input_names": ["input_ids", "output_hidden_states"],
        "output_names": [
          "text_embeds",
          "last_hidden_state",
          "hidden_states.0",
          "hidden_states.1",
          "hidden_states.2",
          "hidden_states.3",
          "hidden_states.4",
          "hidden_states.5",
          "hidden_states.6",
          "hidden_states.7",
          "hidden_states.8",
          "hidden_states.9",
          "hidden_states.10",
          "hidden_states.11",
          "hidden_states.12",
          "hidden_states.13",
          "hidden_states.14",
          "hidden_states.15",
          "hidden_states.16",
          "hidden_states.17",
          "hidden_states.18",
          "hidden_states.19",
          "hidden_states.20",
          "hidden_states.21",
          "hidden_states.22",
          "hidden_states.23",
          "hidden_states.24",
          "hidden_states.25",
          "hidden_states.26",
          "hidden_states.27",
          "hidden_states.28",
          "hidden_states.29",
          "hidden_states.30",
          "hidden_states.31",
          "hidden_states.32"
        ],
        "dynamic_axes": {
          "input_ids": { "0": "batch_size", "1": "sequence_length" },
          "text_embeds": { "0": "batch_size" },
          "last_hidden_state": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.0": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.1": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.2": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.3": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.4": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.5": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.6": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.7": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.8": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.9": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.10": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.11": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.12": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.13": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.14": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.15": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.16": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.17": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.18": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.19": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.20": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.21": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.22": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.23": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.24": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.25": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.26": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.27": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.28": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.29": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.30": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.31": { "0": "batch_size", "1": "sequence_length" },
          "hidden_states.32": { "0": "batch_size", "1": "sequence_length" }
        }
      },
      "dummy_inputs_func": "text_encoder_2_conversion_inputs"
    }
  },
  "systems": {
    "local_system": {
      "type": "LocalSystem",
      "config": {
        "accelerators": [
          {
            "device": "gpu",
            "execution_providers": ["DmlExecutionProvider"]
          }
        ]
      }
    }
  },
  "evaluators": {
    "common_evaluator": {
      "metrics": [
        {
          "name": "latency",
          "type": "latency",
          "sub_types": [{ "name": "avg" }],
          "user_config": {
            "user_script": "modules/olive_script.py",
            "dataloader_func": "text_encoder_2_data_loader",
            "batch_size": 1
          }
        }
      ]
    }
  },
  "passes": {
    "optimize_DmlExecutionProvider": {
      "type": "OrtTransformersOptimization",
      "config": {
        "model_type": "clip",
        "opt_level": 0,
        "float16": true,
        "use_gpu": true,
        "keep_io_types": true,
        "optimization_options": {
          "enable_gelu": true,
          "enable_layer_norm": true,
          "enable_attention": true,
          "use_multi_head_attention": true,
          "enable_skip_layer_norm": false,
          "enable_embed_layer_norm": true,
          "enable_bias_skip_layer_norm": false,
          "enable_bias_gelu": true,
          "enable_gelu_approximation": false,
          "enable_qordered_matmul": false,
          "enable_shape_inference": true,
          "enable_gemm_fast_gelu": false,
          "enable_nhwc_conv": false,
          "enable_group_norm": true,
          "enable_bias_splitgelu": false,
          "enable_packed_qkv": true,
          "enable_packed_kv": true,
          "enable_bias_add": false,
          "group_norm_channels_last": false
        },
        "force_fp32_ops": ["RandomNormalLike"],
        "force_fp16_inputs": {
          "GroupNorm": [0, 1, 2]
        }
      }
    },
    "optimize_CUDAExecutionProvider": {
      "type": "OrtTransformersOptimization",
      "config": {
        "model_type": "clip",
        "opt_level": 0,
        "float16": true,
        "use_gpu": true,
        "keep_io_types": true
      }
    },
    "optimize_ROCMExecutionProvider": {
      "type": "OrtTransformersOptimization",
      "config": {
        "model_type": "clip",
        "opt_level": 0,
        "float16": true,
        "use_gpu": true,
        "keep_io_types": true
      }
    }
  },
  "pass_flows": [["optimize_AutoExecutionProvider"]],
  "engine": {
    "evaluator": "common_evaluator",
    "evaluate_input_model": false,
    "host": "local_system",
    "target": "local_system",
    "cache_dir": "cache",
    "output_name": "text_encoder_2",
    "output_dir": "footprints"
  }
}
