diff --git a/tools/mlir_bench/lora-runner.xsh b/tools/mlir_bench/lora-runner.xsh index 8cddf83ef058a1..c27460b53ed591 100755 --- a/tools/mlir_bench/lora-runner.xsh +++ b/tools/mlir_bench/lora-runner.xsh @@ -13,8 +13,10 @@ import re from os import environ +LORA_DIMS = [2, 4, 8] CONFIGS = [ - [8], [16], [32], [64], [128], [256], [512], [1024] + [8], [16], [32], [64], [128], [256], [512], [1024], + [2048], [4096], [8192] ] ITERATIONS = 100 @@ -84,7 +86,7 @@ func.func @entry(%arg0: !loraAlphaType, %arg1: !inputType) -> !inputType {{\n\ return mlir_model -def main(): +def full_run(lora_dim): no_mlir_averages = [] mlir_averages = [] no_ov_averages = [] @@ -92,7 +94,7 @@ def main(): for config in CONFIGS: model_desc = '.'.join(str(x) for x in config) model_xml = f"lora.{model_desc}.xml" - model = build_ov_lora_model(*config) + model = build_ov_lora_model(*config, lora_dim=lora_dim) ov.save_model(model, model_xml) BENCH_FLAGS=f"-m {model_xml} -d CPU -ip f32 -infer_precision f32 -hint none -nstreams 1 -nthreads 1".split() @@ -113,15 +115,21 @@ def main(): mlir_model = build_mlir_lora_model(*config) if DEBUG: print(mlir_model) - raw_kernel_secs = $(echo @(mlir_model) | tpp-run @(RUNNER_FLAGS)) + raw_kernel_secs = $(@(lambda: print(mlir_model)) | tpp-run @(RUNNER_FLAGS) --lower-pack-unpack-folding-transpose) return float(raw_kernel_secs) * 1000 manual_mlir_averages.append(run_manual_mlir("")) print("CONFIGS", CONFIGS) print("OV NO-MLIR", no_mlir_averages) print("OV MLIR", mlir_averages) - print("NO-OV MLIR", no_ov_averages) - print("MANUAL MLIR", manual_mlir_averages) + print("NO-OV MLIR", list(round(x, 2) for x in no_ov_averages)) + print("MANUAL MLIR", list(round(x, 2) for x in manual_mlir_averages)) + + +def main(): + for lora_dim in LORA_DIMS: + print("lora_dim =", lora_dim) + full_run(lora_dim) if __name__ == "__main__":