libinephany 0.15.1__tar.gz → 0.15.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.
- libinephany-0.15.3/CODE_VERSION.cfg +1 -0
- {libinephany-0.15.1/libinephany.egg-info → libinephany-0.15.3}/PKG-INFO +1 -1
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observation_utils.py +15 -1
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/statistic_trackers.py +22 -18
- {libinephany-0.15.1 → libinephany-0.15.3/libinephany.egg-info}/PKG-INFO +1 -1
- libinephany-0.15.1/CODE_VERSION.cfg +0 -1
- {libinephany-0.15.1 → libinephany-0.15.3}/LICENSE +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/MANIFEST.in +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/README.md +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/aws/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/aws/s3_functions.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observer_pipeline.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/base_observers.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/global_observers.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/local_observers.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/observer_containers.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/pipeline_coordinator.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/post_processors/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/post_processors/postprocessors.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/statistic_manager.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/configs/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/configs/hyperparameter_configs.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/configs/observer_config.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/configs/outer_model_config.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/agent_info.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/inner_task_profile.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/observation_models.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/request_schemas.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/response_schemas.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/tensor_statistics.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/states/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/states/hyperparameter_states.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/agent_utils.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/asyncio_worker.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/backend_statuses.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/constants.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/directory_utils.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/dropout_utils.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/enums.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/error_severities.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/exceptions.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/import_utils.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/optim_utils.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/random_seeds.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/samplers.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/standardizers.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/torch_distributed_utils.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/torch_utils.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/transforms.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/utils/typing.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/web_apps/__init__.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/web_apps/error_logger.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany/web_apps/web_app_utils.py +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany.egg-info/SOURCES.txt +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany.egg-info/dependency_links.txt +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany.egg-info/requires.txt +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/libinephany.egg-info/top_level.txt +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/pyproject.toml +0 -0
- {libinephany-0.15.1 → libinephany-0.15.3}/setup.cfg +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
0.15.3
|
@@ -173,7 +173,21 @@ def tensor_on_local_rank(tensor: torch.Tensor | None) -> bool:
|
|
173
173
|
:return: Whether the tensor is owned by the local rank.
|
174
174
|
"""
|
175
175
|
|
176
|
-
|
176
|
+
valid_tensor = tensor is not None and tensor.numel() > 0
|
177
|
+
device_index = tensor.device.index if valid_tensor else None
|
178
|
+
|
179
|
+
xpu_available = torch.xpu.is_available()
|
180
|
+
cuda_available = torch.cuda.is_available()
|
181
|
+
|
182
|
+
if valid_tensor and xpu_available and tensor.is_xpu:
|
183
|
+
current_device = torch.xpu.current_device()
|
184
|
+
return device_index == current_device
|
185
|
+
|
186
|
+
elif valid_tensor and cuda_available and tensor.is_cuda:
|
187
|
+
current_device = torch.cuda.current_device()
|
188
|
+
return device_index == current_device
|
189
|
+
|
190
|
+
return valid_tensor
|
177
191
|
|
178
192
|
|
179
193
|
def form_update_tensor(
|
@@ -193,13 +193,14 @@ class Statistic(ABC):
|
|
193
193
|
Processes the tensor cache to build a TensorStatistic model.
|
194
194
|
"""
|
195
195
|
|
196
|
-
|
197
|
-
|
196
|
+
if self._tensor_cache:
|
197
|
+
concatenated = torch.cat(self._tensor_cache)
|
198
|
+
self._tensor_cache = []
|
198
199
|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
200
|
+
statistics = TensorStatistics.build(
|
201
|
+
tensor=concatenated, skip_statistics=self.skip_statistics, sample_percentage=self.downsample_percent
|
202
|
+
)
|
203
|
+
self._data.append(statistics) # type: ignore
|
203
204
|
|
204
205
|
@staticmethod
|
205
206
|
@final
|
@@ -281,7 +282,6 @@ class Statistic(ABC):
|
|
281
282
|
|
282
283
|
parameter_group = self._find_parameter_group(optimizer=optimizer)
|
283
284
|
parameters = self._get_parameters(parameter_group=parameter_group)
|
284
|
-
self._sample_number += 1
|
285
285
|
|
286
286
|
if self._sample_number % self.sample_frequency == 0:
|
287
287
|
statistic = self._gather(
|
@@ -290,18 +290,18 @@ class Statistic(ABC):
|
|
290
290
|
|
291
291
|
statistic = self._distributed_reduce(statistic=statistic)
|
292
292
|
|
293
|
-
if
|
294
|
-
|
293
|
+
if torch_distributed_utils.is_scheduler_master_rank():
|
294
|
+
if isinstance(statistic, torch.Tensor):
|
295
|
+
statistic = statistic.view(-1)
|
296
|
+
self._tensor_cache.append(statistic)
|
295
297
|
|
296
|
-
|
297
|
-
|
298
|
-
self._tensor_cache.append(statistic)
|
298
|
+
if len(self._tensor_cache) >= self.max_cache_size:
|
299
|
+
self._process_tensor_cache()
|
299
300
|
|
300
|
-
|
301
|
-
self.
|
301
|
+
elif statistic is not None:
|
302
|
+
self._data.append(statistic) # type: ignore
|
302
303
|
|
303
|
-
|
304
|
-
self._data.append(statistic) # type: ignore
|
304
|
+
self._sample_number += 1
|
305
305
|
|
306
306
|
@final
|
307
307
|
def fetch(self) -> TensorStatistics | float | None:
|
@@ -403,7 +403,9 @@ class FirstOrderGradients(Statistic):
|
|
403
403
|
:return: None, TensorStatistics model or a float.
|
404
404
|
"""
|
405
405
|
|
406
|
-
gradients = [
|
406
|
+
gradients = [
|
407
|
+
p.grad.view(-1) for p in parameters if observation_utils.tensor_on_local_rank(p) and p.grad is not None
|
408
|
+
]
|
407
409
|
|
408
410
|
if not gradients:
|
409
411
|
return None
|
@@ -495,7 +497,9 @@ class SecondOrderGradients(Statistic):
|
|
495
497
|
:return: None, TensorStatistics model or a float.
|
496
498
|
"""
|
497
499
|
|
498
|
-
fo_gradients = [
|
500
|
+
fo_gradients = [
|
501
|
+
p.grad.view(-1) for p in parameters if observation_utils.tensor_on_local_rank(p) and p.grad is not None
|
502
|
+
]
|
499
503
|
|
500
504
|
if not fo_gradients:
|
501
505
|
return None
|
@@ -1 +0,0 @@
|
|
1
|
-
0.15.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
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/base_observers.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/global_observers.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/local_observers.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/observers/observer_containers.py
RENAMED
File without changes
|
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/post_processors/__init__.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/observations/post_processors/postprocessors.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/configs/observer_config.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/configs/outer_model_config.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/inner_task_profile.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/observation_models.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/request_schemas.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/response_schemas.py
RENAMED
File without changes
|
{libinephany-0.15.1 → libinephany-0.15.3}/libinephany/pydantic_models/schemas/tensor_statistics.py
RENAMED
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
|