We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
No module named 'fsspec.callbacks' thrown at horovod/spark/common/store.py ln 33
**Environment:**
1. Framework: TensorFlow
2. Framework version: 2.6.2
3. Horovod version: 0.24.1
4. MPI version: 4.1.0
5. CUDA version: N/A
6. NCCL version: N/A
7. Python version: 3.7
8. Spark / PySpark version: 3.2
9. Ray version: N/A
10. OS and version: Ubuntu 18.04
11. GCC version: 9.3.1
12. CMake version: 2.8

**Checklist:** >>>>>>>>>>>>>>>>> all "YES"
1. Did you search issues to find if somebody asked this question before?
2. If your question is about hang, did you read [this doc](https://github.com/horovod/horovod/blob/master/docs/running.rst)?
3. If your question is about docker, did you read [this doc](https://github.com/horovod/horovod/blob/master/docs/docker.rst)?
4. Did you check if you question is answered in the [troubleshooting guide](https://github.com/horovod/horovod/blob/master/docs/troubleshooting.rst)?

**Bug report:**
Please describe erroneous behavior you're observing and steps to reproduce it.
1. Create a GCP Dataproc cluster with 2.0.27-ubuntu18 image
2. install TF 2.6.2 and Horovod 0.24.1
3. `>> from horovod.spark.common.store import HDFSStore`
output:
Traceback (most recent call last):
  File "/opt/conda/default/lib/python3.8/site-packages/horovod/spark/common/store.py", line 33, in <module>
    from fsspec.callbacks import _DEFAULModuleNotFoundError: No module named 'fsspec.callbacks'

The fsspec.callback module was introduced in https://github.com/fsspec/filesystem_spec/releases/tag/2021.07.0

The line
https://github.com/horovod/horovod/blob/ebd135098571722469bb6290a6d098a9e1c96574/setup.py#L169
should be
`spark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec>=2021.07.0']`


--- 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 2019 Uber Technologies, Inc. All Rights Reserved.
2 # Modifications copyright Microsoft
3 # Modifications copyright (C) 2020, NVIDIA CORPORATION. All rights reserved.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ==============================================================================
17 
18 import atexit
19 import io
20 import os
21 import re
22 import shutil
23 import subprocess
24 import sys
25 import tempfile
26 import textwrap
27 
28 from setuptools import setup, Extension, find_packages
29 from setuptools.command.build_ext import build_ext
30 from distutils.version import LooseVersion
31 
32 from horovod import __version__
33 
34 _FRAMEWORK_METADATA_FILE = 'horovod/metadata.json'
35 
36 class CMakeExtension(Extension):
37     def __init__(self, name, cmake_lists_dir='.', sources=None, **kwa):
38         if sources is None:
39             sources = []
40         Extension.__init__(self, name, sources=sources, **kwa)
41         self.cmake_lists_dir = os.path.abspath(cmake_lists_dir)
42 
43 
44 tensorflow_mpi_lib = CMakeExtension('horovod.tensorflow.mpi_lib',
45                                      cmake_lists_dir='.', sources=[])
46 torch_mpi_lib_v2 = CMakeExtension('horovod.torch.mpi_lib_v2',
47                                      cmake_lists_dir='.', sources=[])
48 mxnet_mpi_lib = CMakeExtension('horovod.mxnet.mpi_lib',
49                                      cmake_lists_dir='.', sources=[])
50 
51 def is_build_action():
52     if len(sys.argv) <= 1:
53         return False
54 
55     if sys.argv[1].startswith('build'):
56         return True
57 
58     if sys.argv[1].startswith('bdist'):
59         return True
60 
61     if sys.argv[1].startswith('install'):
62         return True
63 
64     if sys.argv[1].startswith('develop'):
65         return True
66 
67 def get_cmake_bin():
68     if 'HOROVOD_CMAKE' in os.environ:
69         return os.environ['HOROVOD_CMAKE']
70 
71     cmake_bin = 'cmake'
72     try:
73         out = subprocess.check_output([cmake_bin, '--version'])
74     except OSError:
75         cmake_installed_version = LooseVersion("0.0")
76     else:
77         cmake_installed_version = LooseVersion(re.search(r'version\s*([\d.]+)', out.decode()).group(1))
78 
79     if cmake_installed_version < LooseVersion("3.13.0"):
80         print("Could not find a recent CMake to build Horovod. "
81               "Attempting to install CMake 3.13 to a temporary location via pip.", flush=True)
82         cmake_temp_dir = tempfile.TemporaryDirectory(prefix="horovod-cmake-tmp")
83         atexit.register(cmake_temp_dir.cleanup)
84         try:
85             _ = subprocess.check_output(["pip", "install", "--target", cmake_temp_dir.name, "cmake~=3.13.0"])
86         except Exception:
87             raise RuntimeError("Failed to install temporary CMake. "
88                                "Please update your CMake to 3.13+ or set HOROVOD_CMAKE appropriately.")
89         cmake_bin = os.path.join(cmake_temp_dir.name, "bin", "run_cmake")
90         with io.open(cmake_bin, "w") as f_run_cmake:
91             f_run_cmake.write(
92                 f"#!/bin/sh\nPYTHONPATH={cmake_temp_dir.name} {os.path.join(cmake_temp_dir.name, 'bin', 'cmake')} \"$@\"")
93         os.chmod(cmake_bin, 0o755)
94 
95     return cmake_bin
96 
97 
98 class custom_build_ext(build_ext):
99     def build_extensions(self):
100         if os.getenv('HOROVOD_SKIP_COMPILE') == '1':
101             # Skip building extensions using CMake
102             print("Horovod is being installed without native libraries")
103             return
104 
105         cmake_bin = get_cmake_bin()
106 
107         config = 'Debug' if self.debug or os.environ.get('HOROVOD_DEBUG') == "1" else 'RelWithDebInfo'
108 
109         ext_name = self.extensions[0].name
110         build_dir = self.get_ext_fullpath(ext_name).replace(self.get_ext_filename(ext_name), '')
111         build_dir = os.path.abspath(build_dir)
112 
113         cmake_args = ['-DCMAKE_BUILD_TYPE=' + config,
114                       '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(config.upper(), build_dir),
115                       '-DPYTHON_EXECUTABLE:FILEPATH=' + sys.executable]
116 
117         make_args = ['-j8'] if not os.environ.get('MAKEFLAGS') else []
118         if self.verbose:
119             make_args.append('VERBOSE=1')
120 
121         cmake_build_args = ['--config', config]
122         if make_args:
123             # -- specifies that these args are going to the native build tool: make
124             cmake_build_args += ['--'] + make_args
125 
126         cmake_build_dir = os.path.join(self.build_temp, config)
127         if not os.path.exists(cmake_build_dir):
128             os.makedirs(cmake_build_dir)
129 
130         config_and_build_commands = [
131             [cmake_bin, self.extensions[0].cmake_lists_dir] + cmake_args,
132             [cmake_bin, '--build', '.'] + cmake_build_args
133         ]
134 
135         if self.verbose:
136             print(f"Running CMake in {cmake_build_dir}:")
137             for command in config_and_build_commands:
138                 print(" ".join(command))
139             sys.stdout.flush()
140 
141         # Config and build the extension
142         try:
143             for command in config_and_build_commands:
144                 subprocess.check_call(command, cwd=cmake_build_dir)
145         except OSError as e:
146             raise RuntimeError('CMake failed: {}'.format(str(e)))
147 
148         if sys.argv[1].startswith('develop'):
149             # Copy over metadata.json file from build directory
150             shutil.copyfile(os.path.join(build_dir, _FRAMEWORK_METADATA_FILE),
151                             os.path.join(self.extensions[0].cmake_lists_dir, _FRAMEWORK_METADATA_FILE))
152             # Remove unfound frameworks, otherwise develop mode will fail the install
153             self.extensions = [x for x in self.extensions if os.path.exists(self.get_ext_fullpath(x.name))]
154 
155 
156 # python packages required to use horovod in general
157 require_list = ['cloudpickle', 'psutil', 'pyyaml', 'dataclasses;python_version<"3.7"']
158 
159 # framework dependencies
160 tensorflow_require_list = ['tensorflow']
161 tensorflow_cpu_require_list = ['tensorflow-cpu']
162 tensorflow_gpu_require_list = ['tensorflow-gpu']
163 keras_require_list = ['keras>=2.0.8,!=2.0.9,!=2.1.0,!=2.1.1']
164 # pytorch-lightning 1.3.8 is a stable version to work with horovod
165 pytorch_require_list = ['torch', 'pytorch_lightning==1.3.8']
166 mxnet_require_list = ['mxnet>=1.4.1']
167 pyspark_require_list = ['pyspark>=2.3.2;python_version<"3.8"',
168                         'pyspark>=3.0.0;python_version>="3.8"']
169 spark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec']
170 # https://github.com/ray-project/ray/pull/17465
171 ray_require_list = ['ray', 'aioredis<2']
172 pytorch_spark_require_list = pytorch_require_list + \
173                              spark_require_list + \
174                              pyspark_require_list
175 
176 # all frameworks' dependencies
177 all_frameworks_require_list = tensorflow_require_list + \
178                               keras_require_list + \
179                               pytorch_require_list + \
180                               mxnet_require_list + \
181                               spark_require_list + \
182                               pyspark_require_list
183 
184 # python packages required / recommended to develop horovod
185 # these are the earliest versions to work with Python 3.8
186 # keep in sync with Dockerfile.test.cpu
187 # NOTE: do not use versions with +cpu or +gpu here as users would need to add --find-links to pip
188 dev_require_list = ['tensorflow-cpu==2.2.0',
189                     'keras==2.3.1',
190                     'torch==1.4.0',
191                     'torchvision==0.5.0',
192                     'pytorch_lightning>=1.3.8',
193                     'mxnet==1.5.0',
194                     'pyspark==3.0.1'] + spark_require_list
195 # torchvision 0.5.0 depends on torch==1.4.0
196 
197 # python packages required only to run tests
198 test_require_list = ['mock', 'pytest', 'pytest-forked', 'parameterized']
199 
200 # Skip cffi if pytorch extension explicitly disabled
201 if not os.environ.get('HOROVOD_WITHOUT_PYTORCH'):
202     require_list.append('cffi>=1.4.0')
203 
204 
205 def get_package_version():
206     return __version__ + "+" + os.environ['HOROVOD_LOCAL_VERSION'] if 'HOROVOD_LOCAL_VERSION' in os.environ else __version__
207 
208 
209 setup(name='horovod',
210       version=get_package_version(),
211       packages=find_packages(),
212       description='Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.',
213       author='The Horovod Authors',
214       license='Apache 2.0',
215       long_description=textwrap.dedent('''\
216           Horovod is a distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.
217           The goal of Horovod is to make distributed Deep Learning fast and easy to use.'''),
218       url='https://github.com/horovod/horovod',
219       keywords=['deep learning', 'tensorflow', 'keras', 'pytorch', 'mxnet', 'spark', 'AI'],
220       classifiers=[
221           'License :: OSI Approved :: Apache Software License',
222           'Development Status :: 4 - Beta',
223           'Intended Audience :: Developers',
224           'Topic :: Scientific/Engineering :: Artificial Intelligence',
225       ],
226       ext_modules=[tensorflow_mpi_lib, torch_mpi_lib_v2, mxnet_mpi_lib],
227       cmdclass={'build_ext': custom_build_ext},
228       # cffi is required for PyTorch
229       # If cffi is specified in setup_requires, it will need libffi to be installed on the machine,
230       # which is undesirable.  Luckily, `install` action will install cffi before executing build,
231       # so it's only necessary for `build*` or `bdist*` actions.
232       setup_requires=require_list if is_build_action() else [],
233       install_requires=require_list,
234       tests_require=test_require_list,
235       extras_require={
236           'all-frameworks': all_frameworks_require_list,
237           'tensorflow': tensorflow_require_list,
238           'tensorflow-cpu': tensorflow_cpu_require_list,
239           'tensorflow-gpu': tensorflow_gpu_require_list,
240           'keras': keras_require_list,
241           'pytorch': pytorch_require_list,
242           'mxnet': mxnet_require_list,
243           'spark': spark_require_list + pyspark_require_list,
244           'pytorch-spark': pytorch_spark_require_list,
245           'ray': ray_require_list,
246           'dev': dev_require_list,
247           'test': test_require_list,
248       },
249       python_requires='>=3.6',
250       zip_safe=False,
251       entry_points={
252           'console_scripts': [
253               'horovodrun = horovod.runner.launch:run_commandline'
254           ]
255       })
256
```
--- 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()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -166,7 +166,7 @@
 mxnet_require_list = ['mxnet>=1.4.1']
 pyspark_require_list = ['pyspark>=2.3.2;python_version<"3.8"',
                         'pyspark>=3.0.0;python_version>="3.8"']
-spark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec']
+spark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec>=2021.07.0']
 # https://github.com/ray-project/ray/pull/17465
 ray_require_list = ['ray', 'aioredis<2']
 pytorch_spark_require_list = pytorch_require_list + \

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -166,7 +166,7 @@\n mxnet_require_list = ['mxnet>=1.4.1']\n pyspark_require_list = ['pyspark>=2.3.2;python_version<\"3.8\"',\n                         'pyspark>=3.0.0;python_version>=\"3.8\"']\n-spark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec']\n+spark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec>=2021.07.0']\n # https://github.com/ray-project/ray/pull/17465\n ray_require_list = ['ray', 'aioredis<2']\n pytorch_spark_require_list = pytorch_require_list + \\\n", "issue": "No module named 'fsspec.callbacks' thrown at horovod/spark/common/store.py ln 33\n**Environment:**\r\n1. Framework: TensorFlow\r\n2. Framework version: 2.6.2\r\n3. Horovod version: 0.24.1\r\n4. MPI version: 4.1.0\r\n5. CUDA version: N/A\r\n6. NCCL version: N/A\r\n7. Python version: 3.7\r\n8. Spark / PySpark version: 3.2\r\n9. Ray version: N/A\r\n10. OS and version: Ubuntu 18.04\r\n11. GCC version: 9.3.1\r\n12. CMake version: 2.8\r\n\r\n**Checklist:** >>>>>>>>>>>>>>>>> all \"YES\"\r\n1. Did you search issues to find if somebody asked this question before?\r\n2. If your question is about hang, did you read [this doc](https://github.com/horovod/horovod/blob/master/docs/running.rst)?\r\n3. If your question is about docker, did you read [this doc](https://github.com/horovod/horovod/blob/master/docs/docker.rst)?\r\n4. Did you check if you question is answered in the [troubleshooting guide](https://github.com/horovod/horovod/blob/master/docs/troubleshooting.rst)?\r\n\r\n**Bug report:**\r\nPlease describe erroneous behavior you're observing and steps to reproduce it.\r\n1. Create a GCP Dataproc cluster with 2.0.27-ubuntu18 image\r\n2. install TF 2.6.2 and Horovod 0.24.1\r\n3. `>> from horovod.spark.common.store import HDFSStore`\r\noutput:\r\nTraceback (most recent call last):\r\n  File \"/opt/conda/default/lib/python3.8/site-packages/horovod/spark/common/store.py\", line 33, in <module>\r\n    from fsspec.callbacks import _DEFAULModuleNotFoundError: No module named 'fsspec.callbacks'\r\n\r\nThe fsspec.callback module was introduced in https://github.com/fsspec/filesystem_spec/releases/tag/2021.07.0\r\n\r\nThe line\r\nhttps://github.com/horovod/horovod/blob/ebd135098571722469bb6290a6d098a9e1c96574/setup.py#L169\r\nshould be\r\n`spark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec>=2021.07.0']`\r\n\n", "before_files": [{"content": "# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.\n# Modifications copyright Microsoft\n# Modifications copyright (C) 2020, NVIDIA CORPORATION. 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# ==============================================================================\n\nimport atexit\nimport io\nimport os\nimport re\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nimport textwrap\n\nfrom setuptools import setup, Extension, find_packages\nfrom setuptools.command.build_ext import build_ext\nfrom distutils.version import LooseVersion\n\nfrom horovod import __version__\n\n_FRAMEWORK_METADATA_FILE = 'horovod/metadata.json'\n\nclass CMakeExtension(Extension):\n    def __init__(self, name, cmake_lists_dir='.', sources=None, **kwa):\n        if sources is None:\n            sources = []\n        Extension.__init__(self, name, sources=sources, **kwa)\n        self.cmake_lists_dir = os.path.abspath(cmake_lists_dir)\n\n\ntensorflow_mpi_lib = CMakeExtension('horovod.tensorflow.mpi_lib',\n                                     cmake_lists_dir='.', sources=[])\ntorch_mpi_lib_v2 = CMakeExtension('horovod.torch.mpi_lib_v2',\n                                     cmake_lists_dir='.', sources=[])\nmxnet_mpi_lib = CMakeExtension('horovod.mxnet.mpi_lib',\n                                     cmake_lists_dir='.', sources=[])\n\ndef is_build_action():\n    if len(sys.argv) <= 1:\n        return False\n\n    if sys.argv[1].startswith('build'):\n        return True\n\n    if sys.argv[1].startswith('bdist'):\n        return True\n\n    if sys.argv[1].startswith('install'):\n        return True\n\n    if sys.argv[1].startswith('develop'):\n        return True\n\ndef get_cmake_bin():\n    if 'HOROVOD_CMAKE' in os.environ:\n        return os.environ['HOROVOD_CMAKE']\n\n    cmake_bin = 'cmake'\n    try:\n        out = subprocess.check_output([cmake_bin, '--version'])\n    except OSError:\n        cmake_installed_version = LooseVersion(\"0.0\")\n    else:\n        cmake_installed_version = LooseVersion(re.search(r'version\\s*([\\d.]+)', out.decode()).group(1))\n\n    if cmake_installed_version < LooseVersion(\"3.13.0\"):\n        print(\"Could not find a recent CMake to build Horovod. \"\n              \"Attempting to install CMake 3.13 to a temporary location via pip.\", flush=True)\n        cmake_temp_dir = tempfile.TemporaryDirectory(prefix=\"horovod-cmake-tmp\")\n        atexit.register(cmake_temp_dir.cleanup)\n        try:\n            _ = subprocess.check_output([\"pip\", \"install\", \"--target\", cmake_temp_dir.name, \"cmake~=3.13.0\"])\n        except Exception:\n            raise RuntimeError(\"Failed to install temporary CMake. \"\n                               \"Please update your CMake to 3.13+ or set HOROVOD_CMAKE appropriately.\")\n        cmake_bin = os.path.join(cmake_temp_dir.name, \"bin\", \"run_cmake\")\n        with io.open(cmake_bin, \"w\") as f_run_cmake:\n            f_run_cmake.write(\n                f\"#!/bin/sh\\nPYTHONPATH={cmake_temp_dir.name} {os.path.join(cmake_temp_dir.name, 'bin', 'cmake')} \\\"$@\\\"\")\n        os.chmod(cmake_bin, 0o755)\n\n    return cmake_bin\n\n\nclass custom_build_ext(build_ext):\n    def build_extensions(self):\n        if os.getenv('HOROVOD_SKIP_COMPILE') == '1':\n            # Skip building extensions using CMake\n            print(\"Horovod is being installed without native libraries\")\n            return\n\n        cmake_bin = get_cmake_bin()\n\n        config = 'Debug' if self.debug or os.environ.get('HOROVOD_DEBUG') == \"1\" else 'RelWithDebInfo'\n\n        ext_name = self.extensions[0].name\n        build_dir = self.get_ext_fullpath(ext_name).replace(self.get_ext_filename(ext_name), '')\n        build_dir = os.path.abspath(build_dir)\n\n        cmake_args = ['-DCMAKE_BUILD_TYPE=' + config,\n                      '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(config.upper(), build_dir),\n                      '-DPYTHON_EXECUTABLE:FILEPATH=' + sys.executable]\n\n        make_args = ['-j8'] if not os.environ.get('MAKEFLAGS') else []\n        if self.verbose:\n            make_args.append('VERBOSE=1')\n\n        cmake_build_args = ['--config', config]\n        if make_args:\n            # -- specifies that these args are going to the native build tool: make\n            cmake_build_args += ['--'] + make_args\n\n        cmake_build_dir = os.path.join(self.build_temp, config)\n        if not os.path.exists(cmake_build_dir):\n            os.makedirs(cmake_build_dir)\n\n        config_and_build_commands = [\n            [cmake_bin, self.extensions[0].cmake_lists_dir] + cmake_args,\n            [cmake_bin, '--build', '.'] + cmake_build_args\n        ]\n\n        if self.verbose:\n            print(f\"Running CMake in {cmake_build_dir}:\")\n            for command in config_and_build_commands:\n                print(\" \".join(command))\n            sys.stdout.flush()\n\n        # Config and build the extension\n        try:\n            for command in config_and_build_commands:\n                subprocess.check_call(command, cwd=cmake_build_dir)\n        except OSError as e:\n            raise RuntimeError('CMake failed: {}'.format(str(e)))\n\n        if sys.argv[1].startswith('develop'):\n            # Copy over metadata.json file from build directory\n            shutil.copyfile(os.path.join(build_dir, _FRAMEWORK_METADATA_FILE),\n                            os.path.join(self.extensions[0].cmake_lists_dir, _FRAMEWORK_METADATA_FILE))\n            # Remove unfound frameworks, otherwise develop mode will fail the install\n            self.extensions = [x for x in self.extensions if os.path.exists(self.get_ext_fullpath(x.name))]\n\n\n# python packages required to use horovod in general\nrequire_list = ['cloudpickle', 'psutil', 'pyyaml', 'dataclasses;python_version<\"3.7\"']\n\n# framework dependencies\ntensorflow_require_list = ['tensorflow']\ntensorflow_cpu_require_list = ['tensorflow-cpu']\ntensorflow_gpu_require_list = ['tensorflow-gpu']\nkeras_require_list = ['keras>=2.0.8,!=2.0.9,!=2.1.0,!=2.1.1']\n# pytorch-lightning 1.3.8 is a stable version to work with horovod\npytorch_require_list = ['torch', 'pytorch_lightning==1.3.8']\nmxnet_require_list = ['mxnet>=1.4.1']\npyspark_require_list = ['pyspark>=2.3.2;python_version<\"3.8\"',\n                        'pyspark>=3.0.0;python_version>=\"3.8\"']\nspark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec']\n# https://github.com/ray-project/ray/pull/17465\nray_require_list = ['ray', 'aioredis<2']\npytorch_spark_require_list = pytorch_require_list + \\\n                             spark_require_list + \\\n                             pyspark_require_list\n\n# all frameworks' dependencies\nall_frameworks_require_list = tensorflow_require_list + \\\n                              keras_require_list + \\\n                              pytorch_require_list + \\\n                              mxnet_require_list + \\\n                              spark_require_list + \\\n                              pyspark_require_list\n\n# python packages required / recommended to develop horovod\n# these are the earliest versions to work with Python 3.8\n# keep in sync with Dockerfile.test.cpu\n# NOTE: do not use versions with +cpu or +gpu here as users would need to add --find-links to pip\ndev_require_list = ['tensorflow-cpu==2.2.0',\n                    'keras==2.3.1',\n                    'torch==1.4.0',\n                    'torchvision==0.5.0',\n                    'pytorch_lightning>=1.3.8',\n                    'mxnet==1.5.0',\n                    'pyspark==3.0.1'] + spark_require_list\n# torchvision 0.5.0 depends on torch==1.4.0\n\n# python packages required only to run tests\ntest_require_list = ['mock', 'pytest', 'pytest-forked', 'parameterized']\n\n# Skip cffi if pytorch extension explicitly disabled\nif not os.environ.get('HOROVOD_WITHOUT_PYTORCH'):\n    require_list.append('cffi>=1.4.0')\n\n\ndef get_package_version():\n    return __version__ + \"+\" + os.environ['HOROVOD_LOCAL_VERSION'] if 'HOROVOD_LOCAL_VERSION' in os.environ else __version__\n\n\nsetup(name='horovod',\n      version=get_package_version(),\n      packages=find_packages(),\n      description='Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.',\n      author='The Horovod Authors',\n      license='Apache 2.0',\n      long_description=textwrap.dedent('''\\\n          Horovod is a distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.\n          The goal of Horovod is to make distributed Deep Learning fast and easy to use.'''),\n      url='https://github.com/horovod/horovod',\n      keywords=['deep learning', 'tensorflow', 'keras', 'pytorch', 'mxnet', 'spark', 'AI'],\n      classifiers=[\n          'License :: OSI Approved :: Apache Software License',\n          'Development Status :: 4 - Beta',\n          'Intended Audience :: Developers',\n          'Topic :: Scientific/Engineering :: Artificial Intelligence',\n      ],\n      ext_modules=[tensorflow_mpi_lib, torch_mpi_lib_v2, mxnet_mpi_lib],\n      cmdclass={'build_ext': custom_build_ext},\n      # cffi is required for PyTorch\n      # If cffi is specified in setup_requires, it will need libffi to be installed on the machine,\n      # which is undesirable.  Luckily, `install` action will install cffi before executing build,\n      # so it's only necessary for `build*` or `bdist*` actions.\n      setup_requires=require_list if is_build_action() else [],\n      install_requires=require_list,\n      tests_require=test_require_list,\n      extras_require={\n          'all-frameworks': all_frameworks_require_list,\n          'tensorflow': tensorflow_require_list,\n          'tensorflow-cpu': tensorflow_cpu_require_list,\n          'tensorflow-gpu': tensorflow_gpu_require_list,\n          'keras': keras_require_list,\n          'pytorch': pytorch_require_list,\n          'mxnet': mxnet_require_list,\n          'spark': spark_require_list + pyspark_require_list,\n          'pytorch-spark': pytorch_spark_require_list,\n          'ray': ray_require_list,\n          'dev': dev_require_list,\n          'test': test_require_list,\n      },\n      python_requires='>=3.6',\n      zip_safe=False,\n      entry_points={\n          'console_scripts': [\n              'horovodrun = horovod.runner.launch:run_commandline'\n          ]\n      })\n", "path": "setup.py"}], "after_files": [{"content": "# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.\n# Modifications copyright Microsoft\n# Modifications copyright (C) 2020, NVIDIA CORPORATION. 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# ==============================================================================\n\nimport atexit\nimport io\nimport os\nimport re\nimport shutil\nimport subprocess\nimport sys\nimport tempfile\nimport textwrap\n\nfrom setuptools import setup, Extension, find_packages\nfrom setuptools.command.build_ext import build_ext\nfrom distutils.version import LooseVersion\n\nfrom horovod import __version__\n\n_FRAMEWORK_METADATA_FILE = 'horovod/metadata.json'\n\nclass CMakeExtension(Extension):\n    def __init__(self, name, cmake_lists_dir='.', sources=None, **kwa):\n        if sources is None:\n            sources = []\n        Extension.__init__(self, name, sources=sources, **kwa)\n        self.cmake_lists_dir = os.path.abspath(cmake_lists_dir)\n\n\ntensorflow_mpi_lib = CMakeExtension('horovod.tensorflow.mpi_lib',\n                                     cmake_lists_dir='.', sources=[])\ntorch_mpi_lib_v2 = CMakeExtension('horovod.torch.mpi_lib_v2',\n                                     cmake_lists_dir='.', sources=[])\nmxnet_mpi_lib = CMakeExtension('horovod.mxnet.mpi_lib',\n                                     cmake_lists_dir='.', sources=[])\n\ndef is_build_action():\n    if len(sys.argv) <= 1:\n        return False\n\n    if sys.argv[1].startswith('build'):\n        return True\n\n    if sys.argv[1].startswith('bdist'):\n        return True\n\n    if sys.argv[1].startswith('install'):\n        return True\n\n    if sys.argv[1].startswith('develop'):\n        return True\n\ndef get_cmake_bin():\n    if 'HOROVOD_CMAKE' in os.environ:\n        return os.environ['HOROVOD_CMAKE']\n\n    cmake_bin = 'cmake'\n    try:\n        out = subprocess.check_output([cmake_bin, '--version'])\n    except OSError:\n        cmake_installed_version = LooseVersion(\"0.0\")\n    else:\n        cmake_installed_version = LooseVersion(re.search(r'version\\s*([\\d.]+)', out.decode()).group(1))\n\n    if cmake_installed_version < LooseVersion(\"3.13.0\"):\n        print(\"Could not find a recent CMake to build Horovod. \"\n              \"Attempting to install CMake 3.13 to a temporary location via pip.\", flush=True)\n        cmake_temp_dir = tempfile.TemporaryDirectory(prefix=\"horovod-cmake-tmp\")\n        atexit.register(cmake_temp_dir.cleanup)\n        try:\n            _ = subprocess.check_output([\"pip\", \"install\", \"--target\", cmake_temp_dir.name, \"cmake~=3.13.0\"])\n        except Exception:\n            raise RuntimeError(\"Failed to install temporary CMake. \"\n                               \"Please update your CMake to 3.13+ or set HOROVOD_CMAKE appropriately.\")\n        cmake_bin = os.path.join(cmake_temp_dir.name, \"bin\", \"run_cmake\")\n        with io.open(cmake_bin, \"w\") as f_run_cmake:\n            f_run_cmake.write(\n                f\"#!/bin/sh\\nPYTHONPATH={cmake_temp_dir.name} {os.path.join(cmake_temp_dir.name, 'bin', 'cmake')} \\\"$@\\\"\")\n        os.chmod(cmake_bin, 0o755)\n\n    return cmake_bin\n\n\nclass custom_build_ext(build_ext):\n    def build_extensions(self):\n        if os.getenv('HOROVOD_SKIP_COMPILE') == '1':\n            # Skip building extensions using CMake\n            print(\"Horovod is being installed without native libraries\")\n            return\n\n        cmake_bin = get_cmake_bin()\n\n        config = 'Debug' if self.debug or os.environ.get('HOROVOD_DEBUG') == \"1\" else 'RelWithDebInfo'\n\n        ext_name = self.extensions[0].name\n        build_dir = self.get_ext_fullpath(ext_name).replace(self.get_ext_filename(ext_name), '')\n        build_dir = os.path.abspath(build_dir)\n\n        cmake_args = ['-DCMAKE_BUILD_TYPE=' + config,\n                      '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(config.upper(), build_dir),\n                      '-DPYTHON_EXECUTABLE:FILEPATH=' + sys.executable]\n\n        make_args = ['-j8'] if not os.environ.get('MAKEFLAGS') else []\n        if self.verbose:\n            make_args.append('VERBOSE=1')\n\n        cmake_build_args = ['--config', config]\n        if make_args:\n            # -- specifies that these args are going to the native build tool: make\n            cmake_build_args += ['--'] + make_args\n\n        cmake_build_dir = os.path.join(self.build_temp, config)\n        if not os.path.exists(cmake_build_dir):\n            os.makedirs(cmake_build_dir)\n\n        config_and_build_commands = [\n            [cmake_bin, self.extensions[0].cmake_lists_dir] + cmake_args,\n            [cmake_bin, '--build', '.'] + cmake_build_args\n        ]\n\n        if self.verbose:\n            print(f\"Running CMake in {cmake_build_dir}:\")\n            for command in config_and_build_commands:\n                print(\" \".join(command))\n            sys.stdout.flush()\n\n        # Config and build the extension\n        try:\n            for command in config_and_build_commands:\n                subprocess.check_call(command, cwd=cmake_build_dir)\n        except OSError as e:\n            raise RuntimeError('CMake failed: {}'.format(str(e)))\n\n        if sys.argv[1].startswith('develop'):\n            # Copy over metadata.json file from build directory\n            shutil.copyfile(os.path.join(build_dir, _FRAMEWORK_METADATA_FILE),\n                            os.path.join(self.extensions[0].cmake_lists_dir, _FRAMEWORK_METADATA_FILE))\n            # Remove unfound frameworks, otherwise develop mode will fail the install\n            self.extensions = [x for x in self.extensions if os.path.exists(self.get_ext_fullpath(x.name))]\n\n\n# python packages required to use horovod in general\nrequire_list = ['cloudpickle', 'psutil', 'pyyaml', 'dataclasses;python_version<\"3.7\"']\n\n# framework dependencies\ntensorflow_require_list = ['tensorflow']\ntensorflow_cpu_require_list = ['tensorflow-cpu']\ntensorflow_gpu_require_list = ['tensorflow-gpu']\nkeras_require_list = ['keras>=2.0.8,!=2.0.9,!=2.1.0,!=2.1.1']\n# pytorch-lightning 1.3.8 is a stable version to work with horovod\npytorch_require_list = ['torch', 'pytorch_lightning==1.3.8']\nmxnet_require_list = ['mxnet>=1.4.1']\npyspark_require_list = ['pyspark>=2.3.2;python_version<\"3.8\"',\n                        'pyspark>=3.0.0;python_version>=\"3.8\"']\nspark_require_list = ['numpy', 'petastorm>=0.11.0', 'pyarrow>=0.15.0', 'fsspec>=2021.07.0']\n# https://github.com/ray-project/ray/pull/17465\nray_require_list = ['ray', 'aioredis<2']\npytorch_spark_require_list = pytorch_require_list + \\\n                             spark_require_list + \\\n                             pyspark_require_list\n\n# all frameworks' dependencies\nall_frameworks_require_list = tensorflow_require_list + \\\n                              keras_require_list + \\\n                              pytorch_require_list + \\\n                              mxnet_require_list + \\\n                              spark_require_list + \\\n                              pyspark_require_list\n\n# python packages required / recommended to develop horovod\n# these are the earliest versions to work with Python 3.8\n# keep in sync with Dockerfile.test.cpu\n# NOTE: do not use versions with +cpu or +gpu here as users would need to add --find-links to pip\ndev_require_list = ['tensorflow-cpu==2.2.0',\n                    'keras==2.3.1',\n                    'torch==1.4.0',\n                    'torchvision==0.5.0',\n                    'pytorch_lightning>=1.3.8',\n                    'mxnet==1.5.0',\n                    'pyspark==3.0.1'] + spark_require_list\n# torchvision 0.5.0 depends on torch==1.4.0\n\n# python packages required only to run tests\ntest_require_list = ['mock', 'pytest', 'pytest-forked', 'parameterized']\n\n# Skip cffi if pytorch extension explicitly disabled\nif not os.environ.get('HOROVOD_WITHOUT_PYTORCH'):\n    require_list.append('cffi>=1.4.0')\n\n\ndef get_package_version():\n    return __version__ + \"+\" + os.environ['HOROVOD_LOCAL_VERSION'] if 'HOROVOD_LOCAL_VERSION' in os.environ else __version__\n\n\nsetup(name='horovod',\n      version=get_package_version(),\n      packages=find_packages(),\n      description='Distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.',\n      author='The Horovod Authors',\n      license='Apache 2.0',\n      long_description=textwrap.dedent('''\\\n          Horovod is a distributed training framework for TensorFlow, Keras, PyTorch, and Apache MXNet.\n          The goal of Horovod is to make distributed Deep Learning fast and easy to use.'''),\n      url='https://github.com/horovod/horovod',\n      keywords=['deep learning', 'tensorflow', 'keras', 'pytorch', 'mxnet', 'spark', 'AI'],\n      classifiers=[\n          'License :: OSI Approved :: Apache Software License',\n          'Development Status :: 4 - Beta',\n          'Intended Audience :: Developers',\n          'Topic :: Scientific/Engineering :: Artificial Intelligence',\n      ],\n      ext_modules=[tensorflow_mpi_lib, torch_mpi_lib_v2, mxnet_mpi_lib],\n      cmdclass={'build_ext': custom_build_ext},\n      # cffi is required for PyTorch\n      # If cffi is specified in setup_requires, it will need libffi to be installed on the machine,\n      # which is undesirable.  Luckily, `install` action will install cffi before executing build,\n      # so it's only necessary for `build*` or `bdist*` actions.\n      setup_requires=require_list if is_build_action() else [],\n      install_requires=require_list,\n      tests_require=test_require_list,\n      extras_require={\n          'all-frameworks': all_frameworks_require_list,\n          'tensorflow': tensorflow_require_list,\n          'tensorflow-cpu': tensorflow_cpu_require_list,\n          'tensorflow-gpu': tensorflow_gpu_require_list,\n          'keras': keras_require_list,\n          'pytorch': pytorch_require_list,\n          'mxnet': mxnet_require_list,\n          'spark': spark_require_list + pyspark_require_list,\n          'pytorch-spark': pytorch_spark_require_list,\n          'ray': ray_require_list,\n          'dev': dev_require_list,\n          'test': test_require_list,\n      },\n      python_requires='>=3.6',\n      zip_safe=False,\n      entry_points={\n          'console_scripts': [\n              'horovodrun = horovod.runner.launch:run_commandline'\n          ]\n      })\n", "path": "setup.py"}]}