Repository: pytorch/benchmark
Issue: Installation issue with python 3.10 on Ubuntu 22.04
Root cause: External Dependency Breakage

### Summary
Hi, trying to install TorchBench with python 3.10 with the command `python install.py` results in an error & the installation fails. 
However, using `python install.py --continue_on_fail` makes the installation proceed further but there are many failures.
I used the main branches of pytorch, torchvision, and torchaudio to build them from source.
I used python venv instead of conda.

### Failures

```
running setup for torchbench/torchbenchmark/models/BERT_pytorch...OK
running setup for torchbench/torchbenchmark/models/Background_Matting...FAIL
running setup for torchbench/torchbenchmark/models/LearningToPaint...FAIL
running setup for torchbench/torchbenchmark/models/Super_SloMo...FAIL
running setup for torchbench/torchbenchmark/models/alexnet...OK
running setup for torchbench/torchbenchmark/models/basic_gnn_edgecnn...OK
running setup for torchbench/torchbenchmark/models/basic_gnn_gcn...OK
running setup for torchbench/torchbenchmark/models/basic_gnn_gin...OK
running setup for torchbench/torchbenchmark/models/basic_gnn_sage...OK
running setup for torchbench/torchbenchmark/models/cm3leon_generate...SKIP - No install.py is found
running setup for torchbench/torchbenchmark/models/dcgan...OK
running setup for torchbench/torchbenchmark/models/demucs...OK
running setup for torchbench/torchbenchmark/models/densenet121...OK
running setup for torchbench/torchbenchmark/models/detectron2_fasterrcnn_r_101_c4...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_fasterrcnn_r_101_dc5...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_fasterrcnn_r_101_fpn...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_fasterrcnn_r_50_c4...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_fasterrcnn_r_50_dc5...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_fasterrcnn_r_50_fpn...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_fcos_r_50_fpn...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_maskrcnn...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_maskrcnn_r_101_c4...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_maskrcnn_r_101_fpn...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_maskrcnn_r_50_c4...FAIL
running setup for torchbench/torchbenchmark/models/detectron2_maskrcnn_r_50_fpn...FAIL
running setup for torchbench/torchbenchmark/models/dlrm...OK
running setup for torchbench/torchbenchmark/models/doctr_det_predictor...FAIL
running setup for torchbench/torchbenchmark/models/doctr_reco_predictor...FAIL
running setup for torchbench/torchbenchmark/models/drq...FAIL
running setup for torchbench/torchbenchmark/models/fastNLP_Bert...FAIL
running setup for torchbench/torchbenchmark/models/functorch_dp_cifar10...OK
running setup for torchbench/torchbenchmark/models/functorch_maml_omniglot...FAIL
running setup for torchbench/torchbenchmark/models/hf_Albert...FAIL
running setup for torchbench/torchbenchmark/models/hf_Bart...FAIL
running setup for torchbench/torchbenchmark/models/hf_Bert...FAIL
running setup for torchbench/torchbenchmark/models/hf_Bert_large...FAIL
running setup for torchbench/torchbenchmark/models/hf_BigBird...FAIL
running setup for torchbench/torchbenchmark/models/hf_DistilBert...FAIL
running setup for torchbench/torchbenchmark/models/hf_GPT2...FAIL
running setup for torchbench/torchbenchmark/models/hf_GPT2_large...FAIL
running setup for torchbench/torchbenchmark/models/hf_Longformer...FAIL
running setup for torchbench/torchbenchmark/models/hf_Reformer...FAIL
running setup for torchbench/torchbenchmark/models/hf_Roberta_base...FAIL
running setup for torchbench/torchbenchmark/models/hf_T5...FAIL
running setup for torchbench/torchbenchmark/models/hf_T5_base...FAIL
running setup for torchbench/torchbenchmark/models/hf_T5_generate...SKIP - No install.py is found
running setup for torchbench/torchbenchmark/models/hf_T5_large...FAIL
running setup for torchbench/torchbenchmark/models/hf_Whisper...FAIL
running setup for torchbench/torchbenchmark/models/hf_clip...SKIP - No install.py is found
running setup for torchbench/torchbenchmark/models/hf_distil_whisper...FAIL
running setup for torchbench/torchbenchmark/models/lennard_jones...OK
running setup for torchbench/torchbenchmark/models/llama...OK
running setup for torchbench/torchbenchmark/models/llama_v2_7b_16h...FAIL
running setup for torchbench/torchbenchmark/models/llava...FAIL
running setup for torchbench/torchbenchmark/models/maml...OK
running setup for torchbench/torchbenchmark/models/maml_omniglot...FAIL
running setup for torchbench/torchbenchmark/models/microbench_unbacked_tolist_sum...SKIP - No install.py is found
running setup for torchbench/torchbenchmark/models/mnasnet1_0...OK
running setup for torchbench/torchbenchmark/models/mobilenet_v2...OK
running setup for torchbench/torchbenchmark/models/mobilenet_v2_quantized_qat...OK
running setup for torchbench/torchbenchmark/models/mobilenet_v3_large...OK
running setup for torchbench/torchbenchmark/models/moco...OK
running setup for torchbench/torchbenchmark/models/moondream...FAIL
running setup for torchbench/torchbenchmark/models/nanogpt...SKIP - No install.py is found
running setup for torchbench/torchbenchmark/models/nvidia_deeprecommender...OK
running setup for torchbench/torchbenchmark/models/opacus_cifar10...FAIL
running setup for torchbench/torchbenchmark/models/phlippe_densenet...OK
running setup for torchbench/torchbenchmark/models/phlippe_resnet...OK
running setup for torchbench/torchbenchmark/models/pyhpc_equation_of_state...OK
running setup for torchbench/torchbenchmark/models/pyhpc_isoneutral_mixing...OK
running setup for torchbench/torchbenchmark/models/pyhpc_turbulent_kinetic_energy...OK
running setup for torchbench/torchbenchmark/models/pytorch_CycleGAN_and_pix2pix...FAIL
running setup for torchbench/torchbenchmark/models/pytorch_stargan...FAIL
running setup for torchbench/torchbenchmark/models/pytorch_unet...OK
running setup for torchbench/torchbenchmark/models/resnet152...OK
running setup for torchbench/torchbenchmark/models/resnet18...OK
running setup for torchbench/torchbenchmark/models/resnet50...OK
running setup for torchbench/torchbenchmark/models/resnet50_quantized_qat...OK
running setup for torchbench/torchbenchmark/models/resnext50_32x4d...OK
```

### Errors before failures

<details>
checking packages numpy, torch, torchvision, torchaudio are installed, generating constaints...OK
Failed to install torchbenchmark requirements:
b"Collecting git+https://github.com/huggingface/pytorch-image-models.git@730b907 (from -r requirements.txt (line 12))\n  Cloning https://github.com/huggingface/pytorch-image-models.git (to revision 730b907) to /tmp/pip-req-build-a59ibcea\n  Running command git clone --filter=blob:none --quiet https://github.com/huggingface/pytorch-image-models.git /tmp/pip-req-build-a59ibcea\n  WARNING: Did not find branch or tag '730b907', assuming revision or ref.\n  Running command git checkout -q 730b907\n  Resolved https://github.com/huggingface/pytorch-image-models.git to commit 730b907\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n  Preparing metadata (pyproject.toml): started\n  Preparing metadata (pyproject.toml): finished with status 'done'\nCollecting accelerate\n  Using cached accelerate-0.33.0-py3-none-any.whl (315 kB)\nCollecting boto3\n  Using cached boto3-1.34.154-py3-none-any.whl (139 kB)\nCollecting bs4\n  Using cached bs4-0.0.2-py2.py3-none-any.whl (1.2 kB)\nCollecting patch\n  Using cached patch-1.16.zip (12 kB)\n  Preparing metadata (setup.py): started\n  Preparing metadata (setup.py): finished with status 'done'\nCollecting py-cpuinfo\n  Using cached py_cpuinfo-9.0.0-py3-none-any.whl (22 kB)\nCollecting distro\n  Using cached distro-1.9.0-py3-none-any.whl (20 kB)\nCollecting iopath\n  Using cached iopath-0.1.10.tar.gz (42 kB)\n  Preparing metadata (setup.py): started\n  Preparing metadata (setup.py): finished with status 'done'\nCollecting pytest\n  Using cached pytest-8.3.2-py3-none-any.whl (341 kB)\nCollecting pytest-benchmark\n  Using cached pytest_benchmark-4.0.0-py3-none-any.whl (43 kB)\nCollecting requests\n  Using cached requests-2.32.3-py3-none-any.whl (64 kB)\nCollecting tabulate\n  Using cached tabulate-0.9.0-py3-none-any.whl (35 kB)\nCollecting transformers==4.38.1\n  Using cached transformers-4.38.1-py3-none-any.whl (8.5 MB)\nCollecting MonkeyType\n  Using cached MonkeyType-23.3.0-py3-none-any.whl (40 kB)\nRequirement already satisfied: psutil in /localdisk/sanchitj/envs/pytorch_dnnl/lib/python3.10/site-packages (from -r requirements.txt (line 16)) (6.0.0)\nRequirement already satisfied: pyyaml in /localdisk/sanchitj/envs/pytorch_dnnl/lib/python3.10/site-packages (from -r requirements.txt (line 17)) (6.0.1)\nRequirement already satisfied: numpy in /localdisk/sanchitj/envs/pytorch_dnnl/lib/python3.10/site-packages (from -r requirements.txt (line 18)) (2.0.1)\nCollecting opencv-python\n  Using cached opencv_python-4.10.0.84-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (62.5 MB)\nCollecting submitit\n  Using cached submitit-1.5.1-py3-none-any.whl (74 kB)\nCollecting pynvml\n  Using cached pynvml-11.5.3-py3-none-any.whl (53 kB)\nCollecting safetensors>=0.4.1\n  Using cached safetensors-0.4.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (435 kB)\nRequirement already satisfied: filelock in /localdisk/sanchitj/envs/pytorch_dnnl/lib/python3.10/site-packages/filelock-3.15.4-py3.10.egg (from transformers==4.38.1->-r requirements.txt (line 14)) (3.15.4)\nCollecting huggingface-hub<1.0,>=0.19.3\n  Using cached huggingface_hub-0.24.5-py3-none-any.whl (417 kB)\nCollecting tokenizers<0.19,>=0.14\n  Using cached tokenizers-0.15.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB)\nCollecting packaging>=20.0\n  Using cached packaging-24.1-py3-none-any.whl (53 kB)\nRequirement already satisfied: tqdm>=4.27 in /localdisk/sanchitj/envs/pytorch_dnnl/lib/python3.10/site-packages (from transformers==4.38.1->-r requirements.txt (line 14)) (4.66.5)\nCollecting regex!=2019.12.17\n  Using cached regex-2024.7.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (776 kB)\nCollecting accelerate\n  Using cached accelerate-0.32.1-py3-none-any.whl (314 kB)\n  Using cached accelerate-0.32.0-py3-none-any.whl (314 kB)\n  Using cached accelerate-0.31.0-py3-none-any.whl (309 kB)\n  Using cached accelerate-0.30.1-py3-none-any.whl (302 kB)\n  Using cached accelerate-0.30.0-py3-none-any.whl (302 kB)\n  Using cached accelerate-0.29.3-py3-none-any.whl (297 kB)\n  Using cached accelerate-0.29.2-py3-none-any.whl (297 kB)\n  Using cached accelerate-0.29.1-py3-none-any.whl (297 kB)\n  Using cached accelerate-0.29.0-py3-none-any.whl (297 kB)\n  Using cached accelerate-0.28.0-py3-none-any.whl (290 kB)\n  Using cached accelerate-0.27.2-py3-none-any.whl (279 kB)\n  Using cached accelerate-0.27.1-py3-none-any.whl (279 kB)\n  Using cached accelerate-0.27.0-py3-none-any.whl (279 kB)\n  Using cached accelerate-0.26.1-py3-none-any.whl (270 kB)\n  Using cached accelerate-0.26.0-py3-none-any.whl (270 kB)\n  Using cached accelerate-0.25.0-py3-none-any.whl (265 kB)\n  Using cached accelerate-0.24.1-py3-none-any.whl (261 kB)\n  Using cached accelerate-0.24.0-py3-none-any.whl (260 kB)\n  Using cached accelerate-0.23.0-py3-none-any.whl (258 kB)\n  Using cached accelerate-0.22.0-py3-none-any.whl (251 kB)\n  Using cached accelerate-0.21.0-py3-none-any.whl (244 kB)\n  Using cached accelerate-0.20.3-py3-none-any.whl (227 kB)\n  Using cached accelerate-0.20.2-py3-none-any.whl (227 kB)\n  Using cached accelerate-0.20.1-py3-none-any.whl (227 kB)\n  Using cached accelerate-0.20.0-py3-none-any.whl (227 kB)\n  Using cached accelerate-0.19.0-py3-none-any.whl (219 kB)\n  Using cached accelerate-0.18.0-py3-none-any.whl (215 kB)\n  Using cached accelerate-0.17.1-py3-none-any.whl (212 kB)\n  Using cached accelerate-0.17.0-py3-none-any.whl (212 kB)\n  Using cached accelerate-0.16.0-py3-none-any.whl (199 kB)\n  Using cached accelerate-0.15.0-py3-none-any.whl (191 kB)\n  Using cached accelerate-0.14.0-py3-none-any.whl (175 kB)\n  Using cached accelerate-0.13.2-py3-none-any.whl (148 kB)\n  Using cached accelerate-0.13.1-py3-none-any.whl (148 kB)\n  Using cached accelerate-0.13.0-py3-none-any.whl (148 kB)\n  Using cached accelerate-0.12.0-py3-none-any.whl (143 kB)\n  Using cached accelerate-0.11.0-py3-none-any.whl (123 kB)\n  Using cached accelerate-0.10.0-py3-none-any.whl (117 kB)\n  Using cached accelerate-0.9.0-py3-none-any.whl (106 kB)\n  Using cached accelerate-0.8.0-py3-none-any.whl (114 kB)\n  Using cached accelerate-0.7.1-py3-none-any.whl (79 kB)\n  Using cached accelerate-0.7.0-py3-none-any.whl (79 kB)\n  Using cached accelerate-0.6.2-py3-none-any.whl (65 kB)\n  Using cached accelerate-0.6.1-py3-none-any.whl (65 kB)\n  Using cached accelerate-0.6.0-py3-none-any.whl (65 kB)\n  Using cached accelerate-0.5.1-py3-none-any.whl (58 kB)\n  Using cached accelerate-0.5.0-py3-none-any.whl (57 kB)\n  Using cached accelerate-0.4.0-py3-none-any.whl (55 kB)\n  Using cached accelerate-0.3.0-py3-none-any.whl (49 kB)\nCollecting pyaml>=20.4.0\n  Using cached pyaml-24.7.0-py3-none-any.whl (24 kB)\nCollecting accelerate\n  Using cached accelerate-0.2.1-py3-none-any.whl (47 kB)\n  Using cached accelerate-0.2.0-py3-none-any.whl (47 kB)\n  Using cached accelerate-0.1.0-py3-none-any.whl (34 kB)\n  Using cached accelerate-0.0.1-py3-none-any.whl (5.7 kB)\nCollecting jmespath<2.0.0,>=0.7.1\n  Using cached jmespath-1.0.1-py3-none-any.whl (20 kB)\nCollecting botocore<1.35.0,>=1.34.154\n  Using cached botocore-1.34.154-py3-none-any.whl (12.5 MB)\nCollecting s3transfer<0.11.0,>=0.10.0\n  Using cached s3transfer-0.10.2-py3-none-any.whl (82 kB)\nCollecting beautifulsoup4\n  Using cached beautifulsoup4-4.12.3-py3-none-any.whl (147 kB)\nCollecting portalocker\n  Using cached portalocker-2.10.1-py3-none-any.whl (18 kB)\nRequirement already satisfied: typing_extensions in /localdisk/sanchitj/envs/pytorch_dnnl/lib/python3.10/site-packages (from iopath->-r requirements.txt (line 7)) (4.12.2)\nCollecting iniconfig\n  Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)\nCollecting tomli>=1\n  Using cached tomli-2.0.1-py3-none-any.whl (12 kB)\nRequirement already satisfied: exceptiongroup>=1.0.0rc8 in /localdisk/sanchitj/envs/pytorch_dnnl/lib/python3.10/site-packages (from pytest->-r requirements.txt (line 8)) (1.2.2)\nCollecting pluggy<2,>=1.5\n  Using cached pluggy-1.5.0-py3-none-any.whl (20 kB)\nCollecting certifi>=2017.4.17\n  Using cached certifi-2024.7.4-py3-none-any.whl (162 kB)\nCollecting charset-normalizer<4,>=2\n  Using cached charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)\nCollecting idna<4,>=2.5\n  Using cached idna-3.7-py3-none-any.whl (66 kB)\nCollecting urllib3<3,>=1.21.1\n  Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)\nRequirement already satisfied: torchvision in /localdisk/sanchitj/vision (from timm==0.9.7->-r requirements.txt (line 12)) (0.20.0a0+61bd547)\nINFO: pip is looking at multiple versions of tabulate to determine which version is compatible with other requirements. This could take a while.\nCollecting tabulate\n  Using cached tabulate-0.8.10-py3-none-any.whl (29 kB)\nINFO: pip is looking at multiple versions of requests to determine which version is compatible with other requirements. This could take a while.\nCollecting requests\n  Using cached requests-2.32.2-py3-none-any.whl (63 kB)\nINFO: pip is looking at multiple versions of pytest-benchmark to determine which version is compatible with other requirements. This could take a while.\nCollecting pytest-benchmark\n  Using cached pytest_benchmark-3.4.1-py2.py3-none-any.whl (50 kB)\nINFO: pip is looking at multiple versions of pytest to determine which version is compatible with other requirements. This could take a while.\nCollecting pytest\n  Using cached pytest-8.3.1-py3-none-any.whl (341 kB)\nINFO: pip is looking at multiple versions of iopath to determine which version is compatible with other requirements. This could take a while.\nCollecting iopath\n  Using cached iopath-0.1.9-py3-none-any.whl (27 kB)\nINFO: pip is looking at multiple versions of distro to determine which version is compatible with other requirements. This could take a while.\nCollecting distro\n  Using cached distro-1.8.0-py3-none-any.whl (20 kB)\nINFO: pip is looking at multiple versions of py-cpuinfo to determine which version is compatible with other requirements. This could take a while.\nCollecting py-cpuinfo\n  Using cached py-cpuinfo-8.0.0.tar.gz (99 kB)\n  Preparing metadata (setup.py): started\n  Preparing metadata (setup.py): finished with status 'done'\nINFO: pip is looking at multiple versions of patch to determine which version is compatible with other requirements. This could take a while.\nCollecting patch\n  Using cached patch-1.15.zip (11 kB)\n  Preparing metadata (setup.py): started\n  Preparing metadata (setup.py): finished with status 'done'\nINFO: pip is looking at multiple versions of bs4 to determine which version is compatible with other requirements. This could take a while.\nCollecting bs4\n  Using cached bs4-0.0.1.tar.gz (1.1 kB)\n  Preparing metadata (setup.py): started\n  Preparing metadata (setup.py): finished with status 'done'\nINFO: pip is looking at multiple versions of boto3 to determine which version is compatible with other requirements. This could take a while.\nCollecting boto3\n  Using cached boto3-1.34.153-py3-none-any.whl (139 kB)\nINFO: pip is looking at multiple versions of accelerate to determine which version is compatible with other requirements. This could take a while.\nINFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.\nINFO: pip is looking at multiple versions of transformers to determine which version is compatible with other requirements. This could take a while.\nERROR: Cannot install -r requirements.txt (line 12) because these package versions have conflicting dependencies.\n\nThe conflict is caused by:\n    timm 0.9.7 depends on torch>=1.7\n    The user requested (constraint) torch==2.5.0a0+gitba152be\n\nTo fix this you could try to:\n1. loosen the range of package versions you've specified\n2. remove package versions to allow pip attempt to solve the dependency conflict\n\nERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts\n" 
</details>


Closing for now

I got the same wrong. Did you find a way to solve it?