Backend server for flopscope client-server architecture
Project description
flopscope-server
Server-side runtime for the flopscope client-server architecture.
flopscope-server runs the heavy NumPy-backed flopscope library on behalf of remote flopscope-client processes that connect over ZMQ + msgpack. Use it when you want to isolate untrusted or sandboxed code (typically participant submissions in the ARC Whitebox Estimation Challenge) from the actual computation environment.
When to install this
You want this on the server side of a client-server flopscope deployment. It pulls in flopscope, numpy, pyzmq, and msgpack:
pip install flopscope-server
Equivalent extra on the main flopscope distribution (installs both at the same exact version):
pip install "flopscope[server]"
Quick start
Launch the server
# Over a UNIX domain socket (recommended for local / single-host deployments)
python -m flopscope_server --url ipc:///tmp/flopscope.sock
# Or over TCP
python -m flopscope_server --url tcp://127.0.0.1:15555
Connect a client
In a separate process (typically a sandboxed container) that has flopscope-client installed:
export FLOPSCOPE_SERVER_URL=ipc:///tmp/flopscope.sock
import flopscope as flops
import flopscope.numpy as fnp
with flops.BudgetContext(flop_budget=1_000_000):
a = fnp.array([1.0, 2.0, 3.0])
b = fnp.array([4.0, 5.0, 6.0])
fnp.add(a, b)
flops.budget_summary()
The client's first request performs a version handshake with the server; mismatched flopscope versions raise ConnectionError with both versions in the message. Keep flopscope-server and flopscope-client on the same release.
Architecture overview
┌─────────────────────────────┐ ZMQ + msgpack ┌──────────────────────────────┐
│ flopscope-client process │ ───────────────────────────▶ │ flopscope-server process │
│ (sandbox; no numpy) │ │ (full flopscope + numpy) │
│ `import flopscope as flops`│ ◀─────────────────────────── │ Executes ops, tracks budget │
└─────────────────────────────┘ └──────────────────────────────┘
Every counted operation (matmul, einsum, FFT, reductions, …) is dispatched to the server, executed against the real library, and the result + remaining budget streamed back. The client never sees numpy.
Related
flopscope— the NumPy-backed library hosted by this serverflopscope-client— the lightweight proxy clients use to talk to a flopscope-server- Documentation — full guides including client/server architecture and Docker recipes
- GitHub — source, CHANGELOG, contributor guide
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flopscope_server-0.4.2.tar.gz.
File metadata
- Download URL: flopscope_server-0.4.2.tar.gz
- Upload date:
- Size: 60.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0aae8d5eea9ae4a57cfb8ee09863000e0e7ea1722a219c083ed4524b37c0ce60
|
|
| MD5 |
34bd1c1754c8d06ceaf462b1638f8d56
|
|
| BLAKE2b-256 |
44e69034d28443b63b609305e518974fc53b24fa73f94c1d2ed93d64a80f8f27
|
Provenance
The following attestation bundles were made for flopscope_server-0.4.2.tar.gz:
Publisher:
pypi-publish.yml on AIcrowd/flopscope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flopscope_server-0.4.2.tar.gz -
Subject digest:
0aae8d5eea9ae4a57cfb8ee09863000e0e7ea1722a219c083ed4524b37c0ce60 - Sigstore transparency entry: 1694308150
- Sigstore integration time:
-
Permalink:
AIcrowd/flopscope@59b2b711d3492ce9feebffa18d20d73d14b57eb8 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/AIcrowd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@59b2b711d3492ce9feebffa18d20d73d14b57eb8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file flopscope_server-0.4.2-py3-none-any.whl.
File metadata
- Download URL: flopscope_server-0.4.2-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c85e09c55dd290eb4c0cb8ca85654cdc47581b96d96826b3ec217b2ec327f55
|
|
| MD5 |
efe4f95886195abfac95e0b2b8e853cf
|
|
| BLAKE2b-256 |
b754baf1a8949a8951320339b74e386234da427733600d3f82de1dd04b0af14e
|
Provenance
The following attestation bundles were made for flopscope_server-0.4.2-py3-none-any.whl:
Publisher:
pypi-publish.yml on AIcrowd/flopscope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flopscope_server-0.4.2-py3-none-any.whl -
Subject digest:
3c85e09c55dd290eb4c0cb8ca85654cdc47581b96d96826b3ec217b2ec327f55 - Sigstore transparency entry: 1694308359
- Sigstore integration time:
-
Permalink:
AIcrowd/flopscope@59b2b711d3492ce9feebffa18d20d73d14b57eb8 -
Branch / Tag:
refs/tags/v0.4.2 - Owner: https://github.com/AIcrowd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@59b2b711d3492ce9feebffa18d20d73d14b57eb8 -
Trigger Event:
push
-
Statement type: