From 2086e7018d9864e5a32e34f052100f0771698564 Mon Sep 17 00:00:00 2001 From: regisss <15324346+regisss@users.noreply.github.com> Date: Sat, 3 Feb 2024 02:30:07 +0100 Subject: [PATCH] Bring back workaround for Falcon with SynapseAI 1.13 --- examples/text-generation/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/text-generation/utils.py b/examples/text-generation/utils.py index 9b66de8128..53e4c3bab6 100644 --- a/examples/text-generation/utils.py +++ b/examples/text-generation/utils.py @@ -36,7 +36,7 @@ model_on_meta, write_checkpoints_json, ) -from optimum.habana.utils import check_optimum_habana_min_version, set_seed +from optimum.habana.utils import check_habana_frameworks_version, check_optimum_habana_min_version, set_seed def adjust_batch(batch, size): @@ -174,7 +174,10 @@ def setup_model(args, model_dtype, model_kwargs, logger): if args.use_hpu_graphs: from habana_frameworks.torch.hpu import wrap_in_hpu_graph - model = wrap_in_hpu_graph(model) + if check_habana_frameworks_version("1.13.0") and model.config.model_type == "falcon": + model = wrap_in_hpu_graph(model, hash_with_views=False) + else: + model = wrap_in_hpu_graph(model) if args.torch_compile and model.config.model_type == "llama": model = get_torch_compiled_model(model)