Skip to content

Commit 2fa5e9b

Browse files
manuelcandalesfacebook-github-bot
authored andcommitted
Update readme
Summary: Updates FACTO readme Reviewed By: cbilgin Differential Revision: D59165423 fbshipit-source-id: 3ff2ce4c3b780fd5d243288cc110db533484cc80
1 parent 1e36504 commit 2fa5e9b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,42 @@
22

33
Framework for Algorithmic Correctness Testing of Operators
44

5+
## InputGen
6+
7+
InputGen is a Python library to generate inputs for torch operators, given certain specifications. These specifications can be provided by the user, or can be retrieved from a library of specifications such as SpecDB. They provide a complete description of the space of valid inputs to the operator.
8+
9+
Here is an [overview](inputgen/overview.md) of InputGen
10+
11+
## SpecDB
12+
13+
SpecDB is a [database](specdb/db.py#L30) of specifications covering most of the Core ATen Ops. They have been developed using the ATen CPU kernels as a reference.
14+
15+
## Example Usage
16+
17+
The code below is a minimal example to test add.Tensor using FACTO.
18+
```python
19+
import torch
20+
from inputgen.argtuple.gen import ArgumentTupleGenerator
21+
from specdb.db import SpecDictDB
22+
23+
# Retrieve the specification from SpecDB
24+
spec = SpecDictDB["add.Tensor"]
25+
26+
# Initialize generator
27+
generator = ArgumentTupleGenerator(spec)
28+
29+
op = torch.ops.aten.add.Tensor
30+
31+
# Generate input tuples
32+
for posargs, inkwargs, outargs in generator.gen():
33+
# Evaluate op with given inputs
34+
op(*posargs, **inkwargs, **outargs)
35+
```
36+
37+
## Calibrator
38+
39+
Calibrator is under development. It is intended to be a tool for calibrating the specifications against the behavior of the reference op implementation.
40+
541
## Reporting problems
642

743
If you encounter a bug or some other problem with FACTO, please file an issue on

0 commit comments

Comments
 (0)