Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
Summary: Updates FACTO readme

Reviewed By: cbilgin

Differential Revision: D59165423

fbshipit-source-id: 3ff2ce4c3b780fd5d243288cc110db533484cc80
  • Loading branch information
manuelcandales authored and facebook-github-bot committed Jun 28, 2024
1 parent 1e36504 commit 2fa5e9b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,42 @@

Framework for Algorithmic Correctness Testing of Operators

## InputGen

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.

Here is an [overview](inputgen/overview.md) of InputGen

## SpecDB

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.

## Example Usage

The code below is a minimal example to test add.Tensor using FACTO.
```python
import torch
from inputgen.argtuple.gen import ArgumentTupleGenerator
from specdb.db import SpecDictDB

# Retrieve the specification from SpecDB
spec = SpecDictDB["add.Tensor"]

# Initialize generator
generator = ArgumentTupleGenerator(spec)

op = torch.ops.aten.add.Tensor

# Generate input tuples
for posargs, inkwargs, outargs in generator.gen():
# Evaluate op with given inputs
op(*posargs, **inkwargs, **outargs)
```

## Calibrator

Calibrator is under development. It is intended to be a tool for calibrating the specifications against the behavior of the reference op implementation.

## Reporting problems

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

0 comments on commit 2fa5e9b

Please sign in to comment.