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

Apex install no packaging fix #5508

Open
zoeyhuang-msft opened this issue Jun 20, 2024 · 0 comments
Open

Apex install no packaging fix #5508

zoeyhuang-msft opened this issue Jun 20, 2024 · 0 comments

Comments

@zoeyhuang-msft
Copy link

🐛 Bug

When installing apex, will encounter the ModuleNotFoundError: No module named 'packaging'.

To Reproduce

Steps to reproduce the behavior (always include the command you ran):

  1. Run cmd 'pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" \

--global-option="--deprecated_fused_adam" --global-option="--xentropy"
--global-option="--fast_multihead_attn" ./'

  1. See error
    Using pip 24.0 from /anaconda/envs/valle/lib/python3.9/site-packages/pip (python 3.9)
    DEPRECATION: --build-option and --global-option are deprecated. pip 24.2 will enforce this behaviour change. A possible replacement is to use --config-settings. Discussion can be found at
    Deprecate --global-option and --build-option pypa/pip#11859
    WARNING: Implying --no-binary=:all: due to the presence of --build-option / --global-option.
    Processing /mnt/batch/tasks/shared/LS_root/mounts/clusters/zoeyhuang/code/Users/IALL-E/Users/Valle/VALL-E/valle/apex
    Running command pip subprocess to install build dependencies
    Collecting setuptools
    Downloading setuptools-70.1.0.tar.gz (2.3 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 24.2 MB/s eta 0:00:00
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
    Collecting wheel
    Downloading wheel-0.43.0.tar.gz (99 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.1/99.1 kB 7.3 MB/s eta 0:00:00
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
    Building wheels for collected packages: setuptools, wheel
    Building wheel for setuptools (pyproject.toml): started
    Building wheel for setuptools (pyproject.toml): finished with status 'done'
    Created wheel for setuptools: filename=setuptools-70.1.0-py3-none-any.whl size=882588 sha256=50db38d9350d6405bb005ecb6903ba4c30f6069740e7536257010ff9e90efec7
    Stored in directory: /home/azureuser/.cache/pip/wheels/b9/92/8b/9f686f8339d88b19bd5f85bd74b15b9f07bfb245a56b6f144b
    Building wheel for wheel (pyproject.toml): started
    Building wheel for wheel (pyproject.toml): finished with status 'done'
    Created wheel for wheel: filename=wheel-0.43.0-py3-none-any.whl size=65775 sha256=55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81
    Stored in directory: /home/azureuser/.cache/pip/wheels/de/73/b8/c38a8ca689d63aec8f946472520d20faaab7d7fe1c84c0794b
    Successfully built setuptools wheel
    Installing collected packages: wheel, setuptools
    Successfully installed setuptools-70.1.0 wheel-0.43.0
    Installing build dependencies ... done
    Running command Getting requirements to build wheel
    Traceback (most recent call last):
    File "/anaconda/envs/valle/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
    main()
    File "/anaconda/envs/valle/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/anaconda/envs/valle/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
    File "/tmp/pip-build-env-0n80blrg/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=[])
    File "/tmp/pip-build-env-0n80blrg/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
    self.run_setup()
    File "/tmp/pip-build-env-0n80blrg/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup
    exec(code, locals())
    File "", line 5, in
    ModuleNotFoundError: No module named 'packaging'
    error: subprocess-exited-with-error
    × Getting requirements to build wheel did not run successfully.
    │ exit code: 1
    ╰─> See above for output.
    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: /anaconda/envs/valle/bin/python /anaconda/envs/valle/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpz0wcvpyb
    cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/zoeyhuang/code/Users/IALL-E/Users/Valle/VALL-E/valle/apex
    Getting requirements to build wheel ... error
    error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.`

Expected behavior

Apex module successfully installed.

Environment

  • fairseq Version (main):
  • PyTorch Version (2.0.0+cu117)
  • OS (Linux):
  • How you installed fairseq (source):
  • Build command you used (if compiling from source): python setup.py install
  • Python version:
  • CUDA/cuDNN version: 12.2
  • GPU models and configuration: V100
  • Any other relevant information:

Propose Fix

add the --no-build-isolation argument in the command
pip install -v --no-build-isolation --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--deprecated_fused_adam" --global-option="--xentropy" --global-option="--fast_multihead_attn" ./

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

No branches or pull requests

1 participant