Lightweight flopscope client — drop-in replacement with no numpy dependency
Project description
flopscope-client
Lightweight drop-in replacement for flopscope that proxies all operations to a remote flopscope-server over ZMQ + msgpack.
flopscope-client provides the same import flopscope Python module as the main flopscope distribution, but with no NumPy dependency — it forwards every counted operation to a flopscope-server process. Use this in constrained environments where you want flopscope's FLOP-counting API but cannot ship numpy + the full library (e.g. sandboxed participant containers in the ARC Whitebox Estimation Challenge).
Install instead of, not alongside
flopscope-client occupies the same flopscope Python import namespace as the main package. The two are mutually exclusive — installing both leads to file-overlap in flopscope/. Choose one:
# Lightweight: client-only, no numpy
pip install flopscope-client
# Heavy: full library on the local machine
pip install flopscope
# Server-side: both flopscope + flopscope-server, pinned together
pip install "flopscope[server]"
Quick start
The client connects to a flopscope-server instance specified by the FLOPSCOPE_SERVER_URL environment variable:
export FLOPSCOPE_SERVER_URL=tcp://flopscope-server.example.com:15555
# or for a local UNIX socket:
export FLOPSCOPE_SERVER_URL=ipc:///tmp/flopscope.sock
Then use flopscope normally — the import path and API are identical to the main distribution:
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])
result = fnp.add(a, b) # round-trips to the server, runs there
flops.budget_summary()
On the first request, the client performs a version handshake with the server. A version mismatch raises ConnectionError with both versions in the error message — keep flopscope-server and flopscope-client on the same release.
When to choose this over the main flopscope install
| Scenario | Install |
|---|---|
| You want flopscope's API in a process that has full NumPy + scientific stack | pip install flopscope |
| You're shipping a sandboxed container that must not contain numpy / scipy | pip install flopscope-client |
| You're running the server side that hosts computation for many clients | pip install flopscope-server (brings flopscope along) |
| You're deploying both sides on one machine, version-pinned | pip install "flopscope[server]" |
Architecture overview
┌─────────────────────────────┐ ZMQ + msgpack ┌──────────────────────────────┐
│ flopscope-client process │ ───────────────────────────▶ │ flopscope-server process │
│ (sandbox; no numpy) │ │ (full flopscope + numpy) │
│ `import flopscope as flops`│ ◀─────────────────────────── │ Executes ops, tracks budget │
└─────────────────────────────┘ └──────────────────────────────┘
The client serializes each operation (op name, args, kwargs) as msgpack, sends it over the ZMQ REQ/REP socket, and decodes the response. Budget tracking, symmetry-aware FLOP counting, and operation-cost analytics all happen on the server side; the client just relays calls.
Related
flopscope— full NumPy-backed library (alternative install)flopscope-server— the server-side runtime this client connects to- Documentation — full guides
- 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_client-0.4.3.tar.gz.
File metadata
- Download URL: flopscope_client-0.4.3.tar.gz
- Upload date:
- Size: 99.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4365fe002de61b9e05f5079532a0979faf03a5970af24c20964eddeddcd2eb39
|
|
| MD5 |
0ae0c4c6eff78960fa4cef77c9de0df5
|
|
| BLAKE2b-256 |
e35ce5dfa6164d45d3dc0c7e3e0c308eb685d1631b56aaa5a9295748fa330355
|
Provenance
The following attestation bundles were made for flopscope_client-0.4.3.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_client-0.4.3.tar.gz -
Subject digest:
4365fe002de61b9e05f5079532a0979faf03a5970af24c20964eddeddcd2eb39 - Sigstore transparency entry: 1704277329
- Sigstore integration time:
-
Permalink:
AIcrowd/flopscope@29844df7da61b9dc9ed2ce10b4aae59f7b675294 -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/AIcrowd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@29844df7da61b9dc9ed2ce10b4aae59f7b675294 -
Trigger Event:
push
-
Statement type:
File details
Details for the file flopscope_client-0.4.3-py3-none-any.whl.
File metadata
- Download URL: flopscope_client-0.4.3-py3-none-any.whl
- Upload date:
- Size: 43.7 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 |
5edb5d7ea0ae8cd783fbe866687b9ca4aa9a6a66878be427f66b81fb1b5ed793
|
|
| MD5 |
ee709ccee60c69c3d9dd430c70e1be3b
|
|
| BLAKE2b-256 |
cade263e7c6b43ddf6ad762fee58e68def8249bdcc31707444ef406d1976c0dd
|
Provenance
The following attestation bundles were made for flopscope_client-0.4.3-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_client-0.4.3-py3-none-any.whl -
Subject digest:
5edb5d7ea0ae8cd783fbe866687b9ca4aa9a6a66878be427f66b81fb1b5ed793 - Sigstore transparency entry: 1704277393
- Sigstore integration time:
-
Permalink:
AIcrowd/flopscope@29844df7da61b9dc9ed2ce10b4aae59f7b675294 -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/AIcrowd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@29844df7da61b9dc9ed2ce10b4aae59f7b675294 -
Trigger Event:
push
-
Statement type: