ColossalAI
ColossalAI copied to clipboard
[BUG]: Randomizer Raise Error When running on the CPU
🐛 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
OK I fixed this issue, I will submit a PR soon.
Thank you for your contribution