layerpool 0.1.0__tar.gz → 0.1.1__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.
- {layerpool-0.1.0 → layerpool-0.1.1}/PKG-INFO +2 -2
- {layerpool-0.1.0 → layerpool-0.1.1}/README.md +1 -1
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/__init__.py +1 -1
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/net.py +17 -3
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/tunnel.py +13 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/.gitignore +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/LICENSE +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/pyproject.toml +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/__main__.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/api.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/backends/__init__.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/backends/common.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/backends/mlx_backend.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/blocks.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/cli.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/codec.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/control.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/driver.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/export.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/fetch.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/hf.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/job.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/losses.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/planner.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/pool.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/selfcheck.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/telemetry.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/trainers.py +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/ui/app.js +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/ui/index.html +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/ui/style.css +0 -0
- {layerpool-0.1.0 → layerpool-0.1.1}/src/layerpool/worker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: layerpool
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Train one model on all of your devices: layers split across GPUs, Apple Silicon and CPUs, with your own training code.
|
|
5
5
|
Project-URL: Homepage, https://github.com/abdallah-swe/layerpool
|
|
6
6
|
Project-URL: Repository, https://github.com/abdallah-swe/layerpool
|
|
@@ -52,7 +52,7 @@ Description-Content-Type: text/markdown
|
|
|
52
52
|
|
|
53
53
|
One model, split by layers across all your machines. Their memory is pooled, and they train it as one.
|
|
54
54
|
|
|
55
|
-
[](https://pypi.org/project/layerpool/) [](https://pypi.org/project/layerpool/) [](https://github.com/abdallah-swe/layerpool/blob/main/LICENSE)
|
|
55
|
+
[](https://pypi.org/project/layerpool/) [](https://pypi.org/project/layerpool/) [](https://github.com/abdallah-swe/layerpool/blob/main/LICENSE)
|
|
56
56
|
|
|
57
57
|
</div>
|
|
58
58
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
One model, split by layers across all your machines. Their memory is pooled, and they train it as one.
|
|
13
13
|
|
|
14
|
-
[](https://pypi.org/project/layerpool/) [](https://pypi.org/project/layerpool/) [](https://github.com/abdallah-swe/layerpool/blob/main/LICENSE)
|
|
14
|
+
[](https://pypi.org/project/layerpool/) [](https://pypi.org/project/layerpool/) [](https://github.com/abdallah-swe/layerpool/blob/main/LICENSE)
|
|
15
15
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
@@ -318,6 +318,7 @@ def lan_ip() -> str:
|
|
|
318
318
|
s.close()
|
|
319
319
|
|
|
320
320
|
|
|
321
|
+
QUICK_TUNNELS = ".trycloudflare.com"
|
|
321
322
|
_resolved: dict[str, tuple[str, float]] = {}
|
|
322
323
|
|
|
323
324
|
|
|
@@ -336,9 +337,22 @@ def _ask_public_dns(host: str) -> str | None:
|
|
|
336
337
|
return None
|
|
337
338
|
|
|
338
339
|
|
|
340
|
+
def _front_door(host: str) -> str | None:
|
|
341
|
+
"""A quick tunnel is served by the same Cloudflare addresses as its parent domain, which find the tunnel by the host name sent
|
|
342
|
+
with TLS, so a tunnel answers there before its own name has spread through DNS."""
|
|
343
|
+
if not host.endswith(QUICK_TUNNELS):
|
|
344
|
+
return None
|
|
345
|
+
parent = QUICK_TUNNELS.lstrip(".")
|
|
346
|
+
try:
|
|
347
|
+
return socket.getaddrinfo(parent, None, socket.AF_INET)[0][4][0]
|
|
348
|
+
except socket.gaierror:
|
|
349
|
+
return _ask_public_dns(parent)
|
|
350
|
+
|
|
351
|
+
|
|
339
352
|
def resolve(host: str) -> str:
|
|
340
|
-
"""The address to connect to. A fresh tunnel name is often cached as missing by the local resolver for many
|
|
341
|
-
|
|
353
|
+
"""The address to connect to. A fresh tunnel name is often cached as missing by the local resolver for many minutes, so when
|
|
354
|
+
the system cannot find a name, ask public DNS over HTTPS instead. Public DNS can hold the same miss for about a minute: a quick
|
|
355
|
+
tunnel is then reached through its parent domain."""
|
|
342
356
|
try:
|
|
343
357
|
socket.getaddrinfo(host, None)
|
|
344
358
|
return host
|
|
@@ -346,7 +360,7 @@ def resolve(host: str) -> str:
|
|
|
346
360
|
cached = _resolved.get(host)
|
|
347
361
|
if cached and cached[1] > time.time():
|
|
348
362
|
return cached[0]
|
|
349
|
-
ip = _ask_public_dns(host)
|
|
363
|
+
ip = _ask_public_dns(host) or _front_door(host)
|
|
350
364
|
if ip is None:
|
|
351
365
|
raise
|
|
352
366
|
_resolved[host] = (ip, time.time() + 300)
|
|
@@ -24,6 +24,7 @@ SHA256 = {
|
|
|
24
24
|
"cloudflared-linux-arm64": "3df43aedc9ff291d1735b5cb576cb97e0b157488796db2e32b28aecabb445775",
|
|
25
25
|
"cloudflared-windows-amd64.exe": "2493dbc168923bb3e59e5e7716f71deced92992eea9acd6e9d74f84ac7751343",
|
|
26
26
|
}
|
|
27
|
+
SETTLE_S = 3.0
|
|
27
28
|
CACHE = os.path.join(os.path.expanduser("~"), ".cache", "layerpool")
|
|
28
29
|
|
|
29
30
|
|
|
@@ -117,6 +118,8 @@ class Tunnel:
|
|
|
117
118
|
threading.Thread(target=self._read, daemon=True).start()
|
|
118
119
|
try:
|
|
119
120
|
self.url = self._wait_url(timeout)
|
|
121
|
+
self._wait_registered(20)
|
|
122
|
+
time.sleep(SETTLE_S)
|
|
120
123
|
self._wait_reachable(timeout)
|
|
121
124
|
log(f"tunnel ready at {self.url} after {time.time() - started:.0f}s")
|
|
122
125
|
return
|
|
@@ -144,6 +147,16 @@ class Tunnel:
|
|
|
144
147
|
self.close()
|
|
145
148
|
raise RuntimeError("cloudflared did not give a tunnel address:\n" + "".join(self.lines[-20:]))
|
|
146
149
|
|
|
150
|
+
def _wait_registered(self, timeout: float):
|
|
151
|
+
"""The address is printed before the tunnel is connected. Asking for it that early makes Cloudflare and DNS servers remember
|
|
152
|
+
for up to a minute that it does not exist, so wait until cloudflared says it is connected (or, if it never says so, for
|
|
153
|
+
`timeout` seconds). Cloudflare's servers learn of it a moment later still: SETTLE_S."""
|
|
154
|
+
deadline = time.time() + timeout
|
|
155
|
+
while time.time() < deadline and self.proc.poll() is None:
|
|
156
|
+
if any("Registered tunnel connection" in line for line in list(self.lines)):
|
|
157
|
+
return
|
|
158
|
+
time.sleep(0.1)
|
|
159
|
+
|
|
147
160
|
def _wait_reachable(self, timeout: float):
|
|
148
161
|
deadline = time.time() + timeout
|
|
149
162
|
while time.time() < deadline:
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|