Skip to content

Commit

Permalink
fix MSM bench using 64-bit scalar after #444 (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim authored Aug 19, 2024
1 parent 618d8b3 commit b850dc7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions benchmarks/bench_elliptic_parallel_template.nim
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ proc multiAddParallelBench*(EC: typedesc, numInputs: int, iters: int) =
type BenchMsmContext*[EC] = object
tp: Threadpool
numInputs: int
coefs: seq[BigInt[64]] # seq[getBigInt(EC.getName(), kScalarField)]
coefs: seq[getBigInt(EC.getName(), kScalarField)]
points: seq[affine(EC)]

proc createBenchMsmContext*(EC: typedesc, inputSizes: openArray[int]): BenchMsmContext[EC] =
result.tp = Threadpool.new()
let maxNumInputs = inputSizes.max()

const bits = 64 # EC.getScalarField().bits()
const bits = EC.getScalarField().bits()
type ECaff = affine(EC)

result.numInputs = maxNumInputs
Expand Down Expand Up @@ -104,7 +104,7 @@ proc createBenchMsmContext*(EC: typedesc, inputSizes: openArray[int]): BenchMsmC
stdout.write &"in {float64(inNanoSeconds(stop-start)) / 1e6:6.3f} ms\n"

proc msmParallelBench*[EC](ctx: var BenchMsmContext[EC], numInputs: int, iters: int) =
const bits = 64 # EC.getScalarField().bits()
const bits = EC.getScalarField().bits()
type ECaff = affine(EC)

template coefs: untyped = ctx.coefs.toOpenArray(0, numInputs-1)
Expand Down
Binary file modified media/bench-bls12_381_msm-256_to_16384-R7_7840U.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/bench-bls12_381_msm-2_to_128-R7_7840U.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/bench-bls12_381_msm-65536_to_262144-R7_7840U.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b850dc7

Please sign in to comment.