-
Notifications
You must be signed in to change notification settings - Fork 28
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
Issue with CUDA 12.x Inference, Performance completely obliterated #71
Comments
Hello! I've never experienced this discrepancy between CPU and CUDA before, wow. I have no idea what could cause this - I don't touch anything as low level as CUDA, it's all just abstracted by from span_marker import SpanMarkerModel
model = SpanMarkerModel.from_pretrained("tomaarsen/span-marker-roberta-large-fewnerd-fine-super").cuda()
print(model.device)
# cuda:0
preds = model.predict("John Smith works at Amazon.")
print(preds)
# [{'span': 'John Smith', 'label': 'person-other', 'score': 0.9197737574577332, 'char_start_index': 0, 'char_end_index': 10}, {'span': 'Amazon', 'label': 'organization-company', 'score': 0.9607704877853394, 'char_start_index': 20, 'char_end_index': 26}]
model = model.to("cpu")
print(model.device)
# cpu
preds = model.predict("John Smith works at Amazon.")
print(preds)
# [{'span': 'John Smith', 'label': 'person-other', 'score': 0.9197738766670227, 'char_start_index': 0, 'char_end_index': 10}, {'span': 'Amazon', 'label': 'organization-company', 'score': 0.9607704877853394, 'char_start_index': 20, 'char_end_index': 26}] with my nvcc:
Perhaps this is an issue with your CUDA or torch installation?
|
Thanks for the reply. And yes, this is quite perplexing for my team... What version of transformers and torch are you running? We are running:
|
I'm on:
although I've used other combinations in the past before.
Oh, excellent! Still very strange that 2.4.0 didn't work, that's still a very recent version.
|
Wow, I just bumped to |
Steps to reproduce:
CPU inference yields expected results but CUDA is returning empty for short texts... Not a problem if we have longer texts... why is this?
Output from
nvcc --version
:This is running on an A10 but we observe the same results on a T4... Is SpanMarker not compatible with cu12x?
The text was updated successfully, but these errors were encountered: