-
Notifications
You must be signed in to change notification settings - Fork 4
Bug Fix - Fix checkpointing #87
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. | ||
|
|
||
| """ Storage writer for PyT Distributed format allowing asynchronous save. """ | ||
| """Storage writer for PyT Distributed format allowing asynchronous save.""" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not related to bug fix, shall we drop it? |
||
| import dataclasses | ||
| import inspect | ||
| import logging | ||
| import os | ||
| import queue | ||
|
|
@@ -314,16 +315,25 @@ def write_preloaded_data( | |
| local_results = [] | ||
| try: | ||
| file_name, storage_key, (bytes_data, tensor_data) = write_bucket | ||
| extra_kwargs = {} | ||
| if "serialization_format" in inspect.signature(_write_item).parameters: | ||
| from torch.distributed.checkpoint.filesystem import SerializationFormat | ||
|
|
||
| extra_kwargs['serialization_format'] = SerializationFormat.TORCH_SAVE | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously there is no issue here, is this due to an upgrade of PyTorch? Shall we put the reason of change in PR description |
||
| with open(file_name, "wb") as stream: | ||
| for write_item, data in bytes_data: | ||
| local_results.append( | ||
| _write_item(*transform_list, stream, data, write_item, storage_key) | ||
| _write_item( | ||
| *transform_list, stream, data, write_item, storage_key, **extra_kwargs | ||
| ) | ||
| ) | ||
|
|
||
| for write_item, tensor in tensor_data: | ||
| assert tensor.is_cpu | ||
| local_results.append( | ||
| _write_item(*transform_list, stream, tensor, write_item, storage_key) | ||
| _write_item( | ||
| *transform_list, stream, tensor, write_item, storage_key, **extra_kwargs | ||
| ) | ||
| ) | ||
|
|
||
| if use_fsync: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this due to that
np.productis deprecated? Can we make this unchanged?