ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[BUG]: Randomizer Raise Error When running on the CPU

Open Orion-Zheng opened this issue 2 years ago • 2 comments

🐛 Describe the bug

The Bug is raise from: https://github.com/hpcaitech/ColossalAI/blob/main/colossalai/moe/experts.py#L88

You can reproduce the error by simply running code below:

from colossalai.shardformer.layer.utils import Randomizer
Randomizer(42).fork_rng(enable_cpu=True)  # raise error if run on CPU

This will cause OpenMoE unable to initialize parameters on CPU.

Environment

No response

Orion-Zheng avatar Dec 28 '23 08:12 Orion-Zheng

OK I fixed this issue, I will submit a PR soon.

Orion-Zheng avatar Dec 30 '23 19:12 Orion-Zheng

Thank you for your contribution

flybird11111 avatar Feb 18 '24 11:02 flybird11111