Skip to content

Provide support for out of tree Pytorch backends #966

@tehbone

Description

@tehbone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions