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

No max operation in formulas #797

Merged
merged 15 commits into from May 14, 2024
Merged

No max operation in formulas #797

merged 15 commits into from May 14, 2024

Conversation

AYadrov
Copy link
Contributor

@AYadrov AYadrov commented Apr 30, 2024

This branch introduces a change to the tuning formulas. max operation was removed and now exponents can be negative as well.
Nevertheless, the final precision can not be less than *base-tuning-bits*, which is set to 73.
This feature saves some precision during sampling and localize when number of iteration > 0.

(define x (first srcs))
(define y (second srcs))

(define x-exp (ival-max-log2-approx x))
(define y-exp (ival-max-log2-approx y))
(define out-exp (ival-min-log2-approx output))

(make-list 2 (max 0 (- (+ x-exp y-exp) (* 2 (max x-exp y-exp)) out-exp)))]
(make-list 2 (+ (- (+ x-exp y-exp) (* 2 (min x-exp y-exp)) out-exp) 1))]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

@AYadrov AYadrov Apr 30, 2024

Choose a reason for hiding this comment

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

This one was tricky. Turned out that I was over-approximating sum of logs, when it actually had to be under-approximated since we subtract this value. The overall exponent will be over-approximated with this change. Previously it was not enough

@AYadrov AYadrov requested a review from pavpanchekha May 14, 2024 18:51
@pavpanchekha
Copy link
Contributor

I've already reviewed this, if the nightly is good just merge it.

@pavpanchekha
Copy link
Contributor

And nightly looks great, just merge it.

@AYadrov AYadrov merged commit 6ecc666 into main May 14, 2024
12 checks passed
@AYadrov AYadrov deleted the artem-no-max-formulas branch May 14, 2024 18:59
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.

None yet

2 participants