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

Improve Fused8BitRowwiseQuantizedSBFloatToFloatOrHalfNeon by 5%-15% #3860

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nicoshev
Copy link
Contributor

Summary:
We are using SVE's pred to avoid the trailing loop, this technique shows an improved throughput of 5% to 15%.

Benchmarks carry a lot of variance, thus produced assembly was checked: https://godbolt.org/z/K6scf6P8s

Results are for the float32 case, used in AdRetriever

before:

rows, cols, elems_per_usec, GB/Sec
100, 16, 3536.86, 14.15
100, 64, 3363.99, 13.46
100, 128, 4674.71, 18.70
100, 256, 4708.46, 18.83
100, 512, 6247.59, 24.99
100, 1024, 6747.96, 26.99
100, 2048, 8719.72, 34.88
120, 16, 5210.26, 20.84
120, 64, 3850.57, 15.40
120, 128, 3688.19, 14.75
120, 256, 4566.65, 18.27
120, 512, 8684.83, 34.74
120, 1024, 8800.45, 35.20
120, 2048, 9396.97, 37.59
1000, 16, 5324.87, 21.30
1000, 64, 8846.61, 35.39
1000, 128, 8939.13, 35.76
1000, 256, 9537.45, 38.15
1000, 512, 9667.61, 38.67
1000, 1024, 7702.69, 30.81
1000, 2048, 8187.50, 32.75

after:

rows, cols, elems_per_usec, GB/Sec
100, 16, 4040.40, 16.16
100, 64, 3600.29, 14.40
100, 128, 4740.05, 18.96
100, 256, 4605.53, 18.42
100, 512, 7603.47, 30.41
100, 1024, 8693.21, 34.77
100, 2048, 9166.19, 36.66
120, 16, 3143.01, 12.57
120, 64, 3919.11, 15.68
120, 128, 4766.29, 19.07
120, 256, 5489.12, 21.96
120, 512, 8569.90, 34.28
120, 1024, 8916.10, 35.66
120, 2048, 9849.85, 39.40
1000, 16, 4903.63, 19.61
1000, 64, 9281.85, 37.13
1000, 128, 10090.42, 40.36
1000, 256, 10314.59, 41.26
1000, 512, 10142.08, 40.57
1000, 1024, 7991.56, 31.97
1000, 2048, 8030.02, 32.12

Differential Revision: D71602944

Summary:
We are using SVE's pred to avoid the trailing loop, this technique shows an improved throughput of 5% to 15%.

Benchmarks carry a lot of variance, thus produced assembly was checked: https://godbolt.org/z/K6scf6P8s

Results are for the float32 case, used in AdRetriever

before:

  rows,  cols,  elems_per_usec,    GB/Sec
   100,     16,         3536.86,      14.15
   100,     64,         3363.99,      13.46
   100,    128,         4674.71,      18.70
   100,    256,         4708.46,      18.83
   100,    512,         6247.59,      24.99
   100,   1024,         6747.96,      26.99
   100,   2048,         8719.72,      34.88
   120,     16,         5210.26,      20.84
   120,     64,         3850.57,      15.40
   120,    128,         3688.19,      14.75
   120,    256,         4566.65,      18.27
   120,    512,         8684.83,      34.74
   120,   1024,         8800.45,      35.20
   120,   2048,         9396.97,      37.59
  1000,     16,         5324.87,      21.30
  1000,     64,         8846.61,      35.39
  1000,    128,         8939.13,      35.76
  1000,    256,         9537.45,      38.15
  1000,    512,         9667.61,      38.67
  1000,   1024,         7702.69,      30.81
  1000,   2048,         8187.50,      32.75

after:

  rows,  cols,  elems_per_usec,    GB/Sec
   100,     16,         4040.40,      16.16
   100,     64,         3600.29,      14.40
   100,    128,         4740.05,      18.96
   100,    256,         4605.53,      18.42
   100,    512,         7603.47,      30.41
   100,   1024,         8693.21,      34.77
   100,   2048,         9166.19,      36.66
   120,     16,         3143.01,      12.57
   120,     64,         3919.11,      15.68
   120,    128,         4766.29,      19.07
   120,    256,         5489.12,      21.96
   120,    512,         8569.90,      34.28
   120,   1024,         8916.10,      35.66
   120,   2048,         9849.85,      39.40
  1000,     16,         4903.63,      19.61
  1000,     64,         9281.85,      37.13
  1000,    128,        10090.42,      40.36
  1000,    256,        10314.59,      41.26
  1000,    512,        10142.08,      40.57
  1000,   1024,         7991.56,      31.97
  1000,   2048,         8030.02,      32.12

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

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

Copy link

netlify bot commented Mar 21, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 254396f
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/67dd8095da9fbb0008265605
😎 Deploy Preview https://deploy-preview-3860--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.

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.

2 participants