You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the recent update to PyTorch 2.3.0, petals encounters an import error when using the torch.cuda.amp.grad_scaler module. The specific error message is: ImportError: cannot import name '_refresh_per_optimizer_state' from 'torch.cuda.amp.grad_scaler' site-packages/torch/cuda/amp/grad_scaler.py)
The issue is due to changes in the new PyTorch version that are currently incompatible with current codebase.
Quick Workaround
Resolve this issue, by simply reverting the PyTorch version specified in setup.cfg from 'torch>=1.12' to 'torch==2.2.2', which is the last version known to work without this problem. Just so it works stably while I investigate changes in new pytorch and make the codebase to be compatible with PyTorch 2.3.0 or later.
* Pin PyTorch version to 2.2.2 to resolve import error
Addressing the import error encountered with PyTorch 2.3.0 as detailed in issue #576.
fixes#576
* Update setup.cfg
Modified the version constraint for PyTorch in setup.cfg to torch>=1.12,<2.3.0 to avoid the import errors introduced in version 2.3.0 while still supporting earlier compatible versions. This change follows feedback from @mryab to allow flexibility for users on different versions.
Problem Description
After the recent update to PyTorch 2.3.0, petals encounters an import error when using the
torch.cuda.amp.grad_scaler
module. The specific error message is:ImportError: cannot import name '_refresh_per_optimizer_state' from 'torch.cuda.amp.grad_scaler' site-packages/torch/cuda/amp/grad_scaler.py)
The issue is due to changes in the new PyTorch version that are currently incompatible with current codebase.
Quick Workaround
Resolve this issue, by simply reverting the PyTorch version specified in
setup.cfg
from 'torch>=1.12' to 'torch==2.2.2', which is the last version known to work without this problem. Just so it works stably while I investigate changes in new pytorch and make the codebase to be compatible with PyTorch 2.3.0 or later.Steps to Reproduce
Information
Action
Submitting a pull request to modifying the
install_requires
in oursetup.cfg
as described above, pending team feedback on this issue.The text was updated successfully, but these errors were encountered: