Latest Version Of HuggingFace is Not Using GPUs
I switched from v2.8 to v2.9 today morning keeping all my experiments, enviornment same etc but the same code which used v2.8 has an epoch time of 5 mins, where as in v2.9 it's more than 2 hours.

Code was custom which was working till yesterday with v2.8.

Please verify the same.
If you don't tell us what code you use, we cannot help you. Be detailed and use code block. Don't post screenshots. <|||||>I agree. I apologize, was kinda annoyed that version diff can cause this. Will share a minimal example. (In the mean time,  re-verifying via setting up different env's)<|||||>Did you manage to solve the error?<|||||>Hey I am sorry for the delay, I am having fever since yesterday, I am trying to replicate it. <|||||>Okay, so i am not able to replicate the same on a dummy test i had run just now; seems all good ; Will ping back if the same thing happens for my code; My apologies to great devs ;<|||||>@AdityaSoni19031997  I am also facing the same issue. New transformers version is not using GPU and it's quite slow.<|||||>I have solved the issue.
You have to manually set the device and load the tensors to GPU:

```
from transformers import BertTokenizer, BertModel, BertForMaskedLM


def assign_GPU(Tokenizer_output):
    
    tokens_tensor = Tokenizer_output['input_ids'].to('cuda:0')
    token_type_ids = Tokenizer_output['token_type_ids'].to('cuda:0')
    attention_mask = Tokenizer_output['attention_mask'].to('cuda:0')
    
    output = {'input_ids' : tokens_tensor, 
              'token_type_ids' : token_type_ids, 
              'attention_mask' : attention_mask}
    
    return output



sentence  = 'Hello World!'
tokenizer = BertTokenizer.from_pretrained('bert-large-uncased')
model     = BertModel.from_pretrained('bert-large-uncased')

inputs    = assign_GPU(tokenizer(sentence, return_tensors="pt"))
model     = model.to('cuda:0')
outputs   = model(**inputs)
outputs
```<|||||>In my case, it was a conflict of driver's IIRC.