Skip to content

Commit

Permalink
Deprecate get_state and remove deprecations (#3017)
Browse files Browse the repository at this point in the history
* Add duration to to_next_epoch

Adds duration to the to_next_epoch function to increment total_wct.

commit-id:5f8ef9be

* Add iteration to TimeUnit

commit-id:e4729f79

* Deprecate get_state and remove deprecations

commit-id:5d87db4b
  • Loading branch information
b-chu committed Feb 27, 2024
1 parent c3fb25d commit 4e178f9
Show file tree
Hide file tree
Showing 9 changed files with 218 additions and 90 deletions.
18 changes: 2 additions & 16 deletions composer/callbacks/mlperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,22 +263,8 @@ def _get_dataloader_stats(self, dataloader: Iterable):
if isinstance(dataloader.dataset, IterableDataset):
num_samples *= dist.get_world_size()
return (dataloader.batch_size, num_samples)
try:
# attempt to import ffcv and test if its an ffcv loader.
import ffcv # type: ignore

warnings.warn(DeprecationWarning('ffcv is deprecated and will be removed in v0.18'))

if isinstance(dataloader, ffcv.loader.Loader):
# Use the cached attribute ffcv.init_traversal_order to compute number of samples
return (
dataloader.batch_size, # type: ignore
len(dataloader.next_traversal_order()) * dist.get_world_size() # type: ignore
)
except ImportError:
pass

raise TypeError(f'torch dataloader or ffcv dataloader required (and ffcv installed)')

raise TypeError(f'torch dataloader required')

def fit_start(self, state: State, logger: Logger) -> None:
if _global_rank_zero():
Expand Down
43 changes: 0 additions & 43 deletions composer/callbacks/utils.py

This file was deleted.

3 changes: 2 additions & 1 deletion composer/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,8 @@ def fsdp_sharded_state_dict_enabled(self):

@property
def fsdp_elastic_sharded_enabled(self):
warnings.warn('state.fsdp_elastic_sharded_enabled is deprecated and will be removed v0.21.0')
warnings.warn('state.fsdp_elastic_sharded_enabled is deprecated and will be removed v0.21.0',
DeprecationWarning)
return self.fsdp_sharded_state_dict_enabled

@property
Expand Down
Loading

0 comments on commit 4e178f9

Please sign in to comment.