|
1 | | -# Testing NeMo-Reinforcer |
| 1 | +# Testing Reinforcer |
2 | 2 |
|
3 | 3 | ## Unit Tests |
4 | 4 |
|
| 5 | +:::{important} |
| 6 | +Unit tests require 2 GPUs to test the full suite. |
| 7 | +::: |
| 8 | + |
5 | 9 | ```sh |
| 10 | +# Install the project and the test dependencies |
6 | 11 | uv pip install -e '.[test]' |
| 12 | + |
| 13 | +# Run the unit tests using local GPUs |
7 | 14 | uv run bash tests/run_unit.sh |
8 | 15 | ``` |
9 | 16 |
|
10 | | -### Run Unit Tests Hermetic |
| 17 | +:::{note} |
| 18 | +Tests can also be run on SLURM with `ray.sub`, but note that some tests will be skipped |
| 19 | +due to no GPUs being located on the head node. To run the full suite of tests, please |
| 20 | +launch on a regular GPU allocation. |
| 21 | +::: |
11 | 22 |
|
12 | | -If your local environment does not have all the necessary dependencies (e.g., `gcc`, `nvcc`) |
13 | | -or there is concern that something in your environment may be misconfigured, you can also run |
14 | | -the tests in docker with this script: |
| 23 | +### Running Unit Tests in a Hermetic Environment |
| 24 | + |
| 25 | +For environments lacking necessary dependencies (e.g., `gcc`, `nvcc`) |
| 26 | +or where environmental configuration may be problematic, tests can be run |
| 27 | +in docker with this script: |
15 | 28 |
|
16 | 29 | ```sh |
17 | 30 | CONTAINER=... bash tests/run_unit_in_docker.sh |
18 | 31 | ``` |
19 | 32 |
|
20 | | -The `CONTAINER` can be built by following the instructions [here](docker.md). |
| 33 | +The required `CONTAINER` can be built by following the instructions in the [docker documentation](docker.md). |
21 | 34 |
|
22 | 35 | ## Functional tests |
23 | 36 |
|
24 | | -TBD |
| 37 | +:::{important} |
| 38 | +Functional tests may require multiple GPUs to run. See each script to understand the requirements. |
| 39 | +::: |
| 40 | + |
| 41 | +Functional tests are located under `tests/functional/`. |
| 42 | + |
| 43 | +```sh |
| 44 | +# Install the project and the test dependencies |
| 45 | +uv pip install -e '.[test]' |
| 46 | +# Run the functional test for sft |
| 47 | +uv run bash tests/functional/sft.sh |
| 48 | +``` |
| 49 | + |
| 50 | +At the end of each functional test, the metric checks will be printed as well as |
| 51 | +whether they pass or fail. Here is an example: |
| 52 | + |
| 53 | +```text |
| 54 | + Metric Checks |
| 55 | +┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓ |
| 56 | +┃ Status ┃ Check ┃ Value ┃ Message ┃ |
| 57 | +┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩ |
| 58 | +│ PASS │ data["train/loss"]["9"] < 1500 │ 817.4517822265625 │ │ |
| 59 | +└────────┴────────────────────────────────┴───────────────────┴─────────┘ |
| 60 | +``` |
| 61 | + |
| 62 | +### Running Functional Tests in a Hermetic Environment |
| 63 | + |
| 64 | +For environments lacking necessary dependencies (e.g., `gcc`, `nvcc`) |
| 65 | +or where environmental configuration may be problematic, tests can be run |
| 66 | +in docker with this script: |
| 67 | + |
| 68 | +```sh |
| 69 | +CONTAINER=... bash run_functional_in_docker.sh functional/sft.sh |
| 70 | +``` |
0 commit comments