dumpsterpanda 0.2.2__tar.gz → 0.2.3__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.2 → dumpsterpanda-0.2.3}/PKG-INFO +1 -1
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/pyproject.toml +1 -1
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/__init__.py +1 -1
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/cli/app.py +3 -1
- dumpsterpanda-0.2.3/src/trash_panda/cli/hardware.py +71 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/hardware.py +7 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/LICENSE +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/README.md +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/cli/__init__.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/cli/config.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/cli/info.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/cli/names.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/cli/plan.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/cli/trace.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/__init__.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/blocks.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/checkpoint.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/config.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/coordinator.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/depth.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/early.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/formats.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/hooks.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/loader.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/measure.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/order_file.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/planner.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/report.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/stage.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/offload/trace.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/paths.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/__init__.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/load.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/server.py +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/app.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/bars.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/data.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/files.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/index.html +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/memory.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/memorychart.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/package.json +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/panels.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/style.css +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/svg.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/src/trash_panda/ui/static/timeline.js +0 -0
- {dumpsterpanda-0.2.2 → dumpsterpanda-0.2.3}/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.3"
|
|
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 = (
|
|
@@ -6,6 +6,7 @@ except ImportError:
|
|
|
6
6
|
raise SystemExit("The command line needs extra packages: pip install 'dumpsterpanda[cli]'")
|
|
7
7
|
|
|
8
8
|
from .config import config_command
|
|
9
|
+
from .hardware import hardware_command
|
|
9
10
|
from .info import info_command
|
|
10
11
|
from .plan import plan_command
|
|
11
12
|
from .trace import trace_command
|
|
@@ -15,13 +16,14 @@ app = typer.Typer(no_args_is_help=True, add_completion=False, help="trash-panda:
|
|
|
15
16
|
|
|
16
17
|
@app.callback()
|
|
17
18
|
def _root() -> None:
|
|
18
|
-
"""The root of the commands: `trash-panda plan ...`, `trash-panda info ...`, `trash-panda trace ...`, `trash-panda config`."""
|
|
19
|
+
"""The root of the commands: `trash-panda plan ...`, `trash-panda info ...`, `trash-panda trace ...`, `trash-panda config`, `trash-panda hardware`."""
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
app.command("plan")(plan_command)
|
|
22
23
|
app.command("info")(info_command)
|
|
23
24
|
app.command("trace")(trace_command)
|
|
24
25
|
app.command("config")(config_command)
|
|
26
|
+
app.command("hardware")(hardware_command)
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
def main() -> None:
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"""`trash-panda hardware`: what this machine has, for a bug report."""
|
|
2
|
+
|
|
3
|
+
import platform
|
|
4
|
+
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from rich.table import Table
|
|
7
|
+
from rich.text import Text
|
|
8
|
+
|
|
9
|
+
console = Console()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _gib(n) -> str:
|
|
13
|
+
"""Bytes in GiB (1024 ** 3), the unit that memory is sold and shown in, unlike the decimal GB of the rest of the library."""
|
|
14
|
+
return f"{n / 1024 ** 3:.2f} GiB"
|
|
15
|
+
|
|
16
|
+
# What the rows that need a word of explanation mean. A row that is not here has an empty note.
|
|
17
|
+
NOTES = {
|
|
18
|
+
"Device": "Where a model runs by default.",
|
|
19
|
+
"Unified memory": "The GPU and the CPU share one memory pool, so splitting a model between them frees nothing.",
|
|
20
|
+
"Commit headroom": "Windows: how much more memory the system lets programs reserve (RAM plus page file).",
|
|
21
|
+
"CUDA": "The CUDA version this PyTorch was built for.",
|
|
22
|
+
"Compute capability": "The GPU's architecture version, which decides what it supports.",
|
|
23
|
+
"bf16": "The GPU supports bfloat16, a 16-bit float format used as a compute dtype.",
|
|
24
|
+
"Native fp8": "The GPU computes in fp8 itself (compute capability 8.9 or higher).",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def rows() -> list:
|
|
29
|
+
"""(item, value) for each fact about this machine, in the order they are printed."""
|
|
30
|
+
import torch
|
|
31
|
+
|
|
32
|
+
from .. import __version__
|
|
33
|
+
from ..offload.hardware import detect_hardware
|
|
34
|
+
|
|
35
|
+
hw = detect_hardware()
|
|
36
|
+
out = [
|
|
37
|
+
("trash-panda", f"v{__version__}"),
|
|
38
|
+
("Python", f"v{platform.python_version()}"),
|
|
39
|
+
("PyTorch", f"v{torch.__version__}"),
|
|
40
|
+
("OS", f"{platform.system()} {platform.release()} {platform.version()} ({platform.machine()})"),
|
|
41
|
+
("Device", hw.device),
|
|
42
|
+
("Unified memory", "yes" if hw.unified_memory else "no"),
|
|
43
|
+
("RAM", f"{_gib(hw.ram_available)} available of {_gib(hw.ram_total)}"),
|
|
44
|
+
]
|
|
45
|
+
if hw.commit_available is not None:
|
|
46
|
+
out.append(("Commit headroom", _gib(hw.commit_available)))
|
|
47
|
+
if hw.device == "cuda":
|
|
48
|
+
out += [
|
|
49
|
+
("GPU", hw.gpu_name),
|
|
50
|
+
("VRAM", f"{_gib(hw.vram_free)} free of {_gib(hw.vram_total)}"),
|
|
51
|
+
("CUDA", f"v{torch.version.cuda}" if torch.version.cuda else "none"),
|
|
52
|
+
("Compute capability", ".".join(str(n) for n in hw.compute_capability)),
|
|
53
|
+
("bf16", "yes" if hw.bf16_supported else "no"),
|
|
54
|
+
("Native fp8", "yes" if hw.native_fp8 else "no"),
|
|
55
|
+
]
|
|
56
|
+
elif hw.unified_memory:
|
|
57
|
+
out.append(("GPU memory", "shared with RAM"))
|
|
58
|
+
else:
|
|
59
|
+
out.append(("GPU", "none detected"))
|
|
60
|
+
return out
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def hardware_command() -> None:
|
|
64
|
+
"""Print the device, memory and versions of this machine. Paste it into a bug report."""
|
|
65
|
+
table = Table()
|
|
66
|
+
table.add_column("Item", no_wrap=True)
|
|
67
|
+
table.add_column("Value", no_wrap=True)
|
|
68
|
+
table.add_column("Note", overflow="fold")
|
|
69
|
+
for item, value in rows():
|
|
70
|
+
table.add_row(item, Text(str(value)), Text(NOTES.get(item, ""), style="dim"))
|
|
71
|
+
console.print(table)
|
|
@@ -23,6 +23,8 @@ class Hardware:
|
|
|
23
23
|
compute_capability: Optional[Tuple[int, int]] = None
|
|
24
24
|
bf16_supported: bool = False
|
|
25
25
|
native_fp8: bool = False
|
|
26
|
+
device: str = "cpu" # where a model runs by default: "cuda", "mps" or "cpu"
|
|
27
|
+
unified_memory: bool = False # the device shares its memory with the CPU
|
|
26
28
|
|
|
27
29
|
def summary(self) -> str:
|
|
28
30
|
lines = []
|
|
@@ -127,6 +129,7 @@ def _read_ram() -> Tuple[int, int, Optional[int]]:
|
|
|
127
129
|
def detect_hardware(device_index: int = 0) -> Hardware:
|
|
128
130
|
hw = Hardware()
|
|
129
131
|
if torch.cuda.is_available():
|
|
132
|
+
hw.device = "cuda"
|
|
130
133
|
props = torch.cuda.get_device_properties(device_index)
|
|
131
134
|
free, total = torch.cuda.mem_get_info(device_index)
|
|
132
135
|
hw.vram_total, hw.vram_free = int(total), int(free)
|
|
@@ -134,5 +137,9 @@ def detect_hardware(device_index: int = 0) -> Hardware:
|
|
|
134
137
|
hw.compute_capability = (props.major, props.minor)
|
|
135
138
|
hw.bf16_supported = bool(torch.cuda.is_bf16_supported())
|
|
136
139
|
hw.native_fp8 = hw.compute_capability >= (8, 9)
|
|
140
|
+
hw.unified_memory = bool(getattr(props, "is_integrated", False))
|
|
141
|
+
elif getattr(torch.backends, "mps", None) and torch.backends.mps.is_available():
|
|
142
|
+
hw.device = "mps"
|
|
143
|
+
hw.unified_memory = True
|
|
137
144
|
hw.ram_total, hw.ram_available, hw.commit_available = _read_ram()
|
|
138
145
|
return hw
|
|
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
|