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

Use faster operations on packed-quantized, add tests #211

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

horheynm
Copy link
Member

@horheynm horheynm commented Nov 24, 2024

Offset, mask operation relied on pow which takes time compared to bitwise operations.
Also added tests for packed-quantized, and pseudocode on how it works

Before:

pow(2, num_bits) // 2
#  2.5428 s, with N = 10_000_000 iterations

After:

1 << (num_bits - 1)
#  0.5902 s, with N = 10_000_000 iterations

mgoin
mgoin previously approved these changes Nov 25, 2024
Copy link
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

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

This makes sense to me, thanks for the comments and tests

rahul-tuli
rahul-tuli previously approved these changes Nov 25, 2024
kylesayrs
kylesayrs previously approved these changes Nov 27, 2024
Copy link
Contributor

@kylesayrs kylesayrs left a comment

Choose a reason for hiding this comment

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

Big yay, awesome tests

@horheynm horheynm dismissed stale reviews from kylesayrs and rahul-tuli via e5ea1c4 December 2, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants