Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend optimizations #17

Open
3 tasks
alecandido opened this issue Apr 17, 2024 · 0 comments
Open
3 tasks

Backend optimizations #17

alecandido opened this issue Apr 17, 2024 · 0 comments

Comments

@alecandido
Copy link
Member

The chosen strategy is to make all backends "cloud backends", in the sense that the user code will only hold a client, and talk to a backend server through a socket (possibly on the same machine).
The basic exchange of information will happen through serialization (of circuits and results).

Despite this strategy being very general, often it won't be optimal.

Thus, the following optimizations are candidates for a later implementation:

  • compiled backends
  • Unix sockets
  • shared memory communication

Compiled backends

Sometimes, when the backend itself could be linked to the user application (because it is written in a compiled language, or the user is unlikely willing to link the whole interpreter... the performance gain should be negligible...) it could be nice to have a CompiledBackend struct for execution, instead of a ClientBackend.

This could be supported with an enum (essentially, the usual manual version of enum_dispatch).

Unix sockets

These are not portable, but they would gain in performance over TCP ones, when running on the same machine.

Shared memory

Instead of serializing the results, a pointer to shared memory could be returned.

This is a valid strategy for execution on the same machine (giving permissions to both server and client to access the result memory) but also to handle results on discrete devices (like handling a buffer on a GPU).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant