Bluefog-Lib / Bluefog-Lib/bluefog

Model trained by AWC style cannot be saved

Open
#103 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
257
Forks
50
PR merge metrics
No merged PRs in 30d

Description

The model trained by neighbor_allreduce optimizer and awc communication style cannot be saved with the command "torch.save()". See the error information below.

The possible reason might be in make_hook function in optimizer.py

==================
File "XXX.py", line 227, in
torch.save(model, tmp_path)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 328, in save
_legacy_save(obj, opened_file, pickle_module, pickle_protocol)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 401, in _legacy_save
pickler.dump(obj)
AttributeError: Can't pickle local object '_DistributedReduceOptimizer._make_hook..hook'

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in optimizer.py at the _DistributedReduceOptimizer.make_hook function and reproduce the failure with the neighbor_allreduce optimizer, AWC communication style, and torch.save(model, tmp_path). Trace the generated hook involved in serialization; done means the trained model can be saved without the local-object pickle error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.