Skip to content

Improve VBE benchmark #3867

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

Closed

Conversation

shintaro-iwasaki
Copy link
Contributor

Summary:
This Diff improves the VBE benchmark in FBGEMM-GPU as follows:

  1. Make argument names consistent with other benchmarks
  2. Add more arguments supported by other benchmarks
  3. Nice usage/help with --help
  4. Use a standard request creation mechanism
  5. Support measurement on CPU.

1. Argument names

I carelessly used "a plural form" for a comma-separated list of values, like --batch-sizes and --embedding-dims, but other benchmarks use "list" suffix, like --batch-size-list and --embedding-dim-list. Since VBE is a newer benchmark, let's rename the arguments to make them consistent.

2. More arguments

The current VBE benchmark does not support arguments other TBE benchmarks support. Let's add more arguments to make the benchmark configurable. This includes --alpha-list, --warmup-runs, --stoc, --pooling, --bounds-check-mode, and so on.

3. Nice usage/help with --help.

./benchmark.py vbe --help will show explanations per arguments, which looks nice.

4. Standard request creation mechanism

Previously I created indices/offsets by myself, but seemingly generate_requests() works for VBE too. Let's use this.

5. Measurement on CPU

Because the benchmark code uses torch.cuda, we couldn't run a benchmark on CPU. We changed the benchmarking logic to support CPU (using time.time()).

Differential Revision: D71596622

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71596622

Copy link

netlify bot commented Mar 21, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit a285a21
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/67e302a6be9a350008d301f0
😎 Deploy Preview https://deploy-preview-3867--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Summary:

X-link: facebookresearch/FBGEMM#955



This Diff improves the VBE benchmark in FBGEMM-GPU as follows:

1. Make argument names consistent with other benchmarks
2. Add more arguments supported by other benchmarks
3. Nice usage/help with `--help`
4. Use a standard request creation mechanism
5. Support measurement on CPU.

## 1. Argument names
I carelessly used "a plural form" for a comma-separated list of values, like `--batch-sizes` and `--embedding-dims`, but other benchmarks use "list" suffix, like ` --batch-size-list` and `--embedding-dim-list`. Since VBE is a newer benchmark, let's rename the arguments to make them consistent.

## 2. More arguments
The current VBE benchmark does not support arguments other TBE benchmarks support. Let's add more arguments to make the benchmark configurable.

## 3. Nice usage/help with `--help`.
Using new config loaders make the usage/help look much nicer (thanks Benson!)
```
TBEBenchmarkingConfigLoader.options
EmbeddingOpsCommonConfigLoader.options
```

## 4. Standard request creation mechanism
Previously I created indices/offsets by myself, but seemingly `generate_requests()` works for VBE too. Let's use this.

## 5. Measurement on CPU
Because the benchmark code uses `torch.cuda`, we couldn't run a benchmark on CPU. We changed the benchmarking logic to support CPU (using `time.time()`).

Reviewed By: sryap

Differential Revision: D71596622
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71596622

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in b2312f7.

q10 pushed a commit to q10/FBGEMM that referenced this pull request Apr 10, 2025
Summary:
X-link: pytorch#3867

Pull Request resolved: facebookresearch/FBGEMM#955

This Diff improves the VBE benchmark in FBGEMM-GPU as follows:

1. Make argument names consistent with other benchmarks
2. Add more arguments supported by other benchmarks
3. Nice usage/help with `--help`
4. Use a standard request creation mechanism
5. Support measurement on CPU.

## 1. Argument names
I carelessly used "a plural form" for a comma-separated list of values, like `--batch-sizes` and `--embedding-dims`, but other benchmarks use "list" suffix, like ` --batch-size-list` and `--embedding-dim-list`. Since VBE is a newer benchmark, let's rename the arguments to make them consistent.

## 2. More arguments
The current VBE benchmark does not support arguments other TBE benchmarks support. Let's add more arguments to make the benchmark configurable.

## 3. Nice usage/help with `--help`.
Using new config loaders make the usage/help look much nicer (thanks Benson!)
```
TBEBenchmarkingConfigLoader.options
EmbeddingOpsCommonConfigLoader.options
```

## 4. Standard request creation mechanism
Previously I created indices/offsets by myself, but seemingly `generate_requests()` works for VBE too. Let's use this.

## 5. Measurement on CPU
Because the benchmark code uses `torch.cuda`, we couldn't run a benchmark on CPU. We changed the benchmarking logic to support CPU (using `time.time()`).

Reviewed By: sryap

Differential Revision: D71596622

fbshipit-source-id: 38941010c43335d09dd44dc61626321e83c79285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants