Skip to content

Commit

Permalink
GPT2 torch.compile fix (#1434)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmertin authored Oct 18, 2024
1 parent f4cb594 commit 8b61e8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/text-generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def patch_scoped_linear_all_reduce(model):


def get_torch_compiled_model(model):
if model.config.model_type in ["gpt_bigcode", "mpt", "bloom"]:
if model.config.model_type in ["gpt_bigcode", "mpt", "bloom", "gpt2"]:
model.transformer = torch.compile(
model.transformer, backend="hpu_backend", options={"keep_input_mutations": True}
)
Expand Down

0 comments on commit 8b61e8b

Please sign in to comment.