Comments (3)
And now there is no direct method to load full dcp saved state dict as torch.load does, while finding there is a dcp_to_torch_save
impl. in dcp.format_utils, maybe we can make is better accessable by adding a function like dcp_to_torch_save
but just return the state_dict? for example:
def dcp_load(
dcp_checkpoint_dir: Union[str, os.PathLike],
no_dist=True,
):
"""
Given a directory containing a DCP checkpoint, this function will load it into a
state dict and return it as torch.load does.
Args:
dcp_checkpoint_dir: Directory containing the DCP checkpoint.
.. warning::
To avoid OOM, it's recommended to only run this function on a single rank.
"""
sd: STATE_DICT_TYPE = {}
_load_state_dict(
sd,
storage_reader=FileSystemReader(dcp_checkpoint_dir),
planner=_EmptyStateDictLoadPlanner(),
no_dist=no_dist,
)
return sd
by using this method we can check that dcp.async_save do save other values (state_dict['epoch']==20 in that case), but dcp.load is not updating the dict
from pytorch.
cc., @LucasLLC
from pytorch.
Looking into this, thanks @ultranity
from pytorch.
Related Issues (20)
- `torch.compiler.allow_in_graph` does not create a `call_module` op in fx.Graph in torch 2.3.0
- codegen error on .item() as a Triton kernel arg
- RuntimeError when using Adam(fused=True) with torch.compile
- DCP sees 1/2 of the expected size of each tensor in 3D parallel
- [Pipelining] Support for uneven microbatch sizes
- Distributed Checkpoint doesn't verify shapes are correct
- UserWarning: Plan failed with a cudnnException: CUDNN_BACKEND_EXECUTION_PLAN_DESCRIPTOR
- [ONNX] export() with dynamic shapes fails when only part of input dimensions are dynamic HOT 2
- `aten.index_put_` runtime shape mismatch HOT 1
- FSDP hangs when combing MoE architecture
- inductor compile failling for batched tensor on fuse
- OnnxExporterError using dynamo_export
- compile inductor falling operator βat::vec::CPU_CAPABILITY::VectorizedN<long int, 2>β and βintβ
- dataloader crashes after several epochs if the trained model contains triton-based operators HOT 1
- Avoid calling torch.cuda.synchronize in precompile_config
- torch.optim.LBFGS isuue HOT 1
- [pipelining] Add back support for multi-use parameters/buffers
- `torch.get_default_device()` gets error while `torch.set_default_device()` doesn't HOT 2
- Test failures with new configs in test_grad_scaling_autocast in test_torch.py
- Libtorch build for ROCM error: βaten/src/THHβ not exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.