Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate get_state and remove deprecations #3017

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading