-
Notifications
You must be signed in to change notification settings - Fork 483
[Benchmark] Pull 'force' out of 'bench' #7177
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
base: master
Are you sure you want to change the base?
Conversation
|
/benchmark nofib |
1 similar comment
/benchmark nofib |
/benchmark validation |
1 similar comment
/benchmark validation |
Click here to check the status of your benchmark. |
28fe3e9
to
3ce4366
Compare
Click here to check the status of your benchmark. |
benchTermAgdaCek :: String -> Term -> Benchmark | ||
benchTermAgdaCek name term = | ||
let !term' = force term | ||
in bench name $ whnf unsafeRunAgdaCek term' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added force
and changed nf
to whnf
for consistency.
benchTermCek :: LedgerApi.EvaluationContext -> Term -> Benchmarkable | ||
benchTermCek evalCtx term = | ||
benchTermCek :: String -> LedgerApi.EvaluationContext -> Term -> Benchmark | ||
benchTermCek name evalCtx term = | ||
let !term' = force term | ||
in whnf (evaluateCekForBench evalCtx) term' | ||
in bench name $ whnf (evaluateCekForBench evalCtx) term' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gist of the PR.
benchProgramAgdaCek :: String -> Program -> Benchmark | ||
benchProgramAgdaCek name (UPLC.Program _ _ term) = | ||
let !term' = force term | ||
in bench name $ whnf unsafeRunAgdaCek term' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should just call benchTermAgdaCek
instead. Will fix.
benchClausify :: Clausify.StaticFormula -> Benchmarkable | ||
benchClausify f = nf Clausify.runClausify f | ||
benchClausify :: String -> Clausify.StaticFormula -> Benchmark | ||
benchClausify name f = bench name $ whnf Clausify.runClausify f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed nf
to whnf
for consistency. Note that this is just the Haskell version of the benchmarks, the CEK one is unaffected by this change.
Comparing benchmark results of 'nofib' on 'ee15d369f' (base) and '3ce43665b' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'validation' on 'ee15d369f' (base) and '3ce43665b' (PR) Results table
|
Click here to check the status of your benchmark. |
3ce4366
to
76a84bf
Compare
Comparing benchmark results of 'validation' on 'ee15d369f' (base) and '3ce43665b' (PR) Results table
|
That somehow broke the
and I keep seeing it even if I change benchTermCek :: String -> LedgerApi.EvaluationContext -> Term -> Benchmark
benchTermCek name evalCtx term =
let !term' = force term
in bench name $ whnf (evaluateCekForBench evalCtx) term' to benchTermCek :: String -> LedgerApi.EvaluationContext -> Term -> Benchmark
benchTermCek name evalCtx term =
bench name $ let !term' = force term in whnf (evaluateCekForBench evalCtx) term' which really should restore the old behavior? For the love of God, what can possibly be wrong here? |
/benchmark bitwise-bench |
1 similar comment
/benchmark bitwise-bench |
Click here to check the status of your benchmark. |
/benchmark nofib |
2 similar comments
/benchmark nofib |
/benchmark nofib |
/benchmark nofib |
Click here to check the status of your benchmark. |
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'ee15d369f' (base) and '76a84bfc5' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'ee15d369f' (base) and '76a84bfc5' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'ee15d369f' (base) and '76a84bfc5' (PR) Results table
|
Click here to check the status of your benchmark. |
Comparing benchmark results of 'nofib' on 'ee15d369f' (base) and '76a84bfc5' (PR) Results table
|
/benchmark bitwise-bench |
3 similar comments
/benchmark bitwise-bench |
/benchmark bitwise-bench |
/benchmark bitwise-bench |
Click here to check the status of your benchmark. |
Click here to check the status of your benchmark. |
Click here to check the status of your benchmark. |
Click here to check the status of your benchmark. |
I was investigating an issue with #7012 not being faster than the baseline despite clearly doing strictly less work and came to the conclusion that the only reasonable explanation is that forcing of inputs has to happen before
bench
. I.e. if we do it after like is currently the case, then it's included in the benchmarking results, even if we do it beforewhnf
.