Skip to content
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

sparse benchmarking numbers #303

Merged
merged 9 commits into from
Jun 3, 2024
Merged

sparse benchmarking numbers #303

merged 9 commits into from
Jun 3, 2024

Conversation

jcaip
Copy link
Contributor

@jcaip jcaip commented Jun 3, 2024

  • Updated benchmark script for standalone sparse numbers.
  • Switched from segment-anything to segment-anything-fast
  • Updated README with results for segment-anything and BERT

Copy link

pytorch-bot bot commented Jun 3, 2024

🔗 Helpful Links

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

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

✅ No Failures

As of commit 1fbea59 with merge base 8a4e693 (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 Jun 3, 2024
import pandas as pd
from segment_anything_fast import sam_model_registry
Copy link
Member

Choose a reason for hiding this comment

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

I missed that sam fast isn't included in our benchmarks - suggestion is maybe to put a sam folder under benchmarjs with a README on custom dependencies and how to install them or just add a comment above this line as to how people can install sam fast


#### BERT

We were able to accelerate BERT 1.23x with a negligible accuracy drop on SQuAD.
Copy link
Member

Choose a reason for hiding this comment

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

which hardware?


#### segment-anything
We applied 2:4 sparsity to accelerate segment-anything, as part of [segment-anything-fast](https://github.com/pytorch-labs/segment-anything-fast).
The results mentioned in the REAADME of the repo compose sparsity with a suite of other inference acceleration techniques.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The results mentioned in the REAADME of the repo compose sparsity with a suite of other inference acceleration techniques.
The results mentioned in the README of the repo compose sparsity with a suite of other inference acceleration techniques.

From our benchmarking, we see a 1.1x speedup when running with SEGMENT_ANYTHING_FAST_USE_FLASH_4 enabled.

```
python benchmarks/benchmark_sam.py
Copy link
Member

Choose a reason for hiding this comment

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

Put a direct link to the benchmarks script

```
python benchmarks/benchmark_sam.py

block_only batchsize dtype compile qkv proj lin1 lin2 time memory img/s
Copy link
Member

Choose a reason for hiding this comment

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

Can you format this as a table it's a bit hard to read because I have to scroll all the way to the right? Also what does lin1 and lin2 mean? Presumably memory is in GB?

Also I feel like a quick sentence before this table along the lines of we have support for SparseSemiStructuredTensor we can apply it to each of the qkv of attention or just the proj and here's how to apply it would be helpful

@jcaip jcaip merged commit e5d27a3 into main Jun 3, 2024
13 checks passed
dbyoung18 pushed a commit to dbyoung18/ao that referenced this pull request Jul 31, 2024
- Updated benchmark script for standalone sparse numbers.
- Switched from segment-anything to segment-anything-fast
- Updated README with results for segment-anything and BERT
yanbing-j pushed a commit to yanbing-j/ao that referenced this pull request Dec 9, 2024
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.

3 participants