Skip to content

Commit a5a1530

Browse files
dulinrileymeta-codesync[bot]
authored andcommitted
Update README.md with rust testing instructions (#1434)
Summary: Pull Request resolved: #1434 Now that `cargo-nextest` is used in our CI, update the readme to point users to this with installation instructions. Using normal `cargo test` will most likely surface things that are not real issues. Reviewed By: mariusae Differential Revision: D83876813 fbshipit-source-id: f280d79c3401445d328a62467fb90876f6bad8c9
1 parent 6b6136c commit a5a1530

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

README.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,19 @@ View Monarch's hosted documentation [at this link](https://meta-pytorch.org/mona
5050
## Installation
5151
Note for running distributed tensors, the local torch version must match the version that monarch was built with.
5252

53-
### On Fedora distributions
54-
## Stable
53+
### Stable
5554
`pip install torchmonarch`
5655

5756
torchmonarch stable is built with the latest stable torch.
5857

59-
## Nightly
58+
### Nightly
6059
`pip install torchmonarch-nightly`
6160

6261
torchmonarch-nightly is built with torch nightly.
6362

64-
or manually
63+
### Build and Install from Source
64+
65+
#### On Fedora distributions
6566

6667
```sh
6768

@@ -99,11 +100,11 @@ pip install --no-build-isolation .
99100
# or setup for development
100101
pip install --no-build-isolation -e .
101102

102-
# Run unit tests. consider -s for more verbose output
103-
pytest python/tests/ -v -m "not oss_skip"
103+
# Verify installation
104+
pip list | grep monarch
104105
```
105106

106-
### On Ubuntu distributions
107+
#### On Ubuntu distributions
107108

108109
```sh
109110
# Clone the repository and navigate to it
@@ -144,7 +145,7 @@ pip install --no-build-isolation -e .
144145
pip list | grep monarch
145146
```
146147

147-
### On MacOS
148+
#### On MacOS
148149

149150
You can also build Monarch to run locally on a MacOS system.
150151

@@ -172,6 +173,8 @@ USE_TENSOR_ENGINE=0 pip install --no-build-isolation .
172173
# or setup for development
173174
USE_TENSOR_ENGINE=0 pip install --no-build-isolation -e .
174175

176+
# Verify installation
177+
pip list | grep monarch
175178
```
176179

177180

@@ -181,6 +184,30 @@ Check out the `examples/` directory for demonstrations of how to use Monarch's A
181184

182185
We'll be adding more examples as we stabilize and polish functionality!
183186

187+
## Running tests
188+
189+
We have both Rust and Python unit tests. Rust tests are run with `cargo-nextest`
190+
and Python tests are run with `pytest`.
191+
192+
Rust tests:
193+
```sh
194+
# We use cargo-nextest to run our tests, as they can provide strong process isolation
195+
# between every test.
196+
# Here we install it from source, but you can instead use a pre-built binary described
197+
# here: https://nexte.st/docs/installation/pre-built-binaries/
198+
cargo install cargo-nextest --locked
199+
cargo nextest run
200+
```
201+
cargo-nextest supports all of the filtering flags of "cargo test".
202+
203+
Python tests:
204+
```sh
205+
# Make sure to install test dependencies first
206+
pip install -r python/tests/requirements.txt
207+
# Run unit tests. consider -s for more verbose output
208+
pytest python/tests/ -v -m "not oss_skip"
209+
```
210+
184211
## License
185212

186213
Monarch is BSD-3 licensed, as found in the [LICENSE](LICENSE) file.

0 commit comments

Comments
 (0)