Skip to content

Commit

Permalink
verification docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vkovinicTT committed Dec 24, 2024
1 parent 8b809c2 commit eac11ce
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions docs/src/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,47 @@ def test_add():

## Verify Config Overview

Currently through `VerifyConfig` you can disable/enable:
If `VerifyConfig` isn't passed as a param, default one will be used. Currently through `VerifyConfig` you can disable/enable:
| Feature | Enabled (default) |
|-----------------------------------|:-----------------:|
| Verification as a method | `True` |
| Output size check | `True` |
| Output type check | `True` |
| Output shape check | `True` |

For more information about `VerifyConfig` you can check `forge/forge/verify/config.py`
For more information about `VerifyConfig` you can check `forge/forge/verify/config.py`.

**Example of usage**
```python
def test_add():

class Add(nn.Module):
def __init__(self):
super().__init__()

def forward(self, a, b):
return a + b


inputs = [torch.rand(2, 32, 32), torch.rand(2, 32, 32)]

framework_model = Add()
compiled_model = forge.compile(framework_model, sample_inputs=inputs)

fw_out = framework_model(*inputs)
co_out = compiled_model(*inputs)

verify(inputs, framework_model, compiled_model, VerifyConfig(verify_dtype=False))
```
</br>

Besides that, config also includes value checker. There are 3 types of checker:
- `AutomaticValueChecker` **(default)**
- `AllCloseValueChecker`
- `FullValueChecker`

For more information about **Checkers** you can look at `forge/forge/verify/value_checkers.py`.

<br/>
<br/>

Expand Down

0 comments on commit eac11ce

Please sign in to comment.