prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  `psutil` required by utils/modeling.py but it isn't declared as a dependency
  ### System Info
  
  ```Shell
  Accelerate `0.10.0.dev0` on Debian Bullseye running Python 3.10.5.
  
  
  File "/opt/venv/lib/python3.10/site-packages/accelerate/utils/modeling.py", line 276, in get_max_memory
      import psutil
  ModuleNotFoundError: No module named 'psutil'
  ```
  
  I'm not sure if you have any minimum version you need to satisfy for `psutil` as a runtime dependency but I see that there are no constraints on it as a `test` dependency in setup.py.
  
  If you don't have any requirements, I'm happy to just add it myself and open a patch PR.
  
  Thanks!
  ```
  
  
  ### Information
  
  - [ ] The official example scripts
  - [ ] My own modified scripts
  
  ### Tasks
  
  - [ ] One of the scripts in the examples/ folder of Accelerate or an officially supported `no_trainer` script in the `examples` folder of the `transformers` repo (such as `run_no_trainer_glue.py`)
  - [ ] My own task or dataset (give details below)
  
  ### Reproduction
  
  Use `device_map="auto"` when loading any model that supports it.
  
  ### Expected behavior
  
  ```Shell
  I expect that `psutil` is declared as a runtime dependency of the `accelerate` package instead of having to install it myself.
  ```
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 # Copyright 2021 The HuggingFace Team. All rights reserved.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 from setuptools import setup
  16 from setuptools import find_packages
  17 
  18 extras = {}
  19 extras["quality"] = ["black ~= 22.0", "isort >= 5.5.4", "flake8 >= 3.8.3"]
  20 extras["docs"] = []
  21 extras["test"] = [
  22     "psutil",
  23     "pytest",
  24     "pytest-xdist",
  25     "pytest-subtests",
  26     "datasets",
  27     "evaluate",
  28     "transformers",
  29     "scipy",
  30     "sklearn",
  31     "parameterized",
  32     "deepspeed",
  33 ]
  34 
  35 extras["test_trackers"] = ["wandb", "comet-ml", "tensorboard"]
  36 extras["dev"] = extras["quality"] + extras["test"]
  37 
  38 extras["sagemaker"] = [
  39     "sagemaker",  # boto3 is a required package in sagemaker
  40 ]
  41 
  42 setup(
  43     name="accelerate",
  44     version="0.10.0.dev0",
  45     description="Accelerate",
  46     long_description=open("README.md", "r", encoding="utf-8").read(),
  47     long_description_content_type="text/markdown",
  48     keywords="deep learning",
  49     license="Apache",
  50     author="The HuggingFace team",
  51     author_email="sylvain@huggingface.co",
  52     url="https://github.com/huggingface/accelerate",
  53     package_dir={"": "src"},
  54     packages=find_packages("src"),
  55     entry_points={
  56         "console_scripts": [
  57             "accelerate=accelerate.commands.accelerate_cli:main",
  58             "accelerate-config=accelerate.commands.config:main",
  59             "accelerate-launch=accelerate.commands.launch:main",
  60         ]
  61     },
  62     python_requires=">=3.7.0",
  63     install_requires=["numpy>=1.17", "packaging>=20.0", "pyyaml", "torch>=1.4.0"],
  64     extras_require=extras,
  65     classifiers=[
  66         "Development Status :: 5 - Production/Stable",
  67         "Intended Audience :: Developers",
  68         "Intended Audience :: Education",
  69         "Intended Audience :: Science/Research",
  70         "License :: OSI Approved :: Apache Software License",
  71         "Operating System :: OS Independent",
  72         "Programming Language :: Python :: 3",
  73         "Programming Language :: Python :: 3.7",
  74         "Topic :: Scientific/Engineering :: Artificial Intelligence",
  75     ],
  76 )
  77 
  78 # Release checklist
  79 # 1. Change the version in __init__.py and setup.py.
  80 # 2. Commit these changes with the message: "Release: VERSION"
  81 # 3. Add a tag in git to mark the release: "git tag VERSION -m 'Adds tag VERSION for pypi' "
  82 #    Push the tag to git: git push --tags origin main
  83 # 4. Run the following commands in the top-level directory:
  84 #      python setup.py bdist_wheel
  85 #      python setup.py sdist
  86 # 5. Upload the package to the pypi test server first:
  87 #      twine upload dist/* -r pypitest
  88 #      twine upload dist/* -r pypitest --repository-url=https://test.pypi.org/legacy/
  89 # 6. Check that you can install it in a virtualenv by running:
  90 #      pip install -i https://testpypi.python.org/pypi accelerate
  91 #      accelerate env
  92 #      accelerate test
  93 # 7. Upload the final version to actual pypi:
  94 #      twine upload dist/* -r pypi
  95 # 8. Add release notes to the tag in github once everything is looking hunky-dory.
  96 # 9. Update the version in __init__.py, setup.py to the new version "-dev" and push to master
  97
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -19,7 +19,6 @@
   extras["quality"] = ["black ~= 22.0", "isort >= 5.5.4", "flake8 >= 3.8.3"]
   extras["docs"] = []
   extras["test"] = [
  -    "psutil",
       "pytest",
       "pytest-xdist",
       "pytest-subtests",
  @@ -60,7 +59,7 @@
           ]
       },
       python_requires=">=3.7.0",
  -    install_requires=["numpy>=1.17", "packaging>=20.0", "pyyaml", "torch>=1.4.0"],
  +    install_requires=["numpy>=1.17", "packaging>=20.0", "psutil", "pyyaml", "torch>=1.4.0"],
       extras_require=extras,
       classifiers=[
           "Development Status :: 5 - Production/Stable",
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -19,7 +19,6 @@\n extras[\"quality\"] = [\"black ~= 22.0\", \"isort >= 5.5.4\", \"flake8 >= 3.8.3\"]\n extras[\"docs\"] = []\n extras[\"test\"] = [\n-    \"psutil\",\n     \"pytest\",\n     \"pytest-xdist\",\n     \"pytest-subtests\",\n@@ -60,7 +59,7 @@\n         ]\n     },\n     python_requires=\">=3.7.0\",\n-    install_requires=[\"numpy>=1.17\", \"packaging>=20.0\", \"pyyaml\", \"torch>=1.4.0\"],\n+    install_requires=[\"numpy>=1.17\", \"packaging>=20.0\", \"psutil\", \"pyyaml\", \"torch>=1.4.0\"],\n     extras_require=extras,\n     classifiers=[\n         \"Development Status :: 5 - Production/Stable\",\n", "issue": "`psutil` required by utils/modeling.py but it isn't declared as a dependency\n### System Info\n\n```Shell\nAccelerate `0.10.0.dev0` on Debian Bullseye running Python 3.10.5.\r\n\r\n\r\nFile \"/opt/venv/lib/python3.10/site-packages/accelerate/utils/modeling.py\", line 276, in get_max_memory\r\n    import psutil\r\nModuleNotFoundError: No module named 'psutil'\r\n```\r\n\r\nI'm not sure if you have any minimum version you need to satisfy for `psutil` as a runtime dependency but I see that there are no constraints on it as a `test` dependency in setup.py.\r\n\r\nIf you don't have any requirements, I'm happy to just add it myself and open a patch PR.\r\n\r\nThanks!\n```\n\n\n### Information\n\n- [ ] The official example scripts\n- [ ] My own modified scripts\n\n### Tasks\n\n- [ ] One of the scripts in the examples/ folder of Accelerate or an officially supported `no_trainer` script in the `examples` folder of the `transformers` repo (such as `run_no_trainer_glue.py`)\n- [ ] My own task or dataset (give details below)\n\n### Reproduction\n\nUse `device_map=\"auto\"` when loading any model that supports it.\n\n### Expected behavior\n\n```Shell\nI expect that `psutil` is declared as a runtime dependency of the `accelerate` package instead of having to install it myself.\n```\n\n", "before_files": [{"content": "# Copyright 2021 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom setuptools import setup\nfrom setuptools import find_packages\n\nextras = {}\nextras[\"quality\"] = [\"black ~= 22.0\", \"isort >= 5.5.4\", \"flake8 >= 3.8.3\"]\nextras[\"docs\"] = []\nextras[\"test\"] = [\n    \"psutil\",\n    \"pytest\",\n    \"pytest-xdist\",\n    \"pytest-subtests\",\n    \"datasets\",\n    \"evaluate\",\n    \"transformers\",\n    \"scipy\",\n    \"sklearn\",\n    \"parameterized\",\n    \"deepspeed\",\n]\n\nextras[\"test_trackers\"] = [\"wandb\", \"comet-ml\", \"tensorboard\"]\nextras[\"dev\"] = extras[\"quality\"] + extras[\"test\"]\n\nextras[\"sagemaker\"] = [\n    \"sagemaker\",  # boto3 is a required package in sagemaker\n]\n\nsetup(\n    name=\"accelerate\",\n    version=\"0.10.0.dev0\",\n    description=\"Accelerate\",\n    long_description=open(\"README.md\", \"r\", encoding=\"utf-8\").read(),\n    long_description_content_type=\"text/markdown\",\n    keywords=\"deep learning\",\n    license=\"Apache\",\n    author=\"The HuggingFace team\",\n    author_email=\"sylvain@huggingface.co\",\n    url=\"https://github.com/huggingface/accelerate\",\n    package_dir={\"\": \"src\"},\n    packages=find_packages(\"src\"),\n    entry_points={\n        \"console_scripts\": [\n            \"accelerate=accelerate.commands.accelerate_cli:main\",\n            \"accelerate-config=accelerate.commands.config:main\",\n            \"accelerate-launch=accelerate.commands.launch:main\",\n        ]\n    },\n    python_requires=\">=3.7.0\",\n    install_requires=[\"numpy>=1.17\", \"packaging>=20.0\", \"pyyaml\", \"torch>=1.4.0\"],\n    extras_require=extras,\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n    ],\n)\n\n# Release checklist\n# 1. Change the version in __init__.py and setup.py.\n# 2. Commit these changes with the message: \"Release: VERSION\"\n# 3. Add a tag in git to mark the release: \"git tag VERSION -m 'Adds tag VERSION for pypi' \"\n#    Push the tag to git: git push --tags origin main\n# 4. Run the following commands in the top-level directory:\n#      python setup.py bdist_wheel\n#      python setup.py sdist\n# 5. Upload the package to the pypi test server first:\n#      twine upload dist/* -r pypitest\n#      twine upload dist/* -r pypitest --repository-url=https://test.pypi.org/legacy/\n# 6. Check that you can install it in a virtualenv by running:\n#      pip install -i https://testpypi.python.org/pypi accelerate\n#      accelerate env\n#      accelerate test\n# 7. Upload the final version to actual pypi:\n#      twine upload dist/* -r pypi\n# 8. Add release notes to the tag in github once everything is looking hunky-dory.\n# 9. Update the version in __init__.py, setup.py to the new version \"-dev\" and push to master\n", "path": "setup.py"}], "after_files": [{"content": "# Copyright 2021 The HuggingFace Team. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom setuptools import setup\nfrom setuptools import find_packages\n\nextras = {}\nextras[\"quality\"] = [\"black ~= 22.0\", \"isort >= 5.5.4\", \"flake8 >= 3.8.3\"]\nextras[\"docs\"] = []\nextras[\"test\"] = [\n    \"pytest\",\n    \"pytest-xdist\",\n    \"pytest-subtests\",\n    \"datasets\",\n    \"evaluate\",\n    \"transformers\",\n    \"scipy\",\n    \"sklearn\",\n    \"parameterized\",\n    \"deepspeed\",\n]\n\nextras[\"test_trackers\"] = [\"wandb\", \"comet-ml\", \"tensorboard\"]\nextras[\"dev\"] = extras[\"quality\"] + extras[\"test\"]\n\nextras[\"sagemaker\"] = [\n    \"sagemaker\",  # boto3 is a required package in sagemaker\n]\n\nsetup(\n    name=\"accelerate\",\n    version=\"0.10.0.dev0\",\n    description=\"Accelerate\",\n    long_description=open(\"README.md\", \"r\", encoding=\"utf-8\").read(),\n    long_description_content_type=\"text/markdown\",\n    keywords=\"deep learning\",\n    license=\"Apache\",\n    author=\"The HuggingFace team\",\n    author_email=\"sylvain@huggingface.co\",\n    url=\"https://github.com/huggingface/accelerate\",\n    package_dir={\"\": \"src\"},\n    packages=find_packages(\"src\"),\n    entry_points={\n        \"console_scripts\": [\n            \"accelerate=accelerate.commands.accelerate_cli:main\",\n            \"accelerate-config=accelerate.commands.config:main\",\n            \"accelerate-launch=accelerate.commands.launch:main\",\n        ]\n    },\n    python_requires=\">=3.7.0\",\n    install_requires=[\"numpy>=1.17\", \"packaging>=20.0\", \"psutil\", \"pyyaml\", \"torch>=1.4.0\"],\n    extras_require=extras,\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: Apache Software License\",\n        \"Operating System :: OS Independent\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n    ],\n)\n\n# Release checklist\n# 1. Change the version in __init__.py and setup.py.\n# 2. Commit these changes with the message: \"Release: VERSION\"\n# 3. Add a tag in git to mark the release: \"git tag VERSION -m 'Adds tag VERSION for pypi' \"\n#    Push the tag to git: git push --tags origin main\n# 4. Run the following commands in the top-level directory:\n#      python setup.py bdist_wheel\n#      python setup.py sdist\n# 5. Upload the package to the pypi test server first:\n#      twine upload dist/* -r pypitest\n#      twine upload dist/* -r pypitest --repository-url=https://test.pypi.org/legacy/\n# 6. Check that you can install it in a virtualenv by running:\n#      pip install -i https://testpypi.python.org/pypi accelerate\n#      accelerate env\n#      accelerate test\n# 7. Upload the final version to actual pypi:\n#      twine upload dist/* -r pypi\n# 8. Add release notes to the tag in github once everything is looking hunky-dory.\n# 9. Update the version in __init__.py, setup.py to the new version \"-dev\" and push to master\n", "path": "setup.py"}]}