mirror of
https://github.com/pseXperiments/icicle.git
synced 2026-01-09 15:37:58 -05:00
comply with reviewer's comments
This commit is contained in:
@@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Clone Icicle from a GitHub repository
|
||||
RUN git clone https://github.com/ingonyama-zk/icicle.git /icicle
|
||||
RUN git clone https://github.com/ingonyama-zk/icicle.git /opt/icicle
|
||||
|
||||
# Set the working directory in the container
|
||||
WORKDIR /icicle-example
|
||||
|
||||
@@ -14,7 +14,7 @@ set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-relaxed-constexpr")
|
||||
set(CMAKE_CUDA_FLAGS_RELEASE "")
|
||||
set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -G -O0")
|
||||
# change the path to your Icicle location
|
||||
include_directories("/icicle")
|
||||
include_directories("../../.." "/icicle" "/opt/icicle")
|
||||
add_executable(
|
||||
example
|
||||
example.cu
|
||||
|
||||
@@ -36,6 +36,12 @@ The configuration is passed to the kernel as a structure of type `msm::MSMConfig
|
||||
|
||||
- `large_bucket_factor`: distinguishes between large bucket and normal bucket sizes. If there is a scalar distribution that is skewed heavily to a few values we can operate on those separately from the rest of the values. The ideal value here can vary by circuit (based on the distribution of scalars) but start with 10 and adjust to see if it improves performance.
|
||||
|
||||
## Running the example
|
||||
|
||||
- `cd` to your example directory
|
||||
- compile with `./compile.sh`
|
||||
- run with `./run.sh`
|
||||
|
||||
## What's in the example
|
||||
|
||||
1. Define the parameters of MSM
|
||||
|
||||
@@ -26,40 +26,17 @@ int main(int argc, char* argv[])
|
||||
scalar_t::RandHostMany(scalars, N);
|
||||
projective_t::RandHostManyAffine(points, N);
|
||||
|
||||
std::cout << "Configuring MSM to use on-host inputs" << std::endl;
|
||||
// Create a CUDA stream
|
||||
cudaStream_t stream;
|
||||
cudaStreamCreate(&stream);
|
||||
std::cout << "Using default MSM configuration with on-host inputs" << std::endl;
|
||||
auto config = msm::DefaultMSMConfig();
|
||||
config.batch_size = batch_size;
|
||||
|
||||
std::cout << "Running MSM kernel" << std::endl;
|
||||
// Create two events to time the MSM kernel
|
||||
cudaStream_t stream = config.ctx.stream;
|
||||
cudaEvent_t start, stop;
|
||||
float time;
|
||||
// Create two events to time the MSM kernel
|
||||
cudaEventCreate(&start);
|
||||
cudaEventCreate(&stop);
|
||||
// Create a device context
|
||||
device_context::DeviceContext ctx = {
|
||||
stream, // stream
|
||||
0, // device_id
|
||||
0, // mempool
|
||||
};
|
||||
// Create a MSM configuration
|
||||
msm::MSMConfig config = {
|
||||
ctx, // DeviceContext
|
||||
0, // points_size
|
||||
1, // precompute_factor
|
||||
0, // c
|
||||
0, // bitsize
|
||||
10, // large_bucket_factor
|
||||
batch_size,
|
||||
false, // are_scalars_on_device
|
||||
false, // are_scalars_montgomery_form
|
||||
false, // are_points_on_device
|
||||
false, // are_points_montgomery_form
|
||||
false, // are_results_on_device
|
||||
false, // is_big_triangle
|
||||
true, // is_async
|
||||
};
|
||||
|
||||
std::cout << "Running MSM kernel with on-host inputs" << std::endl;
|
||||
// Record the start event on the stream
|
||||
cudaEventRecord(start, stream);
|
||||
// Execute the MSM kernel
|
||||
|
||||
Reference in New Issue
Block a user