hpcaitech / ColossalAI

Making large AI models cheaper, faster and more accessible
https://www.colossalai.org
Apache License 2.0
38.8k stars 4.35k forks source link

[BUG]: ModuleNotFoundError: No module named 'colossalai.nn.parallel' #5312

Open kangxi1818 opened 9 months ago

kangxi1818 commented 9 months ago

🐛 Describe the bug

I run the code in /ColossalAI-main/examples/images/diffusion python main.py --logdir /home/sx/sx_data/ColossalAI-main/examples/images/diffusion/log/ -t -b /home/sx/sx_data/ColossalAI-main/examples/images/diffusion/configs/train_colossalai_cifar10.yaml I got a error like this image

Environment

# packages in environment at /home/sx/miniconda3/envs/ldm:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             5.1                       1_gnu  
absl-py                   2.1.0                    pypi_0    pypi
aiofiles                  23.2.1                   pypi_0    pypi
aiohttp                   3.9.1                    pypi_0    pypi
aiosignal                 1.3.1                    pypi_0    pypi
albumentations            1.3.0                    pypi_0    pypi
altair                    5.2.0                    pypi_0    pypi
annotated-types           0.6.0                    pypi_0    pypi
antlr4-python3-runtime    4.8                      pypi_0    pypi
anyio                     4.2.0                    pypi_0    pypi
arrow                     1.3.0                    pypi_0    pypi
async-timeout             4.0.3                    pypi_0    pypi
attrs                     23.2.0                   pypi_0    pypi
bcrypt                    4.1.2                    pypi_0    pypi
beautifulsoup4            4.12.3                   pypi_0    pypi
blas                      1.0                         mkl  
blessed                   1.20.0                   pypi_0    pypi
blinker                   1.7.0                    pypi_0    pypi
boto3                     1.34.27                  pypi_0    pypi
botocore                  1.34.27                  pypi_0    pypi
braceexpand               0.1.7                    pypi_0    pypi
brotli-python             1.0.9            py39h6a678d5_7  
bzip2                     1.0.8                h7b6447c_0  
ca-certificates           2023.12.12           h06a4308_0  
cachetools                5.3.2                    pypi_0    pypi
certifi                   2023.11.17       py39h06a4308_0  
cffi                      1.15.1           py39h74dc2b5_0  
cfgv                      3.4.0                    pypi_0    pypi
charset-normalizer        2.0.4              pyhd3eb1b0_0  
click                     8.1.7                    pypi_0    pypi
colossalai                0.3.4                    pypi_0    pypi
contexttimer              0.3.3                    pypi_0    pypi
contourpy                 1.2.0                    pypi_0    pypi
croniter                  1.3.15                   pypi_0    pypi
cryptography              41.0.3           py39h130f0dd_0  
cudatoolkit               11.3.1               h2bc3f7f_2  
cycler                    0.12.1                   pypi_0    pypi
datasets                  2.16.1                   pypi_0    pypi
dateutils                 0.6.12                   pypi_0    pypi
decorator                 5.1.1                    pypi_0    pypi
deepdiff                  6.7.1                    pypi_0    pypi
deprecated                1.2.14                   pypi_0    pypi
dill                      0.3.7                    pypi_0    pypi
distlib                   0.3.8                    pypi_0    pypi
editor                    1.6.5                    pypi_0    pypi
einops                    0.7.0                    pypi_0    pypi
exceptiongroup            1.2.0                    pypi_0    pypi
fabric                    3.2.2                    pypi_0    pypi
fastapi                   0.88.0                   pypi_0    pypi
ffmpeg                    4.3                  hf484d3e_0    pytorch
ffmpy                     0.3.1                    pypi_0    pypi
filelock                  3.13.1                   pypi_0    pypi
fonttools                 4.47.2                   pypi_0    pypi
freetype                  2.12.1               h4a9f257_0  
frozenlist                1.4.1                    pypi_0    pypi
fsspec                    2023.10.0                pypi_0    pypi
ftfy                      6.1.3                    pypi_0    pypi
future                    0.18.3                   pypi_0    pypi
giflib                    5.2.1                h5eee18b_3  
gitdb                     4.0.11                   pypi_0    pypi
gitpython                 3.1.41                   pypi_0    pypi
gmp                       6.2.1                h295c915_3  
gnutls                    3.6.15               he1e5248_0  
google                    3.0.0                    pypi_0    pypi
google-auth               2.27.0                   pypi_0    pypi
google-auth-oauthlib      1.2.0                    pypi_0    pypi
gradio                    3.34.0                   pypi_0    pypi
gradio-client             0.8.1                    pypi_0    pypi
grpcio                    1.60.0                   pypi_0    pypi
h11                       0.14.0                   pypi_0    pypi
httpcore                  1.0.2                    pypi_0    pypi
httpx                     0.26.0                   pypi_0    pypi
huggingface-hub           0.20.3                   pypi_0    pypi
identify                  2.5.33                   pypi_0    pypi
idna                      3.4              py39h06a4308_0  
imageio                   2.33.1                   pypi_0    pypi
imageio-ffmpeg            0.4.2                    pypi_0    pypi
importlib-metadata        7.0.1                    pypi_0    pypi
importlib-resources       6.1.1                    pypi_0    pypi
inquirer                  3.2.1                    pypi_0    pypi
intel-openmp              2021.4.0          h06a4308_3561  
invoke                    2.2.0                    pypi_0    pypi
itsdangerous              2.1.2                    pypi_0    pypi
jinja2                    3.1.3                    pypi_0    pypi
jmespath                  1.0.1                    pypi_0    pypi
joblib                    1.3.2                    pypi_0    pypi
jpeg                      9e                   h5eee18b_1  
jsonschema                4.21.1                   pypi_0    pypi
jsonschema-specifications 2023.12.1                pypi_0    pypi
kiwisolver                1.4.5                    pypi_0    pypi
lame                      3.100                h7b6447c_0  
latent-diffusion          0.0.1                     dev_0    <develop>
lazy-loader               0.3                      pypi_0    pypi
lcms2                     2.12                 h3be6417_0  
ld_impl_linux-64          2.38                 h1181459_1  
lerc                      3.0                  h295c915_0  
libdeflate                1.17                 h5eee18b_1  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 11.2.0               h1234567_1  
libgomp                   11.2.0               h1234567_1  
libiconv                  1.16                 h7f8727e_2  
libidn2                   2.3.4                h5eee18b_0  
libpng                    1.6.39               h5eee18b_0  
libstdcxx-ng              11.2.0               h1234567_1  
libtasn1                  4.19.0               h5eee18b_0  
libtiff                   4.5.1                h6a678d5_0  
libunistring              0.9.10               h27cfd23_0  
libwebp                   1.3.2                h11a3e52_0  
libwebp-base              1.3.2                h5eee18b_0  
lightning                 1.9.0                    pypi_0    pypi
lightning-cloud           0.5.61                   pypi_0    pypi
lightning-utilities       0.10.1                   pypi_0    pypi
linkify-it-py             2.0.2                    pypi_0    pypi
lz4-c                     1.9.4                h6a678d5_0  
markdown                  3.5.2                    pypi_0    pypi
markdown-it-py            2.2.0                    pypi_0    pypi
markupsafe                2.1.4                    pypi_0    pypi
matplotlib                3.8.2                    pypi_0    pypi
mdit-py-plugins           0.3.3                    pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
mkl                       2021.4.0           h06a4308_640  
mkl-service               2.4.0            py39h7f8727e_0  
mkl_fft                   1.3.1            py39hd3c417c_0  
mkl_random                1.2.2            py39h51133e4_0  
mpmath                    1.3.0                    pypi_0    pypi
msgpack                   1.0.7                    pypi_0    pypi
multidict                 6.0.4                    pypi_0    pypi
multiprocess              0.70.15                  pypi_0    pypi
mypy-extensions           1.0.0                    pypi_0    pypi
ncurses                   6.4                  h6a678d5_0  
nettle                    3.7.3                hbbd107a_1  
networkx                  3.2.1                    pypi_0    pypi
ninja                     1.11.1.1                 pypi_0    pypi
nodeenv                   1.8.0                    pypi_0    pypi
numpy                     1.23.1           py39h6c91a56_0  
numpy-base                1.23.1           py39ha15fc14_0  
nvidia-cublas-cu12        12.1.3.1                 pypi_0    pypi
nvidia-cuda-cupti-cu12    12.1.105                 pypi_0    pypi
nvidia-cuda-nvrtc-cu12    12.1.105                 pypi_0    pypi
nvidia-cuda-runtime-cu12  12.1.105                 pypi_0    pypi
nvidia-cudnn-cu12         8.9.2.26                 pypi_0    pypi
nvidia-cufft-cu12         11.0.2.54                pypi_0    pypi
nvidia-curand-cu12        10.3.2.106               pypi_0    pypi
nvidia-cusolver-cu12      11.4.5.107               pypi_0    pypi
nvidia-cusparse-cu12      12.1.0.106               pypi_0    pypi
nvidia-nccl-cu12          2.18.1                   pypi_0    pypi
nvidia-nvjitlink-cu12     12.3.101                 pypi_0    pypi
nvidia-nvtx-cu12          12.1.105                 pypi_0    pypi
oauthlib                  3.2.2                    pypi_0    pypi
omegaconf                 2.1.1                    pypi_0    pypi
open-clip-torch           2.7.0                    pypi_0    pypi
opencv-python             4.6.0.66                 pypi_0    pypi
opencv-python-headless    4.9.0.80                 pypi_0    pypi
openh264                  2.1.1                h4ff587b_0  
openjpeg                  2.4.0                h3ad879b_0  
openssl                   1.1.1w               h7f8727e_0  
ordered-set               4.1.0                    pypi_0    pypi
orjson                    3.9.12                   pypi_0    pypi
packaging                 23.2                     pypi_0    pypi
pandas                    2.2.0                    pypi_0    pypi
paramiko                  3.4.0                    pypi_0    pypi
pillow                    10.0.1           py39ha6cbd5a_0  
pip                       20.3.3           py39h06a4308_0  
platformdirs              4.1.0                    pypi_0    pypi
pre-commit                3.6.0                    pypi_0    pypi
prefetch-generator        1.0.3                    pypi_0    pypi
protobuf                  4.23.4                   pypi_0    pypi
psutil                    5.9.8                    pypi_0    pypi
pudb                      2019.2                   pypi_0    pypi
pyarrow                   15.0.0                   pypi_0    pypi
pyarrow-hotfix            0.6                      pypi_0    pypi
pyasn1                    0.5.1                    pypi_0    pypi
pyasn1-modules            0.3.0                    pypi_0    pypi
pycparser                 2.21               pyhd3eb1b0_0  
pydantic                  1.10.14                  pypi_0    pypi
pydantic-core             2.14.6                   pypi_0    pypi
pydeck                    0.8.1b0                  pypi_0    pypi
pydeprecate               0.3.2                    pypi_0    pypi
pydub                     0.25.1                   pypi_0    pypi
pygments                  2.17.2                   pypi_0    pypi
pyjwt                     2.8.0                    pypi_0    pypi
pynacl                    1.5.0                    pypi_0    pypi
pyopenssl                 23.2.0           py39h06a4308_0  
pyparsing                 3.1.1                    pypi_0    pypi
pyre-extensions           0.0.23                   pypi_0    pypi
pysocks                   1.7.1            py39h06a4308_0  
python                    3.9.12               h12debd9_1  
python-dateutil           2.8.2                    pypi_0    pypi
python-multipart          0.0.6                    pypi_0    pypi
pytorch-mutex             1.0                        cuda    pytorch
pytz                      2023.3.post1             pypi_0    pypi
pyyaml                    6.0.1                    pypi_0    pypi
qudida                    0.0.4                    pypi_0    pypi
ray                       2.9.1                    pypi_0    pypi
readchar                  4.0.5                    pypi_0    pypi
readline                  8.2                  h5eee18b_0  
referencing               0.32.1                   pypi_0    pypi
regex                     2023.12.25               pypi_0    pypi
requests                  2.31.0           py39h06a4308_0  
requests-oauthlib         1.3.1                    pypi_0    pypi
rich                      13.7.0                   pypi_0    pypi
rpds-py                   0.17.1                   pypi_0    pypi
rsa                       4.9                      pypi_0    pypi
runs                      1.2.0                    pypi_0    pypi
s3transfer                0.10.0                   pypi_0    pypi
safetensors               0.4.2                    pypi_0    pypi
scikit-image              0.22.0                   pypi_0    pypi
scikit-learn              1.4.0                    pypi_0    pypi
scipy                     1.12.0                   pypi_0    pypi
semantic-version          2.10.0                   pypi_0    pypi
sentencepiece             0.1.99                   pypi_0    pypi
setuptools                68.2.2           py39h06a4308_0  
six                       1.16.0             pyhd3eb1b0_1  
smmap                     5.0.1                    pypi_0    pypi
sniffio                   1.3.0                    pypi_0    pypi
soupsieve                 2.5                      pypi_0    pypi
sqlite                    3.41.2               h5eee18b_0  
starlette                 0.22.0                   pypi_0    pypi
starsessions              1.3.0                    pypi_0    pypi
streamlit                 1.30.0                   pypi_0    pypi
sympy                     1.12                     pypi_0    pypi
tenacity                  8.2.3                    pypi_0    pypi
tensorboard               2.15.1                   pypi_0    pypi
tensorboard-data-server   0.7.2                    pypi_0    pypi
test-tube                 0.7.5                    pypi_0    pypi
threadpoolctl             3.2.0                    pypi_0    pypi
tifffile                  2023.12.9                pypi_0    pypi
timm                      0.9.12                   pypi_0    pypi
tk                        8.6.12               h1ccaba5_0  
tokenizers                0.15.1                   pypi_0    pypi
toml                      0.10.2                   pypi_0    pypi
toolz                     0.12.1                   pypi_0    pypi
torch                     2.1.2                    pypi_0    pypi
torchmetrics              0.7.0                    pypi_0    pypi
torchvision               0.13.1               py39_cu113    pytorch
tornado                   6.4                      pypi_0    pypi
tqdm                      4.66.1                   pypi_0    pypi
traitlets                 5.14.1                   pypi_0    pypi
transformers              4.37.1                   pypi_0    pypi
triton                    2.1.0                    pypi_0    pypi
types-python-dateutil     2.8.19.20240106          pypi_0    pypi
typing-inspect            0.9.0                    pypi_0    pypi
typing_extensions         4.9.0            py39h06a4308_1  
tzdata                    2023.4                   pypi_0    pypi
tzlocal                   5.2                      pypi_0    pypi
uc-micro-py               1.0.2                    pypi_0    pypi
urllib3                   1.26.18          py39h06a4308_0  
urwid                     2.4.6                    pypi_0    pypi
uvicorn                   0.27.0                   pypi_0    pypi
validators                0.22.0                   pypi_0    pypi
virtualenv                20.25.0                  pypi_0    pypi
watchdog                  3.0.0                    pypi_0    pypi
wcwidth                   0.2.13                   pypi_0    pypi
webdataset                0.2.5                    pypi_0    pypi
websocket-client          1.7.0                    pypi_0    pypi
websockets                11.0.3                   pypi_0    pypi
werkzeug                  3.0.1                    pypi_0    pypi
wheel                     0.41.2           py39h06a4308_0  
wrapt                     1.16.0                   pypi_0    pypi
xformers                  0.0.23.post1             pypi_0    pypi
xmod                      1.8.1                    pypi_0    pypi
xxhash                    3.4.1                    pypi_0    pypi
xz                        5.4.5                h5eee18b_0  
yarl                      1.9.4                    pypi_0    pypi
zipp                      3.17.0                   pypi_0    pypi
zlib                      1.2.13               h5eee18b_0  
zstd                      1.5.5                hc292b87_0   
digger-yu commented 9 months ago

// unofficial note suggest modify this local file and try again examples\community\roberta\pretraining\run_pretraining.py line 21 from colossalai.zero import zero_model_wrapper, zero_optim_wrapper