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

Add comparison to "SRFast" #36

Merged
merged 24 commits into from
Sep 19, 2024
Merged

Add comparison to "SRFast" #36

merged 24 commits into from
Sep 19, 2024

Conversation

awf
Copy link
Collaborator

@awf awf commented Jun 27, 2024

Illustrate how bias-corrected stochastic rounding differs from some common implementations.

New implementations:

StochasticFastest renames the old Stochastic, implements a stochastic rounding scheme
that is biased (the rounded value is on average farther from zero than the true value).

StochasticFast implements a stochastic rounding scheme that is unbiased in
infinite precision, but biased when the quantity to be rounded is computed to
a finite precision.

Stochastic implements a stochastic rounding scheme that is unbiased with finite precision
inputs and finite SRBits.

With a lot of SRbits (say 8 or more), these biases are negligible, and there
may be some efficiency advantage in using StochasticFast or StochasticFastest.

image

image

Also produces this visualisation which illustrates how the rounding threshold is computed as a function of the input value and random bits in each case:
image

@awf awf merged commit 0257255 into main Sep 19, 2024
1 check passed
@awf awf deleted the sr-bias-example branch September 19, 2024 17:19
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.

1 participant