fix: accelerator and transformers lib upgrade issue of e2e models
Fix E2E model not working issue, which caused by new API of accelerator and transformers lib
Step to reproduce the bug:
python run_e2e.py hf_bert
Log
Traceback (most recent call last):
File "/home/ubuntu/Code/benchmark/run_e2e.py", line 61, in <module>
Model = load_e2e_model_by_name(args.model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/Code/benchmark/torchbenchmark/e2e.py", line 39, in load_e2e_model_by_name
module = importlib.import_module(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/miniconda3/envs/torchbench/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/home/ubuntu/Code/benchmark/torchbenchmark/e2e_models/hf_bert/__init__.py", line 24, in <module>
from transformers import (
ImportError: cannot import name 'AdamW' from 'transformers' (/home/ubuntu/miniconda3/envs/torchbench/lib/python3.12/site-packages/transformers/__init__.py)
Hi @Code2Life!
Thank you for your pull request and welcome to our community.
Action Required
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
Process
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
Hi @xuzhao9 could u plz review this and help merge it if it make sense ?