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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: b10-transfer
3
- Version: 0.0.1
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.1"
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>"]
@@ -21,7 +21,7 @@ from .info import get_cache_info, list_available_caches
21
21
  from .constants import SaveStatus, LoadStatus, TransferStatus, AsyncTransferStatus
22
22
 
23
23
  # Version
24
- __version__ = "0.0.1"
24
+ __version__ = "0.0.2"
25
25
 
26
26
  __all__ = [
27
27
  "CacheError",
@@ -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(source_file: Path, dest_dir: Path) -> None:
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