Skip to content

QOL improvements to float8 gemm benchmark #596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Aug 5, 2024

Summary:

  1. add more options for shape generation, such as
  • square: M == K == N sweeping through powers of 2
  • sweep: M, K, N each sweeping through powers of 2
  • custom: user specifies a single value of M, K, N
  1. fix a bug when calling torch._scaled_mm, we should create the scales outside the benchmark for a less biased result
  2. add sweep over fast_accum setting
  3. add ability to save result to file, for easy analysis later

Test Plan:

time python benchmarks/float8/bench_matmul.py --out_filename ~/local/tmp/20240803_f8_gemm_sweep_2.csv --shape_gen_name sweep
// result: https://gist.github.com/vkuzo/1d82e84ddd8aac8166695d819ebc8883

Reviewers:

Subscribers:

Tasks:

Tags:

Summary:

1. add more options for shape generation, such as
  - square: M == K == N sweeping through powers of 2
  - sweep: M, K, N each sweeping through powers of 2
  - custom: user specifies a single value of M, K, N
2. fix a bug when calling `torch._scaled_mm`, we should create the
   scales outside the benchmark for a less biased result
3. add sweep over `fast_accum` setting
4. add ability to save result to file, for easy analysis later

Test Plan:

```
time python benchmarks/float8/bench_matmul.py --out_filename ~/local/tmp/20240803_f8_gemm_sweep_2.csv --shape_gen_name sweep
// result: https://gist.github.com/vkuzo/1d82e84ddd8aac8166695d819ebc8883
```

Reviewers:

Subscribers:

Tasks:

Tags:
Copy link

pytorch-bot bot commented Aug 5, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/596

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 5586749 with merge base ed83ae2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@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 Aug 5, 2024
@vkuzo vkuzo requested review from drisspg and y-sq August 5, 2024 15:55
@vkuzo vkuzo merged commit de4a1fb into main Aug 5, 2024
13 checks passed
jainapurva pushed a commit that referenced this pull request Aug 7, 2024
Summary:

1. add more options for shape generation, such as
  - square: M == K == N sweeping through powers of 2
  - sweep: M, K, N each sweeping through powers of 2
  - custom: user specifies a single value of M, K, N
2. fix a bug when calling `torch._scaled_mm`, we should create the
   scales outside the benchmark for a less biased result
3. add sweep over `fast_accum` setting
4. add ability to save result to file, for easy analysis later

Test Plan:

```
time python benchmarks/float8/bench_matmul.py --out_filename ~/local/tmp/20240803_f8_gemm_sweep_2.csv --shape_gen_name sweep
// result: https://gist.github.com/vkuzo/1d82e84ddd8aac8166695d819ebc8883
```

Reviewers:

Subscribers:

Tasks:

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

Successfully merging this pull request may close these issues.

4 participants