ValueError: DebertaV2Model does not support gradient checkpointing.
ValueError: DebertaV2Model does not support gradient checkpointing!
Hi,

DebertaV2 supports gradient checkpointing as per #14175.

Can you provide a code snippet to reproduce your issue?<|||||>`config = AutoConfig.from_pretrained(model_name)

        config.update(
            {
                "gradient_checkpointing":True,
                "output_hidden_states": True,
                "hidden_dropout_prob": hidden_dropout_prob,
                "layer_norm_eps": layer_norm_eps,
                "add_pooling_layer": False,
                "num_labels": self.num_labels,
            }
        )
        self.transformer = AutoModel.from_pretrained(model_name, config=config)`
Hello, the above is my code snippet<|||||>I tried to reproduce the error, but I couldn't. @shilida would you please mention the `model_name` and which transformer version you have currently installed? <|||||>> I tried to reproduce the error, but I couldn't. @shilida would you please mention the `model_name` and which transformer version you have currently installed?

Thanks! The model_name is  debert-v2-xlarge. And the transformer version is 4.11.3<|||||>You should try something like that (worked for me with debertaV3):

```
import torch.utils.checkpoint

config = AutoConfig.from_pretrained(model_name)
config.update(
        {
            "output_hidden_states": True,
            "hidden_dropout_prob": hidden_dropout_prob,
            "layer_norm_eps": layer_norm_eps,
            "add_pooling_layer": False,
            "num_labels": self.num_labels,
        }
)
self.transformer = AutoModel.from_pretrained(model_name, config=config)
self.transformer.gradient_checkpointing_enable()
```