Skip to content
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

Upgrade to pytorch 1.7 #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

rphlstck
Copy link

@rphlstck rphlstck commented Feb 9, 2024

Upgrade to pytorch 1.7 to allow for evaluation on nvidia ampere GPUs.
Therefore, the allennlp version is bumped and other dependencies are loosened.
Due to higher allennlp version the load_state_dict method breaks for BERT models generated with transformers version 3.0.1 loaded in version 3.3.1, if strict=True.
Note: After running pip install -r requirements.txt you have to manually remove dataclasses by running pip uninstall dataclasses -y. (Probably related to this huggingface/transformers#8638)

Furthermore, make sure that the right cudatoolkit is used via:

conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=11.0 -c pytorch

* Upgrade pytorch version such that nvidia ampere GPUs can be used
* Loosen other dependencies
* Upgrade allennlp to version that supports pytorch 1.7
* The higher allennlp version depends on transformers 3.3.1 which
  introduces breaking changes when loading a BERT model from version
  3.0.1 (position_ids were added to the state_dict)
@NicoZenith
Copy link

Thanks for sharing, did you try with newer versions of torch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants