Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove keep_input_mutations #1492

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions examples/text-generation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,11 @@ def patch_scoped_linear_all_reduce(model):

def get_torch_compiled_model(model):
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}
)
model.transformer = torch.compile(model.transformer, backend="hpu_backend")
elif model.config.model_type in ["gpt_neox"]:
model.gpt_neox = torch.compile(model.gpt_neox, backend="hpu_backend", options={"keep_input_mutations": True})
model.gpt_neox = torch.compile(model.gpt_neox, backend="hpu_backend")
else:
model.model = torch.compile(model.model, backend="hpu_backend", options={"keep_input_mutations": True})
model.model = torch.compile(model.model, backend="hpu_backend")
return model


Expand Down