We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[tensor] fix some unittests

[tensor] fix some unittests

[tensor] fix some unittests


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `extensions/base_extension.py`
Content:
```
1 import hashlib
2 import os
3 from abc import ABC, abstractmethod
4 from typing import Union
5 
6 __all__ = ["_Extension"]
7 
8 
9 class _Extension(ABC):
10     def __init__(self, name: str, support_aot: bool, support_jit: bool, priority: int = 1):
11         self._name = name
12         self._support_aot = support_aot
13         self._support_jit = support_jit
14         self.priority = priority
15 
16     @property
17     def name(self):
18         return self._name
19 
20     @property
21     def support_aot(self):
22         return self._support_aot
23 
24     @property
25     def support_jit(self):
26         return self._support_jit
27 
28     @staticmethod
29     def get_jit_extension_folder_path():
30         """
31         Kernels which are compiled during runtime will be stored in the same cache folder for reuse.
32         The folder is in the path ~/.cache/colossalai/torch_extensions/<cache-folder>.
33         The name of the <cache-folder> follows a common format:
34             torch<torch_version_major>.<torch_version_minor>_<device_name><device_version>-<hash>
35 
36         The <hash> suffix is the hash value of the path of the `colossalai` file.
37         """
38         import torch
39 
40         import colossalai
41         from colossalai.accelerator import get_accelerator
42 
43         # get torch version
44         torch_version_major = torch.__version__.split(".")[0]
45         torch_version_minor = torch.__version__.split(".")[1]
46 
47         # get device version
48         device_name = get_accelerator().name
49         device_version = get_accelerator().get_version()
50 
51         # use colossalai's file path as hash
52         hash_suffix = hashlib.sha256(colossalai.__file__.encode()).hexdigest()
53 
54         # concat
55         home_directory = os.path.expanduser("~")
56         extension_directory = f".cache/colossalai/torch_extensions/torch{torch_version_major}.{torch_version_minor}_{device_name}-{device_version}-{hash_suffix}"
57         cache_directory = os.path.join(home_directory, extension_directory)
58         return cache_directory
59 
60     @abstractmethod
61     def is_hardware_available(self) -> bool:
62         """
63         Check if the hardware required by the kernel is available.
64         """
65 
66     @abstractmethod
67     def assert_hardware_compatible(self) -> bool:
68         """
69         Check if the hardware required by the kernel is compatible.
70         """
71 
72     @abstractmethod
73     def build_aot(self) -> Union["CppExtension", "CUDAExtension"]:
74         pass
75 
76     @abstractmethod
77     def build_jit(self) -> None:
78         pass
79 
80     @abstractmethod
81     def load(self):
82         pass
83
```
--- 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/extensions/base_extension.py b/extensions/base_extension.py
--- a/extensions/base_extension.py
+++ b/extensions/base_extension.py
@@ -1,7 +1,7 @@
 import hashlib
 import os
 from abc import ABC, abstractmethod
-from typing import Union
+from typing import Callable, Union
 
 __all__ = ["_Extension"]
 
@@ -64,7 +64,7 @@
         """
 
     @abstractmethod
-    def assert_hardware_compatible(self) -> bool:
+    def assert_hardware_compatible(self) -> None:
         """
         Check if the hardware required by the kernel is compatible.
         """
@@ -74,9 +74,9 @@
         pass
 
     @abstractmethod
-    def build_jit(self) -> None:
+    def build_jit(self) -> Callable:
         pass
 
     @abstractmethod
-    def load(self):
+    def load(self) -> Callable:
         pass

{"golden_diff": "diff --git a/extensions/base_extension.py b/extensions/base_extension.py\n--- a/extensions/base_extension.py\n+++ b/extensions/base_extension.py\n@@ -1,7 +1,7 @@\n import hashlib\n import os\n from abc import ABC, abstractmethod\n-from typing import Union\n+from typing import Callable, Union\n \n __all__ = [\"_Extension\"]\n \n@@ -64,7 +64,7 @@\n         \"\"\"\n \n     @abstractmethod\n-    def assert_hardware_compatible(self) -> bool:\n+    def assert_hardware_compatible(self) -> None:\n         \"\"\"\n         Check if the hardware required by the kernel is compatible.\n         \"\"\"\n@@ -74,9 +74,9 @@\n         pass\n \n     @abstractmethod\n-    def build_jit(self) -> None:\n+    def build_jit(self) -> Callable:\n         pass\n \n     @abstractmethod\n-    def load(self):\n+    def load(self) -> Callable:\n         pass\n", "issue": "[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n", "before_files": [{"content": "import hashlib\nimport os\nfrom abc import ABC, abstractmethod\nfrom typing import Union\n\n__all__ = [\"_Extension\"]\n\n\nclass _Extension(ABC):\n    def __init__(self, name: str, support_aot: bool, support_jit: bool, priority: int = 1):\n        self._name = name\n        self._support_aot = support_aot\n        self._support_jit = support_jit\n        self.priority = priority\n\n    @property\n    def name(self):\n        return self._name\n\n    @property\n    def support_aot(self):\n        return self._support_aot\n\n    @property\n    def support_jit(self):\n        return self._support_jit\n\n    @staticmethod\n    def get_jit_extension_folder_path():\n        \"\"\"\n        Kernels which are compiled during runtime will be stored in the same cache folder for reuse.\n        The folder is in the path ~/.cache/colossalai/torch_extensions/<cache-folder>.\n        The name of the <cache-folder> follows a common format:\n            torch<torch_version_major>.<torch_version_minor>_<device_name><device_version>-<hash>\n\n        The <hash> suffix is the hash value of the path of the `colossalai` file.\n        \"\"\"\n        import torch\n\n        import colossalai\n        from colossalai.accelerator import get_accelerator\n\n        # get torch version\n        torch_version_major = torch.__version__.split(\".\")[0]\n        torch_version_minor = torch.__version__.split(\".\")[1]\n\n        # get device version\n        device_name = get_accelerator().name\n        device_version = get_accelerator().get_version()\n\n        # use colossalai's file path as hash\n        hash_suffix = hashlib.sha256(colossalai.__file__.encode()).hexdigest()\n\n        # concat\n        home_directory = os.path.expanduser(\"~\")\n        extension_directory = f\".cache/colossalai/torch_extensions/torch{torch_version_major}.{torch_version_minor}_{device_name}-{device_version}-{hash_suffix}\"\n        cache_directory = os.path.join(home_directory, extension_directory)\n        return cache_directory\n\n    @abstractmethod\n    def is_hardware_available(self) -> bool:\n        \"\"\"\n        Check if the hardware required by the kernel is available.\n        \"\"\"\n\n    @abstractmethod\n    def assert_hardware_compatible(self) -> bool:\n        \"\"\"\n        Check if the hardware required by the kernel is compatible.\n        \"\"\"\n\n    @abstractmethod\n    def build_aot(self) -> Union[\"CppExtension\", \"CUDAExtension\"]:\n        pass\n\n    @abstractmethod\n    def build_jit(self) -> None:\n        pass\n\n    @abstractmethod\n    def load(self):\n        pass\n", "path": "extensions/base_extension.py"}], "after_files": [{"content": "import hashlib\nimport os\nfrom abc import ABC, abstractmethod\nfrom typing import Callable, Union\n\n__all__ = [\"_Extension\"]\n\n\nclass _Extension(ABC):\n    def __init__(self, name: str, support_aot: bool, support_jit: bool, priority: int = 1):\n        self._name = name\n        self._support_aot = support_aot\n        self._support_jit = support_jit\n        self.priority = priority\n\n    @property\n    def name(self):\n        return self._name\n\n    @property\n    def support_aot(self):\n        return self._support_aot\n\n    @property\n    def support_jit(self):\n        return self._support_jit\n\n    @staticmethod\n    def get_jit_extension_folder_path():\n        \"\"\"\n        Kernels which are compiled during runtime will be stored in the same cache folder for reuse.\n        The folder is in the path ~/.cache/colossalai/torch_extensions/<cache-folder>.\n        The name of the <cache-folder> follows a common format:\n            torch<torch_version_major>.<torch_version_minor>_<device_name><device_version>-<hash>\n\n        The <hash> suffix is the hash value of the path of the `colossalai` file.\n        \"\"\"\n        import torch\n\n        import colossalai\n        from colossalai.accelerator import get_accelerator\n\n        # get torch version\n        torch_version_major = torch.__version__.split(\".\")[0]\n        torch_version_minor = torch.__version__.split(\".\")[1]\n\n        # get device version\n        device_name = get_accelerator().name\n        device_version = get_accelerator().get_version()\n\n        # use colossalai's file path as hash\n        hash_suffix = hashlib.sha256(colossalai.__file__.encode()).hexdigest()\n\n        # concat\n        home_directory = os.path.expanduser(\"~\")\n        extension_directory = f\".cache/colossalai/torch_extensions/torch{torch_version_major}.{torch_version_minor}_{device_name}-{device_version}-{hash_suffix}\"\n        cache_directory = os.path.join(home_directory, extension_directory)\n        return cache_directory\n\n    @abstractmethod\n    def is_hardware_available(self) -> bool:\n        \"\"\"\n        Check if the hardware required by the kernel is available.\n        \"\"\"\n\n    @abstractmethod\n    def assert_hardware_compatible(self) -> None:\n        \"\"\"\n        Check if the hardware required by the kernel is compatible.\n        \"\"\"\n\n    @abstractmethod\n    def build_aot(self) -> Union[\"CppExtension\", \"CUDAExtension\"]:\n        pass\n\n    @abstractmethod\n    def build_jit(self) -> Callable:\n        pass\n\n    @abstractmethod\n    def load(self) -> Callable:\n        pass\n", "path": "extensions/base_extension.py"}]}