We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
the main branch is not compatible with python 3.6, but setup.py only requires ">=3.6"
python 3.6 can pip install latest fairscale
https://github.com/facebookresearch/fairscale/blob/1bc96fa8c69def6d990e42bfbd75f86146ce29bd/setup.py#L67

but, some code is not compatible with python 3.6
https://github.com/facebookresearch/fairscale/blob/1bc96fa8c69def6d990e42bfbd75f86146ce29bd/fairscale/experimental/nn/ssd_offload.py#L6
and python<3.7 has no dataclasses
https://github.com/facebookresearch/fairscale/blob/1bc96fa8c69def6d990e42bfbd75f86146ce29bd/fairscale/nn/data_parallel/fully_sharded_data_parallel.py#L8




--- 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 #!/usr/bin/env python3
2 
3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
4 #
5 # This source code is licensed under the BSD license found in the
6 # LICENSE file in the root directory of this source tree.
7 
8 import os
9 import re
10 
11 import setuptools
12 
13 this_dir = os.path.dirname(os.path.abspath(__file__))
14 
15 
16 def fetch_requirements():
17     with open("requirements.txt") as f:
18         reqs = f.read().strip().split("\n")
19     return reqs
20 
21 
22 # https://packaging.python.org/guides/single-sourcing-package-version/
23 def find_version(version_file_path) -> str:
24     with open(version_file_path) as version_file:
25         version_match = re.search(r"^__version_tuple__ = (.*)", version_file.read(), re.M)
26         if version_match:
27             ver_tup = eval(version_match.group(1))
28             ver_str = ".".join([str(x) for x in ver_tup])
29             return ver_str
30         raise RuntimeError("Unable to find version tuple.")
31 
32 
33 extensions = []
34 cmdclass = {}
35 
36 if os.getenv("BUILD_CUDA_EXTENSIONS", "0") == "1":
37     from torch.utils.cpp_extension import BuildExtension, CUDAExtension
38 
39     extensions.extend(
40         [
41             CUDAExtension(
42                 name="fairscale.fused_adam_cuda",
43                 include_dirs=[os.path.join(this_dir, "fairscale/clib/fused_adam_cuda")],
44                 sources=[
45                     "fairscale/clib/fused_adam_cuda/fused_adam_cuda.cpp",
46                     "fairscale/clib/fused_adam_cuda/fused_adam_cuda_kernel.cu",
47                 ],
48                 extra_compile_args={"cxx": ["-O3"], "nvcc": ["-O3", "--use_fast_math"]},
49             )
50         ]
51     )
52 
53     cmdclass["build_ext"] = BuildExtension
54 
55 
56 if __name__ == "__main__":
57     setuptools.setup(
58         name="fairscale",
59         description="FairScale: A PyTorch library for large-scale and high-performance training.",
60         version=find_version("fairscale/version.py"),
61         setup_requires=["ninja"],  # ninja is required to build extensions
62         install_requires=fetch_requirements(),
63         include_package_data=True,
64         packages=setuptools.find_packages(exclude=("tests", "tests.*")),
65         ext_modules=extensions,
66         cmdclass=cmdclass,
67         python_requires=">=3.6",
68         author="Facebook AI Research",
69         author_email="todo@fb.com",
70         long_description="FairScale is a PyTorch extension library for high performance and large scale training on one or multiple machines/nodes. This library extends basic PyTorch capabilities while adding new experimental ones.",
71         long_description_content_type="text/markdown",
72         classifiers=[
73             "Programming Language :: Python :: 3.7",
74             "Programming Language :: Python :: 3.8",
75             "Programming Language :: Python :: 3.9",
76             "License :: OSI Approved :: BSD License",
77             "Topic :: Scientific/Engineering :: Artificial Intelligence",
78             "Operating System :: OS Independent",
79         ],
80     )
81
```
--- 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
@@ -64,7 +64,7 @@
         packages=setuptools.find_packages(exclude=("tests", "tests.*")),
         ext_modules=extensions,
         cmdclass=cmdclass,
-        python_requires=">=3.6",
+        python_requires=">=3.7",
         author="Facebook AI Research",
         author_email="todo@fb.com",
         long_description="FairScale is a PyTorch extension library for high performance and large scale training on one or multiple machines/nodes. This library extends basic PyTorch capabilities while adding new experimental ones.",

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -64,7 +64,7 @@\n         packages=setuptools.find_packages(exclude=(\"tests\", \"tests.*\")),\n         ext_modules=extensions,\n         cmdclass=cmdclass,\n-        python_requires=\">=3.6\",\n+        python_requires=\">=3.7\",\n         author=\"Facebook AI Research\",\n         author_email=\"todo@fb.com\",\n         long_description=\"FairScale is a PyTorch extension library for high performance and large scale training on one or multiple machines/nodes. This library extends basic PyTorch capabilities while adding new experimental ones.\",\n", "issue": "the main branch is not compatible with python 3.6, but setup.py only requires \">=3.6\"\npython 3.6 can pip install latest fairscale\r\nhttps://github.com/facebookresearch/fairscale/blob/1bc96fa8c69def6d990e42bfbd75f86146ce29bd/setup.py#L67\r\n\r\nbut, some code is not compatible with python 3.6\r\nhttps://github.com/facebookresearch/fairscale/blob/1bc96fa8c69def6d990e42bfbd75f86146ce29bd/fairscale/experimental/nn/ssd_offload.py#L6\r\nand python<3.7 has no dataclasses\r\nhttps://github.com/facebookresearch/fairscale/blob/1bc96fa8c69def6d990e42bfbd75f86146ce29bd/fairscale/nn/data_parallel/fully_sharded_data_parallel.py#L8\r\n\r\n\r\n\n", "before_files": [{"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nimport re\n\nimport setuptools\n\nthis_dir = os.path.dirname(os.path.abspath(__file__))\n\n\ndef fetch_requirements():\n    with open(\"requirements.txt\") as f:\n        reqs = f.read().strip().split(\"\\n\")\n    return reqs\n\n\n# https://packaging.python.org/guides/single-sourcing-package-version/\ndef find_version(version_file_path) -> str:\n    with open(version_file_path) as version_file:\n        version_match = re.search(r\"^__version_tuple__ = (.*)\", version_file.read(), re.M)\n        if version_match:\n            ver_tup = eval(version_match.group(1))\n            ver_str = \".\".join([str(x) for x in ver_tup])\n            return ver_str\n        raise RuntimeError(\"Unable to find version tuple.\")\n\n\nextensions = []\ncmdclass = {}\n\nif os.getenv(\"BUILD_CUDA_EXTENSIONS\", \"0\") == \"1\":\n    from torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\n    extensions.extend(\n        [\n            CUDAExtension(\n                name=\"fairscale.fused_adam_cuda\",\n                include_dirs=[os.path.join(this_dir, \"fairscale/clib/fused_adam_cuda\")],\n                sources=[\n                    \"fairscale/clib/fused_adam_cuda/fused_adam_cuda.cpp\",\n                    \"fairscale/clib/fused_adam_cuda/fused_adam_cuda_kernel.cu\",\n                ],\n                extra_compile_args={\"cxx\": [\"-O3\"], \"nvcc\": [\"-O3\", \"--use_fast_math\"]},\n            )\n        ]\n    )\n\n    cmdclass[\"build_ext\"] = BuildExtension\n\n\nif __name__ == \"__main__\":\n    setuptools.setup(\n        name=\"fairscale\",\n        description=\"FairScale: A PyTorch library for large-scale and high-performance training.\",\n        version=find_version(\"fairscale/version.py\"),\n        setup_requires=[\"ninja\"],  # ninja is required to build extensions\n        install_requires=fetch_requirements(),\n        include_package_data=True,\n        packages=setuptools.find_packages(exclude=(\"tests\", \"tests.*\")),\n        ext_modules=extensions,\n        cmdclass=cmdclass,\n        python_requires=\">=3.6\",\n        author=\"Facebook AI Research\",\n        author_email=\"todo@fb.com\",\n        long_description=\"FairScale is a PyTorch extension library for high performance and large scale training on one or multiple machines/nodes. This library extends basic PyTorch capabilities while adding new experimental ones.\",\n        long_description_content_type=\"text/markdown\",\n        classifiers=[\n            \"Programming Language :: Python :: 3.7\",\n            \"Programming Language :: Python :: 3.8\",\n            \"Programming Language :: Python :: 3.9\",\n            \"License :: OSI Approved :: BSD License\",\n            \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n            \"Operating System :: OS Independent\",\n        ],\n    )\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport os\nimport re\n\nimport setuptools\n\nthis_dir = os.path.dirname(os.path.abspath(__file__))\n\n\ndef fetch_requirements():\n    with open(\"requirements.txt\") as f:\n        reqs = f.read().strip().split(\"\\n\")\n    return reqs\n\n\n# https://packaging.python.org/guides/single-sourcing-package-version/\ndef find_version(version_file_path) -> str:\n    with open(version_file_path) as version_file:\n        version_match = re.search(r\"^__version_tuple__ = (.*)\", version_file.read(), re.M)\n        if version_match:\n            ver_tup = eval(version_match.group(1))\n            ver_str = \".\".join([str(x) for x in ver_tup])\n            return ver_str\n        raise RuntimeError(\"Unable to find version tuple.\")\n\n\nextensions = []\ncmdclass = {}\n\nif os.getenv(\"BUILD_CUDA_EXTENSIONS\", \"0\") == \"1\":\n    from torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\n    extensions.extend(\n        [\n            CUDAExtension(\n                name=\"fairscale.fused_adam_cuda\",\n                include_dirs=[os.path.join(this_dir, \"fairscale/clib/fused_adam_cuda\")],\n                sources=[\n                    \"fairscale/clib/fused_adam_cuda/fused_adam_cuda.cpp\",\n                    \"fairscale/clib/fused_adam_cuda/fused_adam_cuda_kernel.cu\",\n                ],\n                extra_compile_args={\"cxx\": [\"-O3\"], \"nvcc\": [\"-O3\", \"--use_fast_math\"]},\n            )\n        ]\n    )\n\n    cmdclass[\"build_ext\"] = BuildExtension\n\n\nif __name__ == \"__main__\":\n    setuptools.setup(\n        name=\"fairscale\",\n        description=\"FairScale: A PyTorch library for large-scale and high-performance training.\",\n        version=find_version(\"fairscale/version.py\"),\n        setup_requires=[\"ninja\"],  # ninja is required to build extensions\n        install_requires=fetch_requirements(),\n        include_package_data=True,\n        packages=setuptools.find_packages(exclude=(\"tests\", \"tests.*\")),\n        ext_modules=extensions,\n        cmdclass=cmdclass,\n        python_requires=\">=3.7\",\n        author=\"Facebook AI Research\",\n        author_email=\"todo@fb.com\",\n        long_description=\"FairScale is a PyTorch extension library for high performance and large scale training on one or multiple machines/nodes. This library extends basic PyTorch capabilities while adding new experimental ones.\",\n        long_description_content_type=\"text/markdown\",\n        classifiers=[\n            \"Programming Language :: Python :: 3.7\",\n            \"Programming Language :: Python :: 3.8\",\n            \"Programming Language :: Python :: 3.9\",\n            \"License :: OSI Approved :: BSD License\",\n            \"Topic :: Scientific/Engineering :: Artificial Intelligence\",\n            \"Operating System :: OS Independent\",\n        ],\n    )\n", "path": "setup.py"}]}