Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

[2/x]: fix numerics integration test and test delayed vs dynamic #291

Closed
wants to merge 2 commits into from

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Jun 28, 2024

Stack from ghstack (oldest at bottom):

Summary:

  1. the SAM test wasn't easy to use because it had real weights and hence
    required real data for useful testing, which is not convenient from
    an integration test. Switched to LLaMa FFN with random weights, and
    made all the thresholds tight to actually check numerics are close.
  2. extended numerics test to check all combinations of delayed vs
    dynamic
  3. to be able to do (2), extended the module swap utility to configure
    delayed vs dynamic on a model level, for now without an option to
    customize further

Test Plan:

pytest test/test_numerics_integration.py -s -x
./test/test_everything.sh

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D59305796

Summary:

1. the SAM test wasn't easy to use because it had real weights and hence
   required real data for useful testing, which is not convenient from
   an integration test. Switched to LLaMa FFN with random weights, and
   made all the thresholds tight to actually check numerics are close.
2. extended numerics test to check all combinations of delayed vs
   dynamic
3. to be able to do (2), extended the module swap utility to configure
   delayed vs dynamic on a model level, for now without an option to
   customize further

Test Plan:

```
pytest test/test_numerics_integration.py -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Jun 28, 2024
Summary:

1. the SAM test wasn't easy to use because it had real weights and hence
   required real data for useful testing, which is not convenient from
   an integration test. Switched to LLaMa FFN with random weights, and
   made all the thresholds tight to actually check numerics are close.
2. extended numerics test to check all combinations of delayed vs
   dynamic
3. to be able to do (2), extended the module swap utility to configure
   delayed vs dynamic on a model level, for now without an option to
   customize further

Test Plan:

```
pytest test/test_numerics_integration.py -s -x
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 954ce82
Pull Request resolved: #291
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 28, 2024
@@ -5,8 +5,8 @@ set -e
IS_ROCM=$(rocm-smi --version || true)

pytest test/test_base.py
pytest test/test_sam.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it, this test has been annoying

model_fp8_out.sum().backward()

out_sqnr = compute_error(model_ref_out, model_fp8_out)
assert out_sqnr > 20.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe a message

Copy link
Contributor

@drisspg drisspg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great clean up, love it!

…ynamic"


Summary:

1. the SAM test wasn't easy to use because it had real weights and hence
   required real data for useful testing, which is not convenient from
   an integration test. Switched to LLaMa FFN with random weights, and
   made all the thresholds tight to actually check numerics are close.
2. extended numerics test to check all combinations of delayed vs
   dynamic
3. to be able to do (2), extended the module swap utility to configure
   delayed vs dynamic on a model level, for now without an option to
   customize further

Test Plan:

```
pytest test/test_numerics_integration.py -s -x
./test/test_everything.sh
```

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@vkuzo
Copy link
Contributor Author

vkuzo commented Jul 2, 2024

@vkuzo has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 1e71def.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants