ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[BUG]: No module named 'colossalai.kernel.op_builder'

Open zscwind opened this issue 2 years ago • 8 comments

🐛 Describe the bug

from colossalai.kernel.op_builder.layernorm import LayerNormBuilder ModuleNotFoundError: No module named 'colossalai.kernel.op_builder'

Environment

pyhton 3.8.0 CUDA 11.6 torch 1.13.0+cu116

zscwind avatar Feb 16 '23 12:02 zscwind

Please build Colossalai with cuda extension and try again. Refer to this file for relevant details.

JThh avatar Feb 16 '23 16:02 JThh

Did you install from pypi or from source?

FrankLeeeee avatar Feb 17 '23 01:02 FrankLeeeee

Did you install from pypi or from source?

from source

zscwind avatar Feb 17 '23 02:02 zscwind

The given file's env: pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch but mine is: pyhton==3.8.0 CUDA==11.6 torch==1.13.0+cu116 I did as the file's command, but the error still exists: No module named 'colossalai.kernel.op_builder'

zscwind avatar Feb 17 '23 02:02 zscwind

This is likely that you are importing colossalai in the repository root directory, which means you current directory is Colossal-AI as given below. If this is the case, that means Python is importing from the colossalai folder instead of the installed package.

- Colossal-AI
   - colossalai
   - setup.py
   - examples
   - ...

FrankLeeeee avatar Feb 17 '23 02:02 FrankLeeeee

This is likely that you are importing colossalai in the repository root directory, which means you current directory is Colossal-AI as given below. If this is the case, that means Python is importing from the colossalai folder instead of the installed package.

- Colossal-AI
   - colossalai
   - setup.py
   - examples
   - ...

So, I should install from pypi?

zscwind avatar Feb 17 '23 02:02 zscwind

You can give it a try and do not execute your code from the root directory.

FrankLeeeee avatar Feb 17 '23 02:02 FrankLeeeee

You can give it a try and do not execute your code from the root directory.

It works, thank you, Frank!

zscwind avatar Feb 17 '23 02:02 zscwind

No problem! I will close this issue for now.

FrankLeeeee avatar Feb 20 '23 09:02 FrankLeeeee

请使用 cuda 扩展构建 Colossalai,然后重试。相关详细信息请参阅此文件。

your answers are not helpful.

chensimian avatar Nov 02 '23 09:11 chensimian