Unverified Commit 13541b4a authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Add support for `device_map="auto"` to OPT (#17382)

parent 71cced8a
...@@ -381,6 +381,7 @@ class OPTPreTrainedModel(PreTrainedModel): ...@@ -381,6 +381,7 @@ class OPTPreTrainedModel(PreTrainedModel):
config_class = OPTConfig config_class = OPTConfig
base_model_prefix = "model" base_model_prefix = "model"
supports_gradient_checkpointing = True supports_gradient_checkpointing = True
_no_split_modules = ["OPTDecoderLayer"]
_keys_to_ignore_on_load_unexpected = [r"decoder\.version"] _keys_to_ignore_on_load_unexpected = [r"decoder\.version"]
def _init_weights(self, module): def _init_weights(self, module):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment