Installing Cornstarch
Cornstarch is a Python library that works with Pytorch (>=2.5) and ColossalAI (>=0.4.4).
Requirments
- OS: Linux.
- Python 3.10 and above.
- Pytorch 2.5 and above.
- Ampere or Hopper GPUs. Does not guarantee working on other generations of NVIDIA GPUs or AMD GPUs.
Note
It is highly recommended to use a Pytorch Docker container that provides pre-compiled CUDA, NCCL, Python, and Pytorch, and then install colossalai
and Cornstarch
in it.
For systems powered by ARM CPUs (e.g. Altera or Grace), use an NVIDIA NGC Pytorch Docker container.
Follow NVIDIA Container toolkit guideline to use GPUs inside a Docker container.
Install Cornstarch from PyPI
Cornstarch relies on Colossal-AI for training a multimodal LLM, which has a strict version requirement on Pytorch and Huggingface transformers that are not compatible with Cornstarch dependencies.
For this reason, ColossalAI should first manually be installed and then should Cornstarch be installed:
Note
You will see an error message from pip dependency resolver similar to the following:
But this is expected and there is no problem in installing and using cornstarch. You can also see that packages including cornstarch are successfully installed right after the error message:
Install Cornstarch from Source
You can also install Cornstarch from source by cloning the Github repository. Manual colossalai
installation introduced above should still be done.