dumpsterpanda 0.2.1__tar.gz → 0.2.2__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.
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/PKG-INFO +1 -1
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/pyproject.toml +1 -1
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/__init__.py +1 -1
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/cli/app.py +3 -1
- dumpsterpanda-0.2.2/src/trash_panda/cli/config.py +68 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/LICENSE +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/README.md +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/cli/__init__.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/cli/info.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/cli/names.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/cli/plan.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/cli/trace.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/__init__.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/blocks.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/checkpoint.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/config.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/coordinator.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/depth.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/early.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/formats.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/hardware.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/hooks.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/loader.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/measure.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/order_file.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/planner.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/report.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/stage.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/offload/trace.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/paths.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/__init__.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/load.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/server.py +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/app.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/bars.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/data.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/files.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/index.html +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/memory.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/memorychart.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/package.json +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/panels.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/style.css +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/svg.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/timeline.js +0 -0
- {dumpsterpanda-0.2.1 → dumpsterpanda-0.2.2}/src/trash_panda/ui/static/usage.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""trash-panda: run models bigger than your GPU by streaming weights across GPU, RAM and disk."""
|
|
2
2
|
|
|
3
|
-
__version__ = "0.2.
|
|
3
|
+
__version__ = "0.2.2"
|
|
4
4
|
|
|
5
5
|
# The offload API is imported lazily so that `import trash_panda` works even where torch is not installed yet.
|
|
6
6
|
_OFFLOAD_NAMES = (
|
|
@@ -5,6 +5,7 @@ try:
|
|
|
5
5
|
except ImportError:
|
|
6
6
|
raise SystemExit("The command line needs extra packages: pip install 'dumpsterpanda[cli]'")
|
|
7
7
|
|
|
8
|
+
from .config import config_command
|
|
8
9
|
from .info import info_command
|
|
9
10
|
from .plan import plan_command
|
|
10
11
|
from .trace import trace_command
|
|
@@ -14,12 +15,13 @@ app = typer.Typer(no_args_is_help=True, add_completion=False, help="trash-panda:
|
|
|
14
15
|
|
|
15
16
|
@app.callback()
|
|
16
17
|
def _root() -> None:
|
|
17
|
-
"""The root of the commands: `trash-panda plan ...`, `trash-panda info ...`, `trash-panda trace
|
|
18
|
+
"""The root of the commands: `trash-panda plan ...`, `trash-panda info ...`, `trash-panda trace ...`, `trash-panda config`."""
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
app.command("plan")(plan_command)
|
|
21
22
|
app.command("info")(info_command)
|
|
22
23
|
app.command("trace")(trace_command)
|
|
24
|
+
app.command("config")(config_command)
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
def main() -> None:
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""`trash-panda config`: every setting and environment variable, with the value it has now."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from dataclasses import fields
|
|
5
|
+
|
|
6
|
+
import typer
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.table import Table
|
|
9
|
+
from rich.text import Text
|
|
10
|
+
|
|
11
|
+
from .. import paths
|
|
12
|
+
|
|
13
|
+
console = Console()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _show(value) -> str:
|
|
17
|
+
return str(value).lower() if isinstance(value, bool) else str(value)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def rows() -> list:
|
|
21
|
+
"""(variable, value, state) for every variable, the folders first. The state is "default" (not set), "set" or "invalid"."""
|
|
22
|
+
from ..offload import config
|
|
23
|
+
|
|
24
|
+
out = []
|
|
25
|
+
for var, value in (("TRASH_PANDA_HOME", paths.cache_dir()), ("TRASH_PANDA_TRACE_DIR", paths.trace_dir())):
|
|
26
|
+
out.append((var, str(value), "set" if os.environ.get(var, "").strip() else "default"))
|
|
27
|
+
for field in fields(config.DEFAULTS):
|
|
28
|
+
var = config.ENV_PREFIX + field.name.upper()
|
|
29
|
+
default = getattr(config.DEFAULTS, field.name)
|
|
30
|
+
raw = os.environ.get(var)
|
|
31
|
+
if not raw: # an empty variable counts as not set, as in config.current()
|
|
32
|
+
out.append((var, _show(default), "default"))
|
|
33
|
+
continue
|
|
34
|
+
try:
|
|
35
|
+
out.append((var, _show(config._parse(field.name, default, raw)), "set"))
|
|
36
|
+
except ValueError:
|
|
37
|
+
out.append((var, raw, "invalid"))
|
|
38
|
+
return out
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _unknown(known) -> list:
|
|
42
|
+
"""TRASH_PANDA_ variables in the environment that nothing reads, which is usually a typo."""
|
|
43
|
+
return sorted(name for name in os.environ if name.upper().startswith("TRASH_PANDA_") and name.upper() not in known)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def config_command() -> None:
|
|
47
|
+
"""Show every setting and environment variable with its current value. A value nobody has set is marked (default)."""
|
|
48
|
+
shown = rows()
|
|
49
|
+
table = Table()
|
|
50
|
+
table.add_column("Variable", no_wrap=True)
|
|
51
|
+
table.add_column("Value", overflow="fold")
|
|
52
|
+
for var, value, state in shown:
|
|
53
|
+
cell = Text(value)
|
|
54
|
+
if state == "default":
|
|
55
|
+
cell.append(" (default)", style="dim")
|
|
56
|
+
elif state == "set":
|
|
57
|
+
cell.stylize("bold")
|
|
58
|
+
else:
|
|
59
|
+
cell.append(" (invalid)", style="red")
|
|
60
|
+
table.add_row(var, cell)
|
|
61
|
+
console.print(table)
|
|
62
|
+
|
|
63
|
+
unknown = _unknown({var for var, _, _ in shown})
|
|
64
|
+
if unknown:
|
|
65
|
+
console.print("Not a trash-panda variable, so it is ignored: " + ", ".join(unknown), markup=False)
|
|
66
|
+
if any(state == "invalid" for _, _, state in shown):
|
|
67
|
+
console.print("A value marked invalid cannot be read, and the library raises an error when it runs.", markup=False)
|
|
68
|
+
raise typer.Exit(1)
|
|
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
|
|
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
|