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

[BUG]: Gemini is not compatible with LoRA
### 🐛 Describe the bug

`loralib` provides LoRALinear layer:

![image](https://user-images.githubusercontent.com/23111350/218422859-ed8072a6-37a7-46c0-a1ec-b2fb428743f5.png)


When using `ColoInitContext`, it first convert `self.weigh` to `ColoParameter` after line 105. In line 112, `self.weight.new_zeros()` will return a `ColoTensor`. Then it will be wrapped by `Parameter`. In this case, `isinstance(self.lora_A, ColoParameter)` is `True`, but it does not run `ColoParameter.__init__()`.

`ColoInitContext` should ensure `type(p) is ColoParameter`.

### Environment

torch 1.12.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: `colossalai/utils/model/colo_init_context.py`
Content:
```
1 from typing import Any, Dict, Iterator, Optional, Tuple, Union
2 
3 import torch
4 from torch import nn
5 
6 from colossalai.nn.parallel.layers import ColoEmbedding, ColoLinear, register_colo_module
7 from colossalai.tensor import ColoParameter, ColoTensor, ProcessGroup
8 
9 from .utils import InsertPostInitMethodToModuleSubClasses
10 
11 # find named_params includes replica
12 
13 
14 def _named_params_with_replica(
15     module: nn.Module,
16     prefix: str = '',
17     recurse: bool = True,
18 ) -> Iterator[Tuple[str, Union[nn.Parameter, ColoTensor]]]:
19     modules = module.named_modules(prefix=prefix) if recurse else [(prefix, module)]
20 
21     for mod_prefix, mod in modules:
22         for name, val in mod._parameters.items():
23             if val is None:
24                 continue
25             name = mod_prefix + ('.' if mod_prefix else '') + name
26             yield name, val
27 
28 
29 def _convert_to_coloparam(param: torch.nn.Parameter,
30                           device: torch.device,
31                           dtype=torch.float,
32                           default_pg: Optional[ProcessGroup] = None,
33                           default_dist_spec: Optional[Any] = None) -> ColoParameter:
34 
35     if isinstance(param, ColoParameter):
36         return param
37     # detaching tensor is necessary for optimizers.
38     requires_grad = param.requires_grad
39     # param is the global tensor.
40 
41     if param.device.type == "meta":
42         colo_param = ColoParameter(param, requires_grad=requires_grad)
43     else:
44         colo_param = ColoParameter(param.to(device=device, dtype=dtype), requires_grad=requires_grad)
45 
46     # if default_shard_plan exists, shard the param during initialization.
47     # This can reduce the model size after initialization.
48     # NOTE() embedding usually can not be correctly sharded. So I use except to handle
49     # the param that can not be sharded by the default plan
50     if default_pg is not None:
51         colo_param.set_process_group(default_pg)
52 
53     if default_dist_spec is not None:
54         try:
55             colo_param.set_dist_spec(default_dist_spec)
56         except:
57             pass
58     return colo_param
59 
60 
61 def ColoModulize(module):
62     """
63     Replacing the parameters() and named_parameters() with our customized ones
64     """
65 
66     module._colo_visited = True
67 
68 
69 class ColoInitContext(InsertPostInitMethodToModuleSubClasses):
70 
71     def __init__(self,
72                  device: torch.device = torch.device('cpu'),
73                  dtype: torch.dtype = torch.float,
74                  default_pg: Optional[ProcessGroup] = None,
75                  default_dist_spec=None):
76         """
77         Args:
78             device (torch.device): the device where parameters initialized are resident. Defaults to torch.device('cpu').
79             dtype (torch.dtype): the dtype of parameters initialized. Defults to torch.float.
80             default_pg (ProcessGroup): the default process group for all initialized parameters.
81             default_dist_spec: the default distributed specifications.
82         """
83         super().__init__()
84         self._device = device
85         self._dtype = dtype
86 
87         self._register_colo_modules()
88         self._default_pg = default_pg
89         self._default_dist_spec = default_dist_spec
90 
91     def _register_colo_modules(self):
92         register_colo_module(torch.nn.Linear, ColoLinear())
93         register_colo_module(torch.nn.Embedding, ColoEmbedding())
94 
95     def _pre_context_exec(self):
96         pass
97 
98     def _post_init_method(self, module: torch.nn.Module, *args, **kwargs):
99         """
100         The function to call at the end of the constructor of each module.
101         FIXME(fjr) The module may be passed to this function multiple times?
102         """
103         name_list = []
104         for name, param in _named_params_with_replica(module):
105             if isinstance(param, ColoTensor):
106                 continue
107 
108             split = name.rfind('.')
109             if split >= 0:    # param in submodule
110                 module_name = name[:split]
111                 param_name = name[split + 1:]
112             else:
113                 module_name = ''    # param in current module
114                 param_name = name
115             name_list.append((module_name, param_name))
116 
117         replaced_tensors = dict(
118         )    # record mapping between (torch.Tensor, ColoTensor) to distinguish the same reference
119         for module_name, param_name in name_list:
120             submodule = module.get_submodule(module_name)
121             param = submodule.get_parameter(param_name)
122             if param in replaced_tensors:
123                 colo_param = replaced_tensors[param]
124             else:
125                 colo_param = _convert_to_coloparam(param, self._device, self._dtype, self._default_pg,
126                                                    self._default_dist_spec)
127                 replaced_tensors[param] = colo_param
128             delattr(submodule, param_name)
129             setattr(submodule, param_name, colo_param)
130             colo_param.shared_param_modules.append(submodule)
131 
132         param_number = 0
133         meta_param_number = 0
134         buffer_number = 0
135         meta_buffer_number = 0
136 
137         for param in module.parameters():
138             param_number += 1
139             meta_param_number += (param.device.type == 'meta')
140 
141         for buffer in module.buffers():
142             buffer_number += 1
143             meta_buffer_number += (buffer.device.type == 'meta')
144 
145         if meta_param_number > 0 and meta_param_number != param_number:
146             raise ValueError("Meta parameters and valued parameters can not  be in the same model")
147         if meta_buffer_number > 0 and meta_buffer_number != buffer_number:
148             raise ValueError("Meta buffers and valued buffers can not be in the same model")
149 
150         if meta_buffer_number == 0:
151             for buffer in module.buffers():
152                 buffer.data = buffer.data.to(device=self._device)
153 
154 
155 def post_process_colo_init_ctx(model: torch.nn.Module,
156                                device: torch.device = torch.device('cpu'),
157                                dtype: torch.dtype = torch.float,
158                                default_pg: Optional[ProcessGroup] = None,
159                                default_dist_spec=None):
160     """post_process_colo_init_ctx
161 
162     This function is called after `ColoInitContext`.
163 
164     Args:
165         model (torch.nn.module): the model
166         device (torch.device, optional): device type of the model params. Defaults to torch.device('cpu').
167         dtype (torch.dtype, optional): dtype of the model params. Defaults to torch.float.
168         default_pg (Optional[ProcessGroup], optional): default process group. Defaults to None. Inidicates a DP-only process group.
169         default_dist_spec (Any, optional): default dist spec of params. Defaults to None.
170 
171     Raises:
172         RuntimeError: raise error if
173     """
174 
175     torch_params = []
176     for n, p in model.named_parameters():
177         if not isinstance(p, ColoParameter):
178             # print(f"{n} is not a ColoParameter. We are going to converting it to ColoParameter")
179             torch_params.append((n, p))
180 
181     for (n, param) in torch_params:
182         name_list = n.split('.')
183         module = model
184         for i in range(len(name_list) - 1):
185             module = module._modules[name_list[i]]
186         delattr(module, name_list[-1])
187         setattr(module, name_list[-1], _convert_to_coloparam(param, device, dtype, default_pg, default_dist_spec))
188 
189     del torch_params
190     for n, p in model.named_parameters():
191         if not isinstance(p, ColoTensor):
192             raise RuntimeError
193
```
--- 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/utils/model/colo_init_context.py b/colossalai/utils/model/colo_init_context.py
--- a/colossalai/utils/model/colo_init_context.py
+++ b/colossalai/utils/model/colo_init_context.py
@@ -32,7 +32,7 @@
                           default_pg: Optional[ProcessGroup] = None,
                           default_dist_spec: Optional[Any] = None) -> ColoParameter:
 
-    if isinstance(param, ColoParameter):
+    if type(param) is ColoParameter:
         return param
     # detaching tensor is necessary for optimizers.
     requires_grad = param.requires_grad
@@ -102,7 +102,7 @@
         """
         name_list = []
         for name, param in _named_params_with_replica(module):
-            if isinstance(param, ColoTensor):
+            if type(param) is ColoParameter:
                 continue
 
             split = name.rfind('.')

{"golden_diff": "diff --git a/colossalai/utils/model/colo_init_context.py b/colossalai/utils/model/colo_init_context.py\n--- a/colossalai/utils/model/colo_init_context.py\n+++ b/colossalai/utils/model/colo_init_context.py\n@@ -32,7 +32,7 @@\n                           default_pg: Optional[ProcessGroup] = None,\n                           default_dist_spec: Optional[Any] = None) -> ColoParameter:\n \n-    if isinstance(param, ColoParameter):\n+    if type(param) is ColoParameter:\n         return param\n     # detaching tensor is necessary for optimizers.\n     requires_grad = param.requires_grad\n@@ -102,7 +102,7 @@\n         \"\"\"\n         name_list = []\n         for name, param in _named_params_with_replica(module):\n-            if isinstance(param, ColoTensor):\n+            if type(param) is ColoParameter:\n                 continue\n \n             split = name.rfind('.')\n", "issue": "[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n[tensor] fix some unittests\n\n[BUG]: Gemini is not compatible with LoRA\n### \ud83d\udc1b Describe the bug\n\n`loralib` provides LoRALinear layer:\r\n\r\n![image](https://user-images.githubusercontent.com/23111350/218422859-ed8072a6-37a7-46c0-a1ec-b2fb428743f5.png)\r\n\r\n\r\nWhen using `ColoInitContext`, it first convert `self.weigh` to `ColoParameter` after line 105. In line 112, `self.weight.new_zeros()` will return a `ColoTensor`. Then it will be wrapped by `Parameter`. In this case, `isinstance(self.lora_A, ColoParameter)` is `True`, but it does not run `ColoParameter.__init__()`.\r\n\r\n`ColoInitContext` should ensure `type(p) is ColoParameter`.\n\n### Environment\n\ntorch 1.12.0\n", "before_files": [{"content": "from typing import Any, Dict, Iterator, Optional, Tuple, Union\n\nimport torch\nfrom torch import nn\n\nfrom colossalai.nn.parallel.layers import ColoEmbedding, ColoLinear, register_colo_module\nfrom colossalai.tensor import ColoParameter, ColoTensor, ProcessGroup\n\nfrom .utils import InsertPostInitMethodToModuleSubClasses\n\n# find named_params includes replica\n\n\ndef _named_params_with_replica(\n    module: nn.Module,\n    prefix: str = '',\n    recurse: bool = True,\n) -> Iterator[Tuple[str, Union[nn.Parameter, ColoTensor]]]:\n    modules = module.named_modules(prefix=prefix) if recurse else [(prefix, module)]\n\n    for mod_prefix, mod in modules:\n        for name, val in mod._parameters.items():\n            if val is None:\n                continue\n            name = mod_prefix + ('.' if mod_prefix else '') + name\n            yield name, val\n\n\ndef _convert_to_coloparam(param: torch.nn.Parameter,\n                          device: torch.device,\n                          dtype=torch.float,\n                          default_pg: Optional[ProcessGroup] = None,\n                          default_dist_spec: Optional[Any] = None) -> ColoParameter:\n\n    if isinstance(param, ColoParameter):\n        return param\n    # detaching tensor is necessary for optimizers.\n    requires_grad = param.requires_grad\n    # param is the global tensor.\n\n    if param.device.type == \"meta\":\n        colo_param = ColoParameter(param, requires_grad=requires_grad)\n    else:\n        colo_param = ColoParameter(param.to(device=device, dtype=dtype), requires_grad=requires_grad)\n\n    # if default_shard_plan exists, shard the param during initialization.\n    # This can reduce the model size after initialization.\n    # NOTE() embedding usually can not be correctly sharded. So I use except to handle\n    # the param that can not be sharded by the default plan\n    if default_pg is not None:\n        colo_param.set_process_group(default_pg)\n\n    if default_dist_spec is not None:\n        try:\n            colo_param.set_dist_spec(default_dist_spec)\n        except:\n            pass\n    return colo_param\n\n\ndef ColoModulize(module):\n    \"\"\"\n    Replacing the parameters() and named_parameters() with our customized ones\n    \"\"\"\n\n    module._colo_visited = True\n\n\nclass ColoInitContext(InsertPostInitMethodToModuleSubClasses):\n\n    def __init__(self,\n                 device: torch.device = torch.device('cpu'),\n                 dtype: torch.dtype = torch.float,\n                 default_pg: Optional[ProcessGroup] = None,\n                 default_dist_spec=None):\n        \"\"\"\n        Args:\n            device (torch.device): the device where parameters initialized are resident. Defaults to torch.device('cpu').\n            dtype (torch.dtype): the dtype of parameters initialized. Defults to torch.float.\n            default_pg (ProcessGroup): the default process group for all initialized parameters.\n            default_dist_spec: the default distributed specifications.\n        \"\"\"\n        super().__init__()\n        self._device = device\n        self._dtype = dtype\n\n        self._register_colo_modules()\n        self._default_pg = default_pg\n        self._default_dist_spec = default_dist_spec\n\n    def _register_colo_modules(self):\n        register_colo_module(torch.nn.Linear, ColoLinear())\n        register_colo_module(torch.nn.Embedding, ColoEmbedding())\n\n    def _pre_context_exec(self):\n        pass\n\n    def _post_init_method(self, module: torch.nn.Module, *args, **kwargs):\n        \"\"\"\n        The function to call at the end of the constructor of each module.\n        FIXME(fjr) The module may be passed to this function multiple times?\n        \"\"\"\n        name_list = []\n        for name, param in _named_params_with_replica(module):\n            if isinstance(param, ColoTensor):\n                continue\n\n            split = name.rfind('.')\n            if split >= 0:    # param in submodule\n                module_name = name[:split]\n                param_name = name[split + 1:]\n            else:\n                module_name = ''    # param in current module\n                param_name = name\n            name_list.append((module_name, param_name))\n\n        replaced_tensors = dict(\n        )    # record mapping between (torch.Tensor, ColoTensor) to distinguish the same reference\n        for module_name, param_name in name_list:\n            submodule = module.get_submodule(module_name)\n            param = submodule.get_parameter(param_name)\n            if param in replaced_tensors:\n                colo_param = replaced_tensors[param]\n            else:\n                colo_param = _convert_to_coloparam(param, self._device, self._dtype, self._default_pg,\n                                                   self._default_dist_spec)\n                replaced_tensors[param] = colo_param\n            delattr(submodule, param_name)\n            setattr(submodule, param_name, colo_param)\n            colo_param.shared_param_modules.append(submodule)\n\n        param_number = 0\n        meta_param_number = 0\n        buffer_number = 0\n        meta_buffer_number = 0\n\n        for param in module.parameters():\n            param_number += 1\n            meta_param_number += (param.device.type == 'meta')\n\n        for buffer in module.buffers():\n            buffer_number += 1\n            meta_buffer_number += (buffer.device.type == 'meta')\n\n        if meta_param_number > 0 and meta_param_number != param_number:\n            raise ValueError(\"Meta parameters and valued parameters can not  be in the same model\")\n        if meta_buffer_number > 0 and meta_buffer_number != buffer_number:\n            raise ValueError(\"Meta buffers and valued buffers can not be in the same model\")\n\n        if meta_buffer_number == 0:\n            for buffer in module.buffers():\n                buffer.data = buffer.data.to(device=self._device)\n\n\ndef post_process_colo_init_ctx(model: torch.nn.Module,\n                               device: torch.device = torch.device('cpu'),\n                               dtype: torch.dtype = torch.float,\n                               default_pg: Optional[ProcessGroup] = None,\n                               default_dist_spec=None):\n    \"\"\"post_process_colo_init_ctx\n\n    This function is called after `ColoInitContext`.\n\n    Args:\n        model (torch.nn.module): the model\n        device (torch.device, optional): device type of the model params. Defaults to torch.device('cpu').\n        dtype (torch.dtype, optional): dtype of the model params. Defaults to torch.float.\n        default_pg (Optional[ProcessGroup], optional): default process group. Defaults to None. Inidicates a DP-only process group.\n        default_dist_spec (Any, optional): default dist spec of params. Defaults to None.\n\n    Raises:\n        RuntimeError: raise error if\n    \"\"\"\n\n    torch_params = []\n    for n, p in model.named_parameters():\n        if not isinstance(p, ColoParameter):\n            # print(f\"{n} is not a ColoParameter. We are going to converting it to ColoParameter\")\n            torch_params.append((n, p))\n\n    for (n, param) in torch_params:\n        name_list = n.split('.')\n        module = model\n        for i in range(len(name_list) - 1):\n            module = module._modules[name_list[i]]\n        delattr(module, name_list[-1])\n        setattr(module, name_list[-1], _convert_to_coloparam(param, device, dtype, default_pg, default_dist_spec))\n\n    del torch_params\n    for n, p in model.named_parameters():\n        if not isinstance(p, ColoTensor):\n            raise RuntimeError\n", "path": "colossalai/utils/model/colo_init_context.py"}], "after_files": [{"content": "from typing import Any, Dict, Iterator, Optional, Tuple, Union\n\nimport torch\nfrom torch import nn\n\nfrom colossalai.nn.parallel.layers import ColoEmbedding, ColoLinear, register_colo_module\nfrom colossalai.tensor import ColoParameter, ColoTensor, ProcessGroup\n\nfrom .utils import InsertPostInitMethodToModuleSubClasses\n\n# find named_params includes replica\n\n\ndef _named_params_with_replica(\n    module: nn.Module,\n    prefix: str = '',\n    recurse: bool = True,\n) -> Iterator[Tuple[str, Union[nn.Parameter, ColoTensor]]]:\n    modules = module.named_modules(prefix=prefix) if recurse else [(prefix, module)]\n\n    for mod_prefix, mod in modules:\n        for name, val in mod._parameters.items():\n            if val is None:\n                continue\n            name = mod_prefix + ('.' if mod_prefix else '') + name\n            yield name, val\n\n\ndef _convert_to_coloparam(param: torch.nn.Parameter,\n                          device: torch.device,\n                          dtype=torch.float,\n                          default_pg: Optional[ProcessGroup] = None,\n                          default_dist_spec: Optional[Any] = None) -> ColoParameter:\n\n    if type(param) is ColoParameter:\n        return param\n    # detaching tensor is necessary for optimizers.\n    requires_grad = param.requires_grad\n    # param is the global tensor.\n\n    if param.device.type == \"meta\":\n        colo_param = ColoParameter(param, requires_grad=requires_grad)\n    else:\n        colo_param = ColoParameter(param.to(device=device, dtype=dtype), requires_grad=requires_grad)\n\n    # if default_shard_plan exists, shard the param during initialization.\n    # This can reduce the model size after initialization.\n    # NOTE() embedding usually can not be correctly sharded. So I use except to handle\n    # the param that can not be sharded by the default plan\n    if default_pg is not None:\n        colo_param.set_process_group(default_pg)\n\n    if default_dist_spec is not None:\n        try:\n            colo_param.set_dist_spec(default_dist_spec)\n        except:\n            pass\n    return colo_param\n\n\ndef ColoModulize(module):\n    \"\"\"\n    Replacing the parameters() and named_parameters() with our customized ones\n    \"\"\"\n\n    module._colo_visited = True\n\n\nclass ColoInitContext(InsertPostInitMethodToModuleSubClasses):\n\n    def __init__(self,\n                 device: torch.device = torch.device('cpu'),\n                 dtype: torch.dtype = torch.float,\n                 default_pg: Optional[ProcessGroup] = None,\n                 default_dist_spec=None):\n        \"\"\"\n        Args:\n            device (torch.device): the device where parameters initialized are resident. Defaults to torch.device('cpu').\n            dtype (torch.dtype): the dtype of parameters initialized. Defults to torch.float.\n            default_pg (ProcessGroup): the default process group for all initialized parameters.\n            default_dist_spec: the default distributed specifications.\n        \"\"\"\n        super().__init__()\n        self._device = device\n        self._dtype = dtype\n\n        self._register_colo_modules()\n        self._default_pg = default_pg\n        self._default_dist_spec = default_dist_spec\n\n    def _register_colo_modules(self):\n        register_colo_module(torch.nn.Linear, ColoLinear())\n        register_colo_module(torch.nn.Embedding, ColoEmbedding())\n\n    def _pre_context_exec(self):\n        pass\n\n    def _post_init_method(self, module: torch.nn.Module, *args, **kwargs):\n        \"\"\"\n        The function to call at the end of the constructor of each module.\n        FIXME(fjr) The module may be passed to this function multiple times?\n        \"\"\"\n        name_list = []\n        for name, param in _named_params_with_replica(module):\n            if type(param) is ColoParameter:\n                continue\n\n            split = name.rfind('.')\n            if split >= 0:    # param in submodule\n                module_name = name[:split]\n                param_name = name[split + 1:]\n            else:\n                module_name = ''    # param in current module\n                param_name = name\n            name_list.append((module_name, param_name))\n\n        replaced_tensors = dict(\n        )    # record mapping between (torch.Tensor, ColoTensor) to distinguish the same reference\n        for module_name, param_name in name_list:\n            submodule = module.get_submodule(module_name)\n            param = submodule.get_parameter(param_name)\n            if param in replaced_tensors:\n                colo_param = replaced_tensors[param]\n            else:\n                colo_param = _convert_to_coloparam(param, self._device, self._dtype, self._default_pg,\n                                                   self._default_dist_spec)\n                replaced_tensors[param] = colo_param\n            delattr(submodule, param_name)\n            setattr(submodule, param_name, colo_param)\n            colo_param.shared_param_modules.append(submodule)\n\n        param_number = 0\n        meta_param_number = 0\n        buffer_number = 0\n        meta_buffer_number = 0\n\n        for param in module.parameters():\n            param_number += 1\n            meta_param_number += (param.device.type == 'meta')\n\n        for buffer in module.buffers():\n            buffer_number += 1\n            meta_buffer_number += (buffer.device.type == 'meta')\n\n        if meta_param_number > 0 and meta_param_number != param_number:\n            raise ValueError(\"Meta parameters and valued parameters can not  be in the same model\")\n        if meta_buffer_number > 0 and meta_buffer_number != buffer_number:\n            raise ValueError(\"Meta buffers and valued buffers can not be in the same model\")\n\n        if meta_buffer_number == 0:\n            for buffer in module.buffers():\n                buffer.data = buffer.data.to(device=self._device)\n\n\ndef post_process_colo_init_ctx(model: torch.nn.Module,\n                               device: torch.device = torch.device('cpu'),\n                               dtype: torch.dtype = torch.float,\n                               default_pg: Optional[ProcessGroup] = None,\n                               default_dist_spec=None):\n    \"\"\"post_process_colo_init_ctx\n\n    This function is called after `ColoInitContext`.\n\n    Args:\n        model (torch.nn.module): the model\n        device (torch.device, optional): device type of the model params. Defaults to torch.device('cpu').\n        dtype (torch.dtype, optional): dtype of the model params. Defaults to torch.float.\n        default_pg (Optional[ProcessGroup], optional): default process group. Defaults to None. Inidicates a DP-only process group.\n        default_dist_spec (Any, optional): default dist spec of params. Defaults to None.\n\n    Raises:\n        RuntimeError: raise error if\n    \"\"\"\n\n    torch_params = []\n    for n, p in model.named_parameters():\n        if not isinstance(p, ColoParameter):\n            # print(f\"{n} is not a ColoParameter. We are going to converting it to ColoParameter\")\n            torch_params.append((n, p))\n\n    for (n, param) in torch_params:\n        name_list = n.split('.')\n        module = model\n        for i in range(len(name_list) - 1):\n            module = module._modules[name_list[i]]\n        delattr(module, name_list[-1])\n        setattr(module, name_list[-1], _convert_to_coloparam(param, device, dtype, default_pg, default_dist_spec))\n\n    del torch_params\n    for n, p in model.named_parameters():\n        if not isinstance(p, ColoTensor):\n            raise RuntimeError\n", "path": "colossalai/utils/model/colo_init_context.py"}]}