Registering new compiler backend in Pytorch2.0

You can call this function to register a backend:

This allows you to use a string alias for the backend=... arg to torch.compile(.., backend="some_name"). You can also just pass your backend directly to torch.compile(..., backend=my_backend), no need to register.

To get the aten/prim graph use:

1 Like