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: `colossalai/cli/launcher/__init__.py`
Content:
```
1 import click
2 from .run import launch_multi_processes
3 from colossalai.context import Config
4 
5 
6 @click.command(help="Launch distributed training on a single node or multiple nodes",
7                context_settings=dict(ignore_unknown_options=True))
8 @click.option("-H",
9               "-host",
10               "--host",
11               type=str,
12               default=None,
13               help="the list of hostnames to launch in the format <host1>,<host2>")
14 @click.option(
15     "--hostfile",
16     type=str,
17     default=None,
18     help="Hostfile path that defines the device pool available to the job, each line in the file is a hostname")
19 @click.option("--include",
20               type=str,
21               default=None,
22               help="Specify computing devices to use during execution. String format is <host1>,<host2>,"
23               " only effective when used with --hostfile.")
24 @click.option(
25     "--exclude",
26     type=str,
27     default=None,
28     help=
29     "Specify computing devices to NOT use during execution. Mutually exclusive with --include. Formatting is the same as --includ,"
30     " only effective when used with --hostfile.")
31 @click.option("--num_nodes",
32               type=int,
33               default=-1,
34               help="Total number of worker nodes to use, only effective when used with --hostfile.")
35 @click.option("--nproc_per_node", type=int, default=None, help="Number of GPUs to use on each node.")
36 @click.option("--master_port",
37               type=int,
38               default=29500,
39               help="(optional) Port used by PyTorch distributed for communication during distributed training.")
40 @click.option("--master_addr",
41               type=str,
42               default="127.0.0.1",
43               help="(optional) IP address of node 0, will be inferred via 'hostname -I' if not specified.")
44 @click.option(
45     "--extra_launch_args",
46     type=str,
47     default=None,
48     help=
49     "Set additional torch distributed launcher arguments such as --standalone. The format is --extra_launch_args arg1=1,arg2=2. "
50     "This will be converted to --arg1=1 --arg2=2 during execution")
51 @click.option("--ssh-port", type=int, default=None, help="(optional) the port used for ssh connection")
52 @click.argument("user_script", type=str)
53 @click.argument('user_args', nargs=-1)
54 def run(host: str, hostfile: str, num_nodes: int, nproc_per_node: int, include: str, exclude: str, master_addr: str,
55         master_port: int, extra_launch_args: str, ssh_port: int, user_script: str, user_args: str) -> None:
56     """
57     To launch multiple processes on a single node or multiple nodes via command line.
58 
59     Usage::
60         # run with 4 GPUs on the current node use default port 29500
61         colossalai run --nprocs_per_node 4 train.py
62 
63         # run with 2 GPUs on the current node at port 29550
64         colossalai run --nprocs_per_node 4 --master_port 29550 train.py
65 
66         # run on two nodes
67         colossalai run --host <host1>,<host2> --master_addr host1  --nprocs_per_node 4 train.py
68 
69         # run with hostfile
70         colossalai run --hostfile <file_path> --master_addr <host>  --nprocs_per_node 4 train.py
71 
72         # run with hostfile with only included hosts
73         colossalai run --hostfile <file_path> --master_addr host1 --include host1,host2  --nprocs_per_node 4 train.py
74 
75         # run with hostfile excluding the hosts selected
76         colossalai run --hostfile <file_path> --master_addr host1 --exclude host2  --nprocs_per_node 4 train.py
77     """
78     if not user_script.endswith('.py'):
79         click.echo(f'Error: invalid Python file {user_script}. Did you use a wrong option? Try colossalai run --help')
80         exit()
81 
82     args_dict = locals()
83     args = Config(args_dict)
84     args.user_args = list(args.user_args)
85     launch_multi_processes(args)
86
```
--- 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/colossalai/cli/launcher/__init__.py b/colossalai/cli/launcher/__init__.py
--- a/colossalai/cli/launcher/__init__.py
+++ b/colossalai/cli/launcher/__init__.py
@@ -1,7 +1,9 @@
 import click
-from .run import launch_multi_processes
+
 from colossalai.context import Config
 
+from .run import launch_multi_processes
+
 
 @click.command(help="Launch distributed training on a single node or multiple nodes",
                context_settings=dict(ignore_unknown_options=True))

{"golden_diff": "diff --git a/colossalai/cli/launcher/__init__.py b/colossalai/cli/launcher/__init__.py\n--- a/colossalai/cli/launcher/__init__.py\n+++ b/colossalai/cli/launcher/__init__.py\n@@ -1,7 +1,9 @@\n import click\n-from .run import launch_multi_processes\n+\n from colossalai.context import Config\n \n+from .run import launch_multi_processes\n+\n \n @click.command(help=\"Launch distributed training on a single node or multiple nodes\",\n                context_settings=dict(ignore_unknown_options=True))\n", "issue": "[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n", "before_files": [{"content": "import click\nfrom .run import launch_multi_processes\nfrom colossalai.context import Config\n\n\n@click.command(help=\"Launch distributed training on a single node or multiple nodes\",\n               context_settings=dict(ignore_unknown_options=True))\n@click.option(\"-H\",\n              \"-host\",\n              \"--host\",\n              type=str,\n              default=None,\n              help=\"the list of hostnames to launch in the format <host1>,<host2>\")\n@click.option(\n    \"--hostfile\",\n    type=str,\n    default=None,\n    help=\"Hostfile path that defines the device pool available to the job, each line in the file is a hostname\")\n@click.option(\"--include\",\n              type=str,\n              default=None,\n              help=\"Specify computing devices to use during execution. String format is <host1>,<host2>,\"\n              \" only effective when used with --hostfile.\")\n@click.option(\n    \"--exclude\",\n    type=str,\n    default=None,\n    help=\n    \"Specify computing devices to NOT use during execution. Mutually exclusive with --include. Formatting is the same as --includ,\"\n    \" only effective when used with --hostfile.\")\n@click.option(\"--num_nodes\",\n              type=int,\n              default=-1,\n              help=\"Total number of worker nodes to use, only effective when used with --hostfile.\")\n@click.option(\"--nproc_per_node\", type=int, default=None, help=\"Number of GPUs to use on each node.\")\n@click.option(\"--master_port\",\n              type=int,\n              default=29500,\n              help=\"(optional) Port used by PyTorch distributed for communication during distributed training.\")\n@click.option(\"--master_addr\",\n              type=str,\n              default=\"127.0.0.1\",\n              help=\"(optional) IP address of node 0, will be inferred via 'hostname -I' if not specified.\")\n@click.option(\n    \"--extra_launch_args\",\n    type=str,\n    default=None,\n    help=\n    \"Set additional torch distributed launcher arguments such as --standalone. The format is --extra_launch_args arg1=1,arg2=2. \"\n    \"This will be converted to --arg1=1 --arg2=2 during execution\")\n@click.option(\"--ssh-port\", type=int, default=None, help=\"(optional) the port used for ssh connection\")\n@click.argument(\"user_script\", type=str)\n@click.argument('user_args', nargs=-1)\ndef run(host: str, hostfile: str, num_nodes: int, nproc_per_node: int, include: str, exclude: str, master_addr: str,\n        master_port: int, extra_launch_args: str, ssh_port: int, user_script: str, user_args: str) -> None:\n    \"\"\"\n    To launch multiple processes on a single node or multiple nodes via command line.\n\n    Usage::\n        # run with 4 GPUs on the current node use default port 29500\n        colossalai run --nprocs_per_node 4 train.py\n\n        # run with 2 GPUs on the current node at port 29550\n        colossalai run --nprocs_per_node 4 --master_port 29550 train.py\n\n        # run on two nodes\n        colossalai run --host <host1>,<host2> --master_addr host1  --nprocs_per_node 4 train.py\n\n        # run with hostfile\n        colossalai run --hostfile <file_path> --master_addr <host>  --nprocs_per_node 4 train.py\n\n        # run with hostfile with only included hosts\n        colossalai run --hostfile <file_path> --master_addr host1 --include host1,host2  --nprocs_per_node 4 train.py\n\n        # run with hostfile excluding the hosts selected\n        colossalai run --hostfile <file_path> --master_addr host1 --exclude host2  --nprocs_per_node 4 train.py\n    \"\"\"\n    if not user_script.endswith('.py'):\n        click.echo(f'Error: invalid Python file {user_script}. Did you use a wrong option? Try colossalai run --help')\n        exit()\n\n    args_dict = locals()\n    args = Config(args_dict)\n    args.user_args = list(args.user_args)\n    launch_multi_processes(args)\n", "path": "colossalai/cli/launcher/__init__.py"}], "after_files": [{"content": "import click\n\nfrom colossalai.context import Config\n\nfrom .run import launch_multi_processes\n\n\n@click.command(help=\"Launch distributed training on a single node or multiple nodes\",\n               context_settings=dict(ignore_unknown_options=True))\n@click.option(\"-H\",\n              \"-host\",\n              \"--host\",\n              type=str,\n              default=None,\n              help=\"the list of hostnames to launch in the format <host1>,<host2>\")\n@click.option(\n    \"--hostfile\",\n    type=str,\n    default=None,\n    help=\"Hostfile path that defines the device pool available to the job, each line in the file is a hostname\")\n@click.option(\"--include\",\n              type=str,\n              default=None,\n              help=\"Specify computing devices to use during execution. String format is <host1>,<host2>,\"\n              \" only effective when used with --hostfile.\")\n@click.option(\n    \"--exclude\",\n    type=str,\n    default=None,\n    help=\n    \"Specify computing devices to NOT use during execution. Mutually exclusive with --include. Formatting is the same as --includ,\"\n    \" only effective when used with --hostfile.\")\n@click.option(\"--num_nodes\",\n              type=int,\n              default=-1,\n              help=\"Total number of worker nodes to use, only effective when used with --hostfile.\")\n@click.option(\"--nproc_per_node\", type=int, default=None, help=\"Number of GPUs to use on each node.\")\n@click.option(\"--master_port\",\n              type=int,\n              default=29500,\n              help=\"(optional) Port used by PyTorch distributed for communication during distributed training.\")\n@click.option(\"--master_addr\",\n              type=str,\n              default=\"127.0.0.1\",\n              help=\"(optional) IP address of node 0, will be inferred via 'hostname -I' if not specified.\")\n@click.option(\n    \"--extra_launch_args\",\n    type=str,\n    default=None,\n    help=\n    \"Set additional torch distributed launcher arguments such as --standalone. The format is --extra_launch_args arg1=1,arg2=2. \"\n    \"This will be converted to --arg1=1 --arg2=2 during execution\")\n@click.option(\"--ssh-port\", type=int, default=None, help=\"(optional) the port used for ssh connection\")\n@click.argument(\"user_script\", type=str)\n@click.argument('user_args', nargs=-1)\ndef run(host: str, hostfile: str, num_nodes: int, nproc_per_node: int, include: str, exclude: str, master_addr: str,\n        master_port: int, extra_launch_args: str, ssh_port: int, user_script: str, user_args: str) -> None:\n    \"\"\"\n    To launch multiple processes on a single node or multiple nodes via command line.\n\n    Usage::\n        # run with 4 GPUs on the current node use default port 29500\n        colossalai run --nprocs_per_node 4 train.py\n\n        # run with 2 GPUs on the current node at port 29550\n        colossalai run --nprocs_per_node 4 --master_port 29550 train.py\n\n        # run on two nodes\n        colossalai run --host <host1>,<host2> --master_addr host1  --nprocs_per_node 4 train.py\n\n        # run with hostfile\n        colossalai run --hostfile <file_path> --master_addr <host>  --nprocs_per_node 4 train.py\n\n        # run with hostfile with only included hosts\n        colossalai run --hostfile <file_path> --master_addr host1 --include host1,host2  --nprocs_per_node 4 train.py\n\n        # run with hostfile excluding the hosts selected\n        colossalai run --hostfile <file_path> --master_addr host1 --exclude host2  --nprocs_per_node 4 train.py\n    \"\"\"\n    if not user_script.endswith('.py'):\n        click.echo(f'Error: invalid Python file {user_script}. Did you use a wrong option? Try colossalai run --help')\n        exit()\n\n    args_dict = locals()\n    args = Config(args_dict)\n    args.user_args = list(args.user_args)\n    launch_multi_processes(args)\n", "path": "colossalai/cli/launcher/__init__.py"}]}