pytorch / torchtune

PyTorch native finetuning library
https://pytorch.org/torchtune/main/
BSD 3-Clause "New" or "Revised" License
4.35k stars 440 forks source link

ModuleNotFoundError: No module named 'torchtune.utils.FullModelHFCheckpointer' #1990

Closed jinz2014 closed 1 week ago

jinz2014 commented 1 week ago

The command to install the tools:

pip3 install --pre --upgrade torch torchvision torchaudio torchao --index-url https://download.pytorch.org/whl/nightly/rocm6.2

Running torch tune shows the following error.

ModuleNotFoundError: No module named 'torchtune.utils.FullModelHFCheckpointer'

tginart commented 1 week ago

The installation is finicky. I had to mess around with for a while with a fresh env to make it work. Good luck.

RdoubleA commented 1 week ago

What is your version of torchtune? The module that is failing to import was moved to torchtune.training a couple releases ago, so you may have an outdated version of the library.

Since you've installed the rocm version of pytorch you may need to do something similar for torchtune: pip install --pre torchtune --extra-index-url https://download.pytorch.org/whl/nightly/rocm6.2 --no-cache-dir

jinz2014 commented 1 week ago

Thank you for your comments and suggestions.

pip uninstall torchtune Found existing installation: torchtune 0.3.1 Uninstalling torchtune-0.3.1:

jinz2014 commented 1 week ago

pip install --pre torchtune --extra-index-url https://download.pytorch.org/whl/nightly/rocm6.2 --no-cache-dir

Successfully installed torchtune-0.4.0.dev20241112+rocm6.2

jinz2014 commented 1 week ago

I created a fresh env, but the error is still there.

SalmanMohammadi commented 1 week ago

Hey @jinz2014 - could you share the config you're using? checkpointer._component_ in your config should be torchtune.training.FullModelHFCheckpointer.

jinz2014 commented 1 week ago

@SalmanMohammadi Thanks for the solution.