explosion / explosion/thinc

Provide support for out of tree Pytorch backends

Open
#966 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2.9k
Forks
295
PR merge metrics
No merged PRs in 30d

Description

This is somewhat related to some of the discussion in PR #559. The prevailing guidance from Pytorch for new devices is to take advantage of the `privateuseone` device. The conventions established by that approach allow for an out of tree device to be defined and for a unique name to be registered, replacing the `privateuseone` name while in use.

I looked around in `thinc` to see if such support could be added similarly to how `thinc_mps_ops` and `thinc_bigendian_ops` were added, but as noted in the previous PR, there is some added complexity since currently `thinc` has to be aware of the backend and vise-versa, leading to potential cyclic import loops.

Could a backend interface be established such that one could register either an out of tree cpu or "gpu" backend, and have thinc pick it up? My first thought would be that this backend could register an entrypoint (`thinc.backends` maybe?) and then provide all the information necessary for not only the current Ops but whatever pytorch behavior is necessary.

I did start playing with this conceptually with https://github.com/tehbone/thinc_nnpa_ops - which will actually need a mix of the CPU and GPU functionality.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.