From e8ad3c88f570a24180103eee8c2af6cd1c5f92d5 Mon Sep 17 00:00:00 2001 From: Baizhou Zhang Date: Wed, 14 Jun 2023 16:32:39 +0800 Subject: [PATCH] [doc] add a note about unit-testing to CONTRIBUTING.md (#3970) --- CONTRIBUTING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00abcf650158..a3dc020f74e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,6 +30,12 @@ pip install -e . ### Unit Tests We use [PyTest](https://docs.pytest.org/en/latest/) to execute tests. You can install pytest by `pip install pytest`. As some of the tests require initialization of the distributed backend, GPUs are needed to execute these tests. +To set up the environment for unit testing, first change your current directory to the root directory of your local ColossalAI repository, then run +```bash +pip install -r requirements/requirements-test.txt +``` +If you encounter an error telling "Could not find a version that satisfies the requirement fbgemm-gpu==0.2.0", please downgrade your python version to 3.8 or 3.9 and try again. + If you only want to run CPU tests, you can run ```bash @@ -138,4 +144,4 @@ You can now create a pull request on the GitHub webpage of your repository. The Do write clearly the description of your pull request and [link the pull request to your target issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue). This will automatically close the issue when the pull request is approved. -In case of code conflict, you should rebase your branch and resolve the conflicts manually. \ No newline at end of file +In case of code conflict, you should rebase your branch and resolve the conflicts manually.