Closed musunita closed 2 months ago
Hi @musunita,
It seems to be an issue from the setup. If you are testing for Optimum Neuron v0.0.21, could you try the following under a clean environment?
git clone --depth 1 --branch v0.0.21 https://github.com/huggingface/optimum-neuron.git
pip install .[tests]
Thanks for the quick reply. I am not seeing previous error. New error is as below.
revision: Optional[str] = None,
use_auth_token: Union[bool, str] = True,
endpoint: Optional[str] = None,
) -> str:
if isinstance(use_auth_token, str):
huggingface_token = use_auth_token
elif use_auth_token:
huggingface_token = HfFolder.get_token()
else:
> raise ValueError("You need to provide `use_auth_token` to be able to push to the hub")
E ValueError: You need to provide `use_auth_token` to be able to push to the hub
optimum/neuron/modeling_base.py:374: ValueError
Where to specify the token in the test?
Could you point me to the test you are facing this error?
You could specify the HF token like the following:
HF_TOKEN=xxxxxxx python -m pytest -m is_inferentia_test tests
But need to see if the test is pushing to the staging hub or the real HF hub.
Repo errors are listed in the attached log. There are multiple repo errors even with write token. output3inf1.txt .
Hi @musunita thanks for the log. It's due to the fact that your token doesn't have write access to the optimum org. We have push_to_hub
by default in our tests to ensure the test models under our org are always up to date, it's not necessary for users outside the org to launch the tests.
PR #585 shall make it easier for you to launch tests.
System Info
(aws_neuron_venv) ubuntu@ip-10-4-210-72:~/optimum-neuron$ pip list | grep "parameterized" parameterized 0.9.0
================================================================================ test session starts ================================================================================= platform linux -- Python 3.8.10, pytest-8.1.1, pluggy-1.4.0 rootdir: /home/ubuntu/optimum-neuron configfile: pyproject.toml plugins: remotedata-0.4.1, xdist-3.5.0, timeout-2.3.1 collected 0 items / 19 errors
======================================================================================= ERRORS ======================================================================================= _ ERROR collecting tests/cache/test_neuronxcache.py ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/cache/test_neuronx_cache.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/lib/python3.8/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/cache/test_neuronx_cache.py:29: in
from optimum.neuron import (
optimum/neuron/init.py:18: in
from transformers.utils import _LazyModule
E ImportError: cannot import name '_LazyModule' from 'transformers.utils' (/home/ubuntu/.local/lib/python3.8/site-packages/transformers/utils/init.py)
_____ ERROR collecting tests/cli/test_export_cli.py ____
ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/cli/test_export_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/cli/test_export_cli.py:20: in
from optimum.exporters.neuron.model_configs import * # noqa: F403
optimum/exporters/neuron/ init.py:17: in
from transformers.utils import _LazyModule
E ImportError: cannot import name '_LazyModule' from 'transformers.utils' (/home/ubuntu/.local/lib/python3.8/site-packages/transformers/utils/ init.py)
_ ERROR collecting tests/cli/test_export_decoder_cli.py
ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/cli/test_export_decoder_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/cli/test_export_decoder_cli.py:7: in
from optimum.neuron.utils.testing_utils import is_inferentia_test, requires_neuronx
optimum/neuron/init.py:18: in
from transformers.utils import _LazyModule
E ImportError: cannot import name '_LazyModule' from 'transformers.utils' (/home/ubuntu/.local/lib/python3.8/site-packages/transformers/utils/init.py)
____ ERROR collecting tests/cli/test_neuron_cachecli.py ____
ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/cli/test_neuron_cache_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/cli/test_neuron_cache_cli.py:24: in
from huggingface_hub import HfApi, create_repo, delete_repo
E ImportError: cannot import name 'create_repo' from 'huggingface_hub' (/home/ubuntu/.local/lib/python3.8/site-packages/huggingfacehub/init.py)
____ ERROR collecting tests/distributed/test_common.py __
ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/distributed/test_common.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/distributed/test_common.py:21: in
import safetensors
E ModuleNotFoundError: No module named 'safetensors'
__ ERROR collecting tests/distributed/test_model_parallelization.py __
ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/distributed/test_model_parallelization.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/distributed/test_model_parallelization.py:23: in
from transformers import AutoTokenizer, LlamaForCausalLM
E ImportError: cannot import name 'LlamaForCausalLM' from 'transformers' (unknown location)
____ ERROR collecting tests/distributed/testtraining.py ____
ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/distributed/test_training.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/distributed/test_training.py:21: in
from datasets import load_dataset
E ModuleNotFoundError: No module named 'datasets'
__ ERROR collecting tests/distributed/test_utils.py __
ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/distributed/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/distributed/test_utils.py:24: in
from safetensors.torch import save_file
E ModuleNotFoundError: No module named 'safetensors'
__ ERROR collecting tests/exporters/test_export.py _____
ImportError while importing test module '/home/ubuntu/optimum-neuron/tests/exporters/test_export.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/exporters/test_export.py:24: in
from parameterized import parameterized
E ModuleNotFoundError: No module named 'parameterized'
___ ERROR collecting tests/generation __
/usr/lib/python3.8/importlib/init.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)