ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[BUG]: AttributeError: _old_init is not found in the BertEmbeddings, please make sure that you have imported BertEmbeddings before entering the context

Open chexiangying opened this issue 3 years ago • 1 comments

🐛 Describe the bug

File "/home/tiger/.local/lib/python3.7/site-packages/colossalai/utils/model/utils.py", line 92, in exit substitute_init_recursively(torch.nn.modules.module.Module, _disable_class, set()) File "/home/tiger/.local/lib/python3.7/site-packages/colossalai/utils/model/utils.py", line 10, in substitute_init_recursively func(subcls) File "/home/tiger/.local/lib/python3.7/site-packages/colossalai/utils/model/utils.py", line 87, in _disable_class f"_old_init is not found in the {cls.name}, please make sure that you have imported {cls.name} before entering the context." AttributeError: _old_init is not found in the BertEmbeddings, please make sure that you have imported BertEmbeddings before entering the context

Environment

No response

chexiangying avatar Dec 28 '22 11:12 chexiangying

Hi @chexiangying,

could you give more information to repeat your bug? accroding to the current information provided, I believe you should pay attentions to the submodules of your model. you should make sure that all modules are initialized under the context ColoInitContext.

1SAA avatar Jan 05 '23 06:01 1SAA

We have updated a lot. This issue was closed due to inactivity. Thanks.

binmakeswell avatar Apr 14 '23 09:04 binmakeswell