spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Efficient GPU support for Entity Linking pipe

Open svlandeg opened this issue 4 years ago • 2 comments

The new Entity Linking code has not been tested/adapted to GPU yet, cf Matt's comment here.

svlandeg avatar Sep 12 '19 10:09 svlandeg

Yes I tried with GPU, but following error occurred:

020-03-05 03:50:46,682 - ERROR - main - Error updating batch:Unsupported type <class 'numpy.ndarray'> 2020-03-05 03:50:46,694 - ERROR - main - Error updating batch:Unsupported type <class 'numpy.ndarray'> 2020-03-05 03:50:46,696 - ERROR - main - Error updating batch:Unsupported type <class 'numpy.ndarray'> 2020-03-05 03:50:46,707 - ERROR - main - Error updating batch:Unsupported type <class 'numpy.ndarray'> 2020-03-05 03:50:46,714 - ERROR - main - Error updating batch:Unsupported type <class 'numpy.ndarray'> 2020-03-05 03:50:46,723 - ERROR - main - Error updating batch:Unsupported type <class 'numpy.ndarray'> Traceback (most recent call last): File "./all_wiki/wikidata_train_entity_linker.py", line 194, in plac.call(main) File "/home/administrator/anaconda3/lib/python3.7/site-packages/plac_core.py", line 328, in call cmd, result = parser.consume(arglist) File "/home/administrator/anaconda3/lib/python3.7/site-packages/plac_core.py", line 207, in consume return cmd, self.func(*(args + varargs + extraopts), **kwargs) File "./all_wiki/wikidata_train_entity_linker.py", line 146, in main logging.info("Epoch {}, train loss {}".format(itn, round(losses["entity_linker"] / batchnr, 2))) TypeError: type cupy.core.core.ndarray doesn't define round method

zainbnv avatar Mar 05 '20 06:03 zainbnv

Update: the core EL code (i.e. not the wikipedia scripts which are outside the main library) has been tested and now runs on GPU (https://github.com/explosion/spaCy/pull/5236), but probably not very efficiently yet, so keeping this issue for now.

The wikipedia scripts is a separate issue - cf #5270. These scripts are not supported as part of the core library, as they really only showcase how the EL functionality can be used, but need adaptation to specific projects.

svlandeg avatar Apr 02 '20 12:04 svlandeg