letify 1.1.1__py3-none-win_amd64.whl
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.
- letify/__init__.py +107 -0
- letify/cli.py +619 -0
- letify/config/__init__.py +166 -0
- letify/config/inventory.py +153 -0
- letify/config/login.py +1105 -0
- letify/config/schema.py +52 -0
- letify/config/secrets.py +96 -0
- letify/config/writer.py +195 -0
- letify/declare/__init__.py +15 -0
- letify/declare/cache.py +49 -0
- letify/declare/env.py +114 -0
- letify/declare/function.py +262 -0
- letify/declare/instance.py +192 -0
- letify/errors.py +135 -0
- letify/install.py +606 -0
- letify/launcher.py +604 -0
- letify/protocol/__init__.py +51 -0
- letify/protocol/codec.py +263 -0
- letify/protocol/driver.py +101 -0
- letify/protocol/handle.py +47 -0
- letify/protocol/wire.py +636 -0
- letify/protocol/worker.py +2038 -0
- letify/providers/__init__.py +59 -0
- letify/providers/base.py +554 -0
- letify/providers/colab.py +382 -0
- letify/providers/colab_files.py +278 -0
- letify/providers/elice.py +1092 -0
- letify/providers/kaggle.py +904 -0
- letify/providers/kaggle_adapter.py +181 -0
- letify/providers/local.py +174 -0
- letify/providers/modal.py +816 -0
- letify/providers/modal_adapter.py +296 -0
- letify/providers/naming.py +47 -0
- letify/providers/shell.py +459 -0
- letify/providers/tunnel.py +25 -0
- letify/providers/usage.py +174 -0
- letify/remoting/__init__.py +28 -0
- letify/remoting/capability.py +50 -0
- letify/remoting/device/__init__.py +52 -0
- letify/remoting/device/client.py +1126 -0
- letify/remoting/device/cuda.py +866 -0
- letify/remoting/device/executor.py +598 -0
- letify/remoting/device/frames.py +175 -0
- letify/remoting/device/guard.py +54 -0
- letify/remoting/device/tensor.py +630 -0
- letify/remoting/device/trace.py +236 -0
- letify/remoting/device/value.py +251 -0
- letify/remoting/lib/letify-agent.exe +0 -0
- letify/remoting/lib/nvcuda.dll +0 -0
- letify/remoting/loader.py +96 -0
- letify/remoting/probe.py +145 -0
- letify/render.py +385 -0
- letify/runtime/__init__.py +25 -0
- letify/runtime/bootstrap.py +296 -0
- letify/runtime/channel.py +982 -0
- letify/runtime/lease.py +70 -0
- letify/runtime/pool.py +284 -0
- letify/runtime/session.py +656 -0
- letify/runtime/telemetry.py +343 -0
- letify/store/__init__.py +25 -0
- letify/store/backends/__init__.py +58 -0
- letify/store/backends/filesystem.py +70 -0
- letify/store/backends/google_auth.py +139 -0
- letify/store/backends/layout.py +27 -0
- letify/store/backends/objects.py +345 -0
- letify/store/cas.py +186 -0
- letify/store/pathdata.py +871 -0
- letify/store/sendorder.py +385 -0
- letify/store/volume.py +293 -0
- letify/stubs.py +196 -0
- letify/tools.py +189 -0
- letify/transport/__init__.py +9 -0
- letify/transport/agent.py +109 -0
- letify/transport/announce.py +34 -0
- letify/transport/link.py +193 -0
- letify/transport/nat.py +481 -0
- letify/transport/pipeline.py +426 -0
- letify/transport/probe.py +86 -0
- letify/transport/rendezvous.py +157 -0
- letify/transport/setup.py +165 -0
- letify/transport/sshopts.py +97 -0
- letify/transport/strategies.py +357 -0
- letify-1.1.1.dist-info/METADATA +549 -0
- letify-1.1.1.dist-info/RECORD +88 -0
- letify-1.1.1.dist-info/WHEEL +5 -0
- letify-1.1.1.dist-info/entry_points.txt +2 -0
- letify-1.1.1.dist-info/licenses/LICENSE +201 -0
- letify_providers.py +12 -0
letify/__init__.py
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"""letify: declarations that become infrastructure.
|
|
2
|
+
|
|
3
|
+
Declare what a function needs and it runs there:
|
|
4
|
+
|
|
5
|
+
import letify
|
|
6
|
+
|
|
7
|
+
let = letify.Launcher()
|
|
8
|
+
colab = let.providers.colab_a
|
|
9
|
+
|
|
10
|
+
@let.function(device=colab.G4, host=letify.remote)
|
|
11
|
+
def train(lr, bs):
|
|
12
|
+
...
|
|
13
|
+
|
|
14
|
+
train(lr=1e-4, bs=32)
|
|
15
|
+
|
|
16
|
+
A declaration places two things. ``device`` says where the device is, carrying the provider
|
|
17
|
+
and the account with it. ``host`` says where the host code runs: ``local``, the default,
|
|
18
|
+
keeps Python here and forwards only PyTorch operators, and ``remote`` ships the function to the
|
|
19
|
+
machine that holds the device.
|
|
20
|
+
|
|
21
|
+
A session ends with the call that needed it. ``with let.keep_alive():`` keeps sessions for the
|
|
22
|
+
length of a block, so a run of separate calls does not pay session start each time.
|
|
23
|
+
|
|
24
|
+
Nothing here imports a provider's optional dependency, so ``import letify`` works with
|
|
25
|
+
the base install and a provider whose package is missing reports itself unavailable.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from __future__ import annotations
|
|
29
|
+
|
|
30
|
+
from typing import Final
|
|
31
|
+
|
|
32
|
+
from .declare.cache import session_cache
|
|
33
|
+
from .declare.env import Env
|
|
34
|
+
from .declare.function import Function
|
|
35
|
+
from .declare.instance import AnyInstance, Host, Instance
|
|
36
|
+
from .errors import (
|
|
37
|
+
ConfigError,
|
|
38
|
+
EnvironmentFailure,
|
|
39
|
+
InsufficientDevices,
|
|
40
|
+
InterpreterMismatch,
|
|
41
|
+
LetifyError,
|
|
42
|
+
ProtocolError,
|
|
43
|
+
ProviderUnavailable,
|
|
44
|
+
RemoteError,
|
|
45
|
+
RuntimeFailure,
|
|
46
|
+
RuntimeLost,
|
|
47
|
+
SpotPreempted,
|
|
48
|
+
UnknownInstance,
|
|
49
|
+
UnknownProvider,
|
|
50
|
+
UnsupportedMode,
|
|
51
|
+
)
|
|
52
|
+
from .launcher import Launcher, Providers
|
|
53
|
+
from .protocol.handle import Blob, RemoteFile
|
|
54
|
+
from .store.volume import Volume
|
|
55
|
+
|
|
56
|
+
#: Where a declaration's host code runs. Two named values rather than the enum class that holds
|
|
57
|
+
#: them, because a declaration only ever needs one of the two.
|
|
58
|
+
#: ``Final`` so a type checker sees the literal member, which the declaration overloads match on.
|
|
59
|
+
local: Final = Host.local
|
|
60
|
+
remote: Final = Host.remote
|
|
61
|
+
|
|
62
|
+
# The enum class stays importable from letify.declare.instance for letify's own use.
|
|
63
|
+
del Host
|
|
64
|
+
|
|
65
|
+
__version__ = "1.1.1"
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def fetch(tensor): # type: ignore[no-untyped-def]
|
|
69
|
+
"""Queue a read of ``tensor`` and return an awaitable resolving to its CPU copy.
|
|
70
|
+
|
|
71
|
+
Under ``host="local"`` the read is queued at the call and awaiting it does not block the
|
|
72
|
+
event loop. A tensor not on the runtime resolves to ``tensor.detach().cpu()``.
|
|
73
|
+
"""
|
|
74
|
+
from .remoting.device.client import fetch as queue_fetch
|
|
75
|
+
|
|
76
|
+
return queue_fetch(tensor)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
__all__ = [
|
|
80
|
+
"AnyInstance",
|
|
81
|
+
"Blob",
|
|
82
|
+
"ConfigError",
|
|
83
|
+
"Env",
|
|
84
|
+
"EnvironmentFailure",
|
|
85
|
+
"Function",
|
|
86
|
+
"Instance",
|
|
87
|
+
"InsufficientDevices",
|
|
88
|
+
"InterpreterMismatch",
|
|
89
|
+
"Launcher",
|
|
90
|
+
"LetifyError",
|
|
91
|
+
"ProtocolError",
|
|
92
|
+
"ProviderUnavailable",
|
|
93
|
+
"Providers",
|
|
94
|
+
"RemoteError",
|
|
95
|
+
"RemoteFile",
|
|
96
|
+
"RuntimeFailure",
|
|
97
|
+
"RuntimeLost",
|
|
98
|
+
"SpotPreempted",
|
|
99
|
+
"UnknownInstance",
|
|
100
|
+
"UnknownProvider",
|
|
101
|
+
"UnsupportedMode",
|
|
102
|
+
"Volume",
|
|
103
|
+
"__version__",
|
|
104
|
+
"local",
|
|
105
|
+
"remote",
|
|
106
|
+
"session_cache",
|
|
107
|
+
]
|