flopscope-server 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- flopscope_server-0.4.0/PKG-INFO +91 -0
- flopscope_server-0.4.0/README.md +79 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/pyproject.toml +4 -2
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/src/flopscope_server/__init__.py +1 -1
- flopscope_server-0.3.0/PKG-INFO +0 -9
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/.gitignore +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/src/flopscope_server/__main__.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/src/flopscope_server/_array_store.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/src/flopscope_server/_comms_tracker.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/src/flopscope_server/_protocol.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/src/flopscope_server/_request_handler.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/src/flopscope_server/_server.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/src/flopscope_server/_session.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_array_store.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_bugfixes_round2.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_bugfixes_round3.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_comms_tracker.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_new_types.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_protocol.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_request_handler.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_server.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_session.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/tests/test_version_handshake.py +0 -0
- {flopscope_server-0.3.0 → flopscope_server-0.4.0}/uv.lock +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flopscope-server
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: Backend server for flopscope client-server architecture
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: flopscope==0.4.0
|
|
8
|
+
Requires-Dist: msgpack>=1.0.0
|
|
9
|
+
Requires-Dist: numpy<2.5.0,>=2.0.0
|
|
10
|
+
Requires-Dist: pyzmq>=26.0.0
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# flopscope-server
|
|
14
|
+
|
|
15
|
+
[](https://pypi.org/project/flopscope-server/)
|
|
16
|
+
[](https://www.python.org/downloads/)
|
|
17
|
+
[](https://opensource.org/licenses/MIT)
|
|
18
|
+
|
|
19
|
+
Server-side runtime for the [flopscope](https://pypi.org/project/flopscope/) client-server architecture.
|
|
20
|
+
|
|
21
|
+
`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](https://www.alignment.org/blog/will-whitebox-runtime-monitoring-defeat-scheming-models/)) from the actual computation environment.
|
|
22
|
+
|
|
23
|
+
## When to install this
|
|
24
|
+
|
|
25
|
+
You want this on the **server** side of a client-server flopscope deployment. It pulls in `flopscope`, `numpy`, `pyzmq`, and `msgpack`:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install flopscope-server
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Equivalent extra on the main flopscope distribution (installs both at the same exact version):
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install "flopscope[server]"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick start
|
|
38
|
+
|
|
39
|
+
### Launch the server
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Over a UNIX domain socket (recommended for local / single-host deployments)
|
|
43
|
+
python -m flopscope_server --url ipc:///tmp/flopscope.sock
|
|
44
|
+
|
|
45
|
+
# Or over TCP
|
|
46
|
+
python -m flopscope_server --url tcp://127.0.0.1:15555
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Connect a client
|
|
50
|
+
|
|
51
|
+
In a separate process (typically a sandboxed container) that has [`flopscope-client`](https://pypi.org/project/flopscope-client/) installed:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
export FLOPSCOPE_SERVER_URL=ipc:///tmp/flopscope.sock
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import flopscope as flops
|
|
59
|
+
import flopscope.numpy as fnp
|
|
60
|
+
|
|
61
|
+
with flops.BudgetContext(flop_budget=1_000_000):
|
|
62
|
+
a = fnp.array([1.0, 2.0, 3.0])
|
|
63
|
+
b = fnp.array([4.0, 5.0, 6.0])
|
|
64
|
+
fnp.add(a, b)
|
|
65
|
+
flops.budget_summary()
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
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.
|
|
69
|
+
|
|
70
|
+
## Architecture overview
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
┌─────────────────────────────┐ ZMQ + msgpack ┌──────────────────────────────┐
|
|
74
|
+
│ flopscope-client process │ ───────────────────────────▶ │ flopscope-server process │
|
|
75
|
+
│ (sandbox; no numpy) │ │ (full flopscope + numpy) │
|
|
76
|
+
│ `import flopscope as flops`│ ◀─────────────────────────── │ Executes ops, tracks budget │
|
|
77
|
+
└─────────────────────────────┘ └──────────────────────────────┘
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
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.
|
|
81
|
+
|
|
82
|
+
## Related
|
|
83
|
+
|
|
84
|
+
- [`flopscope`](https://pypi.org/project/flopscope/) — the NumPy-backed library hosted by this server
|
|
85
|
+
- [`flopscope-client`](https://pypi.org/project/flopscope-client/) — the lightweight proxy clients use to talk to a flopscope-server
|
|
86
|
+
- [Documentation](https://aicrowd.github.io/flopscope/) — full guides including client/server architecture and Docker recipes
|
|
87
|
+
- [GitHub](https://github.com/AIcrowd/flopscope) — source, CHANGELOG, contributor guide
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
[MIT](https://github.com/AIcrowd/flopscope/blob/main/LICENSE)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# flopscope-server
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/flopscope-server/)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
Server-side runtime for the [flopscope](https://pypi.org/project/flopscope/) client-server architecture.
|
|
8
|
+
|
|
9
|
+
`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](https://www.alignment.org/blog/will-whitebox-runtime-monitoring-defeat-scheming-models/)) from the actual computation environment.
|
|
10
|
+
|
|
11
|
+
## When to install this
|
|
12
|
+
|
|
13
|
+
You want this on the **server** side of a client-server flopscope deployment. It pulls in `flopscope`, `numpy`, `pyzmq`, and `msgpack`:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install flopscope-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Equivalent extra on the main flopscope distribution (installs both at the same exact version):
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install "flopscope[server]"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
### Launch the server
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Over a UNIX domain socket (recommended for local / single-host deployments)
|
|
31
|
+
python -m flopscope_server --url ipc:///tmp/flopscope.sock
|
|
32
|
+
|
|
33
|
+
# Or over TCP
|
|
34
|
+
python -m flopscope_server --url tcp://127.0.0.1:15555
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Connect a client
|
|
38
|
+
|
|
39
|
+
In a separate process (typically a sandboxed container) that has [`flopscope-client`](https://pypi.org/project/flopscope-client/) installed:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
export FLOPSCOPE_SERVER_URL=ipc:///tmp/flopscope.sock
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import flopscope as flops
|
|
47
|
+
import flopscope.numpy as fnp
|
|
48
|
+
|
|
49
|
+
with flops.BudgetContext(flop_budget=1_000_000):
|
|
50
|
+
a = fnp.array([1.0, 2.0, 3.0])
|
|
51
|
+
b = fnp.array([4.0, 5.0, 6.0])
|
|
52
|
+
fnp.add(a, b)
|
|
53
|
+
flops.budget_summary()
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
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.
|
|
57
|
+
|
|
58
|
+
## Architecture overview
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
┌─────────────────────────────┐ ZMQ + msgpack ┌──────────────────────────────┐
|
|
62
|
+
│ flopscope-client process │ ───────────────────────────▶ │ flopscope-server process │
|
|
63
|
+
│ (sandbox; no numpy) │ │ (full flopscope + numpy) │
|
|
64
|
+
│ `import flopscope as flops`│ ◀─────────────────────────── │ Executes ops, tracks budget │
|
|
65
|
+
└─────────────────────────────┘ └──────────────────────────────┘
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
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.
|
|
69
|
+
|
|
70
|
+
## Related
|
|
71
|
+
|
|
72
|
+
- [`flopscope`](https://pypi.org/project/flopscope/) — the NumPy-backed library hosted by this server
|
|
73
|
+
- [`flopscope-client`](https://pypi.org/project/flopscope-client/) — the lightweight proxy clients use to talk to a flopscope-server
|
|
74
|
+
- [Documentation](https://aicrowd.github.io/flopscope/) — full guides including client/server architecture and Docker recipes
|
|
75
|
+
- [GitHub](https://github.com/AIcrowd/flopscope) — source, CHANGELOG, contributor guide
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
[MIT](https://github.com/AIcrowd/flopscope/blob/main/LICENSE)
|
|
@@ -4,11 +4,13 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "flopscope-server"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.4.0"
|
|
8
8
|
description = "Backend server for flopscope client-server architecture"
|
|
9
|
+
readme = "README.md"
|
|
9
10
|
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
10
12
|
dependencies = [
|
|
11
|
-
"flopscope==0.
|
|
13
|
+
"flopscope==0.4.0",
|
|
12
14
|
"numpy>=2.0.0,<2.5.0",
|
|
13
15
|
"pyzmq>=26.0.0",
|
|
14
16
|
"msgpack>=1.0.0",
|
flopscope_server-0.3.0/PKG-INFO
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: flopscope-server
|
|
3
|
-
Version: 0.3.0
|
|
4
|
-
Summary: Backend server for flopscope client-server architecture
|
|
5
|
-
Requires-Python: >=3.10
|
|
6
|
-
Requires-Dist: flopscope==0.3.0
|
|
7
|
-
Requires-Dist: msgpack>=1.0.0
|
|
8
|
-
Requires-Dist: numpy<2.5.0,>=2.0.0
|
|
9
|
-
Requires-Dist: pyzmq>=26.0.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|