Skip to content

Commit ea084ed

Browse files
committed
Docs: add a document that describes the testing of the compiler.
1 parent 3aac1d9 commit ea084ed

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/Testing.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Testing the Glow compiler
2+
3+
The Glow test suite contains four major categories: unit tests, regression
4+
tests, example programs, and the model loader. Unit tests are the small tests
5+
that stress specific parts of the compiler. These tests are added to the
6+
compiler when developing a feature. For example, we train a number of small
7+
network and perform a gradient check on the operators. We also compile networks
8+
to IR and look for specific patterns. Regression tests are tests that are added
9+
when we fix bugs. Both regression tests and feature tests are found under the
10+
"test/" directory. To run the feature and regression tests run "ninja test".
11+
12+
## Example test suites.
13+
14+
We rely on external test suites to test the compiler. We use the data sets
15+
CIFAR10 and MNIST (located in the "example/" directory) to test the correctness
16+
of the whole system. The script under 'utils/' download and extract the data
17+
set.
18+
19+
## Model Loader
20+
21+
We test the correctness of the Glow implementation by loading Caffe2 models and
22+
executing them end-to-end. The program 'loader' loads model, a png file, and
23+
runs a single pass of inference. If everything goes right the output of the
24+
program is identical to the output of the Caffe2 model. Unfortunately, the caffe
25+
model does not describe what the input format should be. Should the pixels be
26+
between zero and one, or negative 128 to positive 128? The user needs to be
27+
aware of these things when running the models. The script in the directory
28+
'utils/' downloads a number of pre-trained networks that we can use for testing.
29+

0 commit comments

Comments
 (0)