From 2fa5e9b04d9a444119bb83d992d7fce343a5db64 Mon Sep 17 00:00:00 2001 From: Manuel Candales Date: Fri, 28 Jun 2024 11:04:15 -0700 Subject: [PATCH] Update readme Summary: Updates FACTO readme Reviewed By: cbilgin Differential Revision: D59165423 fbshipit-source-id: 3ff2ce4c3b780fd5d243288cc110db533484cc80 --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index f544da7..285521c 100644 --- a/README.md +++ b/README.md @@ -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