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

This commit is contained in:
Sylvain Gugger 2022-05-23 15:25:51 -04:00 committed by GitHub
parent 71cced8ae3
commit 13541b4aa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -381,6 +381,7 @@ class OPTPreTrainedModel(PreTrainedModel):
config_class = OPTConfig
base_model_prefix = "model"
supports_gradient_checkpointing = True
_no_split_modules = ["OPTDecoderLayer"]
_keys_to_ignore_on_load_unexpected = [r"decoder\.version"]
def _init_weights(self, module):