NVIDIA / apex

A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch
BSD 3-Clause "New" or "Revised" License
8.42k stars 1.4k forks source link

apex not installing #1793

Open pradeepdev-1995 opened 7 months ago

pradeepdev-1995 commented 7 months ago

The installation command i tried

pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --global-option="--cpp_ext" --global-option="--cuda_ext" ./

But it gives the error

/opt/conda/lib/python3.10/site-packages/pip/_internal/commands/install.py:283: UserWarning: Disabling all use of wheels due tothe use of --build-options / --global-options / --install-options.
  cmdoptions.check_install_build_global(options)
Created temporary directory: /tmp/pip-target-xzwjdm9j
Created temporary directory: /tmp/pip-ephem-wheel-cache-9_tu9d2w
Created temporary directory: /tmp/pip-req-tracker-ii7mjuxy
Created requirements tracker '/tmp/pip-req-tracker-ii7mjuxy'
Created temporary directory: /tmp/pip-install-nfm6xcv4
Processing /home/mosaic-ai/apex
  Created temporary directory: /tmp/pip-req-build-4264dkv6
  Added file:///home/mosaic-ai/apex to build tracker '/tmp/pip-req-tracker-ii7mjuxy'
    Created temporary directory: /tmp/pip-modern-metadata-0lqerevd
    Running command /opt/conda/bin/python /opt/conda/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpkdwdhfmh

    torch.__version__  = 2.2.2+cu121

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
        main()
      File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py", line 110, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip_packages/setuptools/build_meta.py", line 366, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/tmp/pip_packages/setuptools/build_meta.py", line 311, in run_setup
        exec(code, locals())
      File "<string>", line 137, in <module>
      File "<string>", line 24, in get_cuda_bare_metal_version
    TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
    Preparing wheel metadata ... error
Cleaning up...
  Removing source in /tmp/pip-req-build-4264dkv6
Removed file:///home/mosaic-ai/apex from build tracker '/tmp/pip-req-tracker-ii7mjuxy'
Removed build tracker '/tmp/pip-req-tracker-ii7mjuxy'
ERROR: Command errored out with exit status 1: /opt/conda/bin/python /opt/conda/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpkdwdhfmh Check the logs for full command output.
Exception information:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 153, in _main
    status = self.run(options, args)
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 382, in run
    resolver.resolve(requirement_set)
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/legacy_resolve.py", line 201, in resolve
    self._resolve_one(requirement_set, req)
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/legacy_resolve.py", line 365, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/legacy_resolve.py", line 312, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 223, in prepare_linked_requirement
    abstract_dist = _get_prepared_distribution(
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/operations/prepare.py", line 49, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(finder, build_isolation)
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/distributions/source/legacy.py", line 39, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/req/req_install.py", line 563, in prepare_metadata
    self.metadata_directory = metadata_generator(self)
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/operations/generate_metadata.py", line 136, in _generate_metadata
    return install_req.prepare_pep517_metadata()
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/req/req_install.py", line 606, in prepare_pep517_metadata
    distinfo_dir = backend.prepare_metadata_for_build_wheel(
  File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pep517/wrappers.py", line 167, in prepare_metadata_for_build_wheel
    return self._call_hook('prepare_metadata_for_build_wheel', {
  File "/opt/conda/lib/python3.10/site-packages/pip/_vendor/pep517/wrappers.py", line 245, in _call_hook
    self._subprocess_runner(
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/utils/subprocess.py", line 271, in runner
    call_subprocess(
  File "/opt/conda/lib/python3.10/site-packages/pip/_internal/utils/subprocess.py", line 242, in call_subprocess
    raise InstallationError(exc_msg)
pip._internal.exceptions.InstallationError: Command errored out with exit status 1: /opt/conda/bin/python /opt/conda/lib/python3.10/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpkdwdhfmh Check the logs for fullcommand output.

versions: Python 3.10.12 pip 19.3.1 torch==2.2.2 CUDA Version: 12.2

base issue : https://github.com/NVIDIA/NeMo/issues/8814