Unsupported Type Error when running Relation Extraction Tutorial on GPU #7532
-
Hi, I am trying the relation extraction component tutorial via spaCy projects, Ref: Rel Component on a similar BioMedical relation extraction challenge. However, when replaced with another relation extraction challenge data, exactly similar to this data, it works only on CPU (with decent results) and seems to run into issue on a GPU. spaCy code is GPU agnostic, so it shouldn't have been a problem, here is the error snippet. Stack Trace
It looks like simple tok2vec initialization using transformers on GPU has issues, however on CPU works fine. Your EnvironmentInfo about spaCy
Installation Steps
Any ideas/pointers as to what components should be looked at? It might also be helpful to know, if this is a cupy / thinc specific issue. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
I'm a little at a loss here, because you mention the tutorial works as-is on both CPU & GPU. When you replaced the data, did you make any other changes to the code base, config file, or project yml? |
Beta Was this translation helpful? Give feedback.
-
Hi @svlandeg, Thanks for checking on this earlier, any thoughts/suggestions would be really helpful here. Should I change the data generation strategy, since I don't have prodigy style annotations? Does the current data generation process makes sense? |
Beta Was this translation helpful? Give feedback.
-
Just for posterity, leaving the patch I applied to solve this problem; File:
I forced conversion to cupy array, so that GPU device is used:
This will convert the input array into cc: @svlandeg, Hope this was one-off error, but if further investigation is required, and similar errors are reported in future, a bug can be reported on the main issue log and can be investigated in detail. Thanks, |
Beta Was this translation helpful? Give feedback.
-
This issue might be fixed with PR #7626 |
Beta Was this translation helpful? Give feedback.
-
Hi @AashishTiwari, thanks for reporting back, and sorry that I haven't been replying as I was looking into this. Great to hear that the recent PR fixes things on your end though! |
Beta Was this translation helpful? Give feedback.
This issue might be fixed with PR #7626
Also, this might be part of upcoming v3.0.6 release, which should fix similar errors.
cc: @svlandeg