Skip to content

Commit

Permalink
cleaner msm benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
svpolonsky committed Dec 12, 2023
1 parent 4b47cf0 commit 02925c1
Show file tree
Hide file tree
Showing 2 changed files with 260 additions and 3 deletions.
8 changes: 5 additions & 3 deletions benchmarks/msm/benchmark.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define CURVE_BLS12_381 2
#define CURVE_BLS12_377 3

#define CURVE CURVE_BLS12_377
#define CURVE CURVE_BN254

#include <stdio.h>
#include <iostream>
Expand Down Expand Up @@ -54,9 +54,11 @@ cudaStream_t stream;

static void BM_msm(benchmark::State& state) {
const uint32_t msm_size=state.range(0);
bool on_device = true;
bool big_triangle = false;
for (auto _ : state) {
large_msm<scalar_t, projective_t, affine_t>(scalars_d, points_d, msm_size, result_d, true, false, bucket_factor, stream);
cudaDeviceSynchronize();
large_msm<scalar_t, projective_t, affine_t>(scalars_d, points_d, msm_size, result_d, on_device, big_triangle, bucket_factor, stream);
// cudaDeviceSynchronize();
}
unsigned int power;
nvmlDeviceGetPowerUsage(device, &power);
Expand Down
255 changes: 255 additions & 0 deletions benchmarks/msm/benchmark.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
{
"context": {
"date": "2023-12-12T18:47:36+00:00",
"host_name": "0f4f6719d34b",
"executable": "/icicle-benchmark/build/benchmark",
"num_cpus": 12,
"mhz_per_cpu": 4208,
"cpu_scaling_enabled": true,
"caches": [
{
"type": "Data",
"level": 1,
"size": 32768,
"num_sharing": 2
},
{
"type": "Instruction",
"level": 1,
"size": 32768,
"num_sharing": 2
},
{
"type": "Unified",
"level": 2,
"size": 524288,
"num_sharing": 2
},
{
"type": "Unified",
"level": 3,
"size": 16777216,
"num_sharing": 6
}
],
"load_avg": [0.892578,1.04199,1.06738],
"library_build_type": "release",
"coefficient_C": "12",
"comment": "on-device API",
"frequency_MHz": "1695",
"project": "Icicle",
"runs_on": "NVIDIA GeForce RTX 3090",
"team": "Ingonyama",
"uses": "BN254"
},
"benchmarks": [
{
"name": "BM_msm/1024/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 0,
"run_name": "BM_msm/1024/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3934,
"real_time": 1.0719420736669561e-02,
"cpu_time": 1.0706253246314182e-02,
"time_unit": "s",
"PowerUsage": 1.7900000000000000e+02,
"Temperature": 5.8000000000000000e+01
},
{
"name": "BM_msm/2048/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 1,
"run_name": "BM_msm/2048/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3905,
"real_time": 1.0774707772873971e-02,
"cpu_time": 1.0763022053777207e-02,
"time_unit": "s",
"PowerUsage": 1.8200000000000000e+02,
"Temperature": 6.1000000000000000e+01
},
{
"name": "BM_msm/4096/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 2,
"run_name": "BM_msm/4096/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3901,
"real_time": 1.0820364909526127e-02,
"cpu_time": 1.0802259874647524e-02,
"time_unit": "s",
"PowerUsage": 1.8400000000000000e+02,
"Temperature": 6.2000000000000000e+01
},
{
"name": "BM_msm/8192/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 3,
"run_name": "BM_msm/8192/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3592,
"real_time": 1.1705802419521837e-02,
"cpu_time": 1.1692981692928735e-02,
"time_unit": "s",
"PowerUsage": 1.8600000000000000e+02,
"Temperature": 6.3000000000000000e+01
},
{
"name": "BM_msm/16384/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 4,
"run_name": "BM_msm/16384/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3586,
"real_time": 1.1728714219186968e-02,
"cpu_time": 1.1715881023703301e-02,
"time_unit": "s",
"PowerUsage": 1.8900000000000000e+02,
"Temperature": 6.4000000000000000e+01
},
{
"name": "BM_msm/32768/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 5,
"run_name": "BM_msm/32768/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3571,
"real_time": 1.1769651148988034e-02,
"cpu_time": 1.1759971484738174e-02,
"time_unit": "s",
"PowerUsage": 1.9500000000000000e+02,
"Temperature": 6.4000000000000000e+01
},
{
"name": "BM_msm/65536/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 6,
"run_name": "BM_msm/65536/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3235,
"real_time": 1.2998765338193538e-02,
"cpu_time": 1.2985645372488402e-02,
"time_unit": "s",
"PowerUsage": 2.0000000000000000e+02,
"Temperature": 6.5000000000000000e+01
},
{
"name": "BM_msm/131072/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 7,
"run_name": "BM_msm/131072/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 3079,
"real_time": 1.3650311346873023e-02,
"cpu_time": 1.3640242942838589e-02,
"time_unit": "s",
"PowerUsage": 2.1200000000000000e+02,
"Temperature": 6.5000000000000000e+01
},
{
"name": "BM_msm/262144/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 8,
"run_name": "BM_msm/262144/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 2777,
"real_time": 1.5142664100817509e-02,
"cpu_time": 1.5132199924738948e-02,
"time_unit": "s",
"PowerUsage": 2.3100000000000000e+02,
"Temperature": 6.7000000000000000e+01
},
{
"name": "BM_msm/524288/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 9,
"run_name": "BM_msm/524288/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 2270,
"real_time": 1.8516216871363525e-02,
"cpu_time": 1.8493770291189423e-02,
"time_unit": "s",
"PowerUsage": 2.5500000000000000e+02,
"Temperature": 6.9000000000000000e+01
},
{
"name": "BM_msm/1048576/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 10,
"run_name": "BM_msm/1048576/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 1662,
"real_time": 2.5298198188919010e-02,
"cpu_time": 2.5272283267749707e-02,
"time_unit": "s",
"PowerUsage": 2.8900000000000000e+02,
"Temperature": 7.1000000000000000e+01
},
{
"name": "BM_msm/2097152/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 11,
"run_name": "BM_msm/2097152/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 1073,
"real_time": 3.9168599447368266e-02,
"cpu_time": 3.9118837269338277e-02,
"time_unit": "s",
"PowerUsage": 2.8900000000000000e+02,
"Temperature": 6.9000000000000000e+01
},
{
"name": "BM_msm/4194304/min_time:30.000",
"family_index": 0,
"per_family_instance_index": 12,
"run_name": "BM_msm/4194304/min_time:30.000",
"run_type": "iteration",
"repetitions": 1,
"repetition_index": 0,
"threads": 1,
"iterations": 628,
"real_time": 6.7063869372719104e-02,
"cpu_time": 6.7002969555732456e-02,
"time_unit": "s",
"PowerUsage": 2.9500000000000000e+02,
"Temperature": 6.6000000000000000e+01
}
]
}

0 comments on commit 02925c1

Please sign in to comment.