Skip to content

Commit cd9fc37

Browse files
Jack-KhuuDNXie
authored andcommitted
Updating outdated tests/README (meta-pytorch#459)
1 parent 7d8ee61 commit cd9fc37

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

tests/README.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ This directory contains tests for the forge project, including unit tests and in
55
## Test Structure
66

77
- `unit_tests/`: Contains unit tests for individual components
8-
- `integration_tests.py`: Contains integration tests that test multiple components together
9-
- `integration_tests_h100.py`: Contains integration tests specifically designed for H100 GPUs, which utilize symmetric memory and float8.
8+
- `integration_tests/`: Contains integration tests that test multiple components together
9+
- `sandbox/`: Contains experimental adhoc scripts used for development and debugging
1010
- `assets/`: Contains test assets and fixtures used by the tests
1111

1212
## Running Tests
@@ -21,50 +21,49 @@ pip install .[dev]
2121

2222
### Running Integration Tests
2323

24-
To run the integration tests:
24+
To run all integration tests:
2525

2626
```bash
27-
python ./tests/integration_tests.py <output_dir> [--config_dir CONFIG_DIR] [--test TEST] [--ngpu NGPU]
27+
pytest -s tests/integration_tests/
2828
```
2929

30-
Arguments:
31-
- `output_dir`: (Required) Directory where test outputs will be stored
32-
- `--config_dir`: (Optional) Directory containing configuration files (default: "./torchtitan/models/llama3/train_configs")
33-
- `--test`: (Optional) Specific test to run, use test names from the `build_test_list()` function (default: "all")
34-
- `--ngpu`: (Optional) Number of GPUs to use for testing (default: 8)
30+
To run a specific integration test file:
3531

36-
Examples:
3732
```bash
38-
# Run all integration tests with 8 GPUs
39-
python ./tests/integration_tests.py ./test_output
33+
pytest -s tests/integration_tests/test_vllm_policy_correctness.py
34+
```
35+
36+
To run a specific integration test function:
37+
38+
```bash
39+
pytest -s tests/integration_tests/test_vllm_policy_correctness.py::test_same_output
40+
```
4041

41-
# Run a specific test with 4 GPUs
42-
python ./tests/integration_tests.py ./test_output --test default --ngpu 4
42+
Integration tests support custom options defined in `conftest.py`:
43+
- `--config`: Path to YAML config file for sanity check tests
44+
- `--use_dcp`: Override the YAML config `trainer.use_dcp` field (true/false)
4345

44-
# Run all tests with a custom config directory
45-
python ./tests/integration_tests.py ./test_output --config_dir ./my_configs
46+
Example with options:
47+
```bash
48+
pytest -s tests/integration_tests/ --config ./path/to/config.yaml --use_dcp true
4649
```
4750

4851
### Running Unit Tests
4952

50-
To run only the unit tests:
53+
To run all unit tests:
5154

5255
```bash
5356
pytest -s tests/unit_tests/
5457
```
5558

56-
### Running Specific Unit Test Files
57-
58-
To run a specific test file:
59+
To run a specific unit test file:
5960

6061
```bash
61-
pytest -s tests/unit_tests/test_job_config.py
62+
pytest -s tests/unit_tests/test_config.py
6263
```
6364

64-
### Running Specific Test Functions in Unit Tests
65-
66-
To run a specific test function:
65+
To run a specific unit test function:
6766

6867
```bash
69-
pytest -s tests/unit_tests/test_job_config.py::TestJobConfig::test_command_line_args
68+
pytest -s tests/unit_tests/test_config.py::test_cache_hit_scenario
7069
```

0 commit comments

Comments
 (0)