b10-transfer 0.0.1__tar.gz → 0.0.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.
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/PKG-INFO +1 -1
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/pyproject.toml +1 -1
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/__init__.py +1 -1
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/torch_cache.py +13 -3
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/README.md +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/archive.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/async_torch_cache.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/async_transfers.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/cleanup.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/constants.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/core.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/environment.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/info.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/space_monitor.py +0 -0
- {b10_transfer-0.0.1 → b10_transfer-0.0.2}/src/b10_transfer/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: b10-transfer
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.2
|
4
4
|
Summary: Distributed PyTorch compilation cache for Baseten - Environment-aware, lock-free compilation cache management
|
5
5
|
License: MIT
|
6
6
|
Keywords: pytorch,torch.compile,cache,machine-learning,inference
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
4
4
|
|
5
5
|
[tool.poetry]
|
6
6
|
name = "b10-transfer"
|
7
|
-
version = "0.0.
|
7
|
+
version = "0.0.2"
|
8
8
|
description = "Distributed PyTorch compilation cache for Baseten - Environment-aware, lock-free compilation cache management"
|
9
9
|
authors = ["Shounak Ray <shounak.noreply@baseten.co>", "Fred Liu <fred.liu.noreply@baseten.co>"]
|
10
10
|
maintainers = ["Fred Liu <fred.liu.noreply@baseten.co>", "Shounak Ray <shounak.noreply@baseten.co>"]
|
@@ -40,7 +40,7 @@ logger = logging.getLogger(__name__)
|
|
40
40
|
|
41
41
|
|
42
42
|
def torch_cache_save_callback(
|
43
|
-
source_dir: Path, dest_file: Path, max_size_mb: int
|
43
|
+
source_dir: Path, dest_file: Path, max_size_mb: int = None, *args, **kwargs
|
44
44
|
) -> None:
|
45
45
|
"""Callback function for saving torch cache: compress then copy to b10fs.
|
46
46
|
|
@@ -51,8 +51,14 @@ def torch_cache_save_callback(
|
|
51
51
|
Args:
|
52
52
|
source_dir: Path to the torch cache directory to compress
|
53
53
|
dest_file: Path to the final cache file in b10fs
|
54
|
-
max_size_mb: Maximum allowed archive size in megabytes
|
54
|
+
max_size_mb: Maximum allowed archive size in megabytes (can be passed as kwarg)
|
55
|
+
*args: Additional arguments passed by the transfer system (ignored)
|
56
|
+
**kwargs: Additional keyword arguments passed by the transfer system (may contain max_size_mb)
|
55
57
|
"""
|
58
|
+
# Handle max_size_mb from kwargs if not provided as positional argument
|
59
|
+
if max_size_mb is None:
|
60
|
+
max_size_mb = kwargs.get("max_size_mb", MAX_CACHE_SIZE_MB)
|
61
|
+
|
56
62
|
work_dir = Path(LOCAL_WORK_DIR)
|
57
63
|
|
58
64
|
# Create temporary archive in local work directory
|
@@ -99,7 +105,9 @@ def torch_cache_save_callback(
|
|
99
105
|
raise
|
100
106
|
|
101
107
|
|
102
|
-
def torch_cache_load_callback(
|
108
|
+
def torch_cache_load_callback(
|
109
|
+
source_file: Path, dest_dir: Path, *args, **kwargs
|
110
|
+
) -> None:
|
103
111
|
"""Callback function for loading torch cache: copy from b10fs then extract.
|
104
112
|
|
105
113
|
This function handles the torch-specific load logic:
|
@@ -109,6 +117,8 @@ def torch_cache_load_callback(source_file: Path, dest_dir: Path) -> None:
|
|
109
117
|
Args:
|
110
118
|
source_file: Path to the cache file in b10fs
|
111
119
|
dest_dir: Path to the torch cache directory where files will be extracted
|
120
|
+
*args: Additional arguments passed by the transfer system (ignored)
|
121
|
+
**kwargs: Additional keyword arguments passed by the transfer system (ignored)
|
112
122
|
"""
|
113
123
|
work_dir = Path(LOCAL_WORK_DIR)
|
114
124
|
|
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
|