pub struct GpuDevice {
pub config: GpuDeviceConfig,
pub device_ctx: GpuDeviceCtx,
}Expand description
Stream-owning device handle. Wraps GpuDeviceConfig with a
GpuDeviceCtx that carries the explicit CUDA stream.
Fields§
§config: GpuDeviceConfig§device_ctx: GpuDeviceCtxImplementations§
Source§impl GpuDevice
impl GpuDevice
pub fn new(params: SystemParams) -> Result<Self, CudaError>
pub fn params(&self) -> &SystemParams
pub fn prover_config(&self) -> &GpuProverConfig
pub fn prover_config_mut(&mut self) -> &mut GpuProverConfig
pub fn sm_count(&self) -> u32
pub fn id(&self) -> u32
pub fn with_cache_rs_code_matrix(self, cache_rs_code_matrix: bool) -> Self
pub fn set_cache_rs_code_matrix(&mut self, cache_rs_code_matrix: bool)
Trait Implementations§
Source§impl<HS: GpuHashScheme> DeviceDataTransporter<<HS as GpuHashScheme>::SC, GenericGpuBackend<HS>> for GpuDevice
impl<HS: GpuHashScheme> DeviceDataTransporter<<HS as GpuHashScheme>::SC, GenericGpuBackend<HS>> for GpuDevice
Source§fn transport_pk_to_device(
&self,
mpk: &MultiStarkProvingKey<HS::SC>,
) -> DeviceMultiStarkProvingKey<GenericGpuBackend<HS>>
fn transport_pk_to_device( &self, mpk: &MultiStarkProvingKey<HS::SC>, ) -> DeviceMultiStarkProvingKey<GenericGpuBackend<HS>>
Transport the proving key to the device, filtering for only the provided
air_ids.fn transport_matrix_to_device( &self, matrix: &ColMajorMatrix<F>, ) -> DeviceMatrix<F>
Source§fn transport_pcs_data_to_device(
&self,
pcs_data: &StackedPcsData<F, HS::Digest>,
) -> StackedPcsDataGpu<F, HS::Digest>
fn transport_pcs_data_to_device( &self, pcs_data: &StackedPcsData<F, HS::Digest>, ) -> StackedPcsDataGpu<F, HS::Digest>
The
commitment and prover_data are assumed to have been previously computed from the
trace.Source§fn transport_matrix_from_device_to_host(
&self,
matrix: &DeviceMatrix<F>,
) -> ColMajorMatrix<F>
fn transport_matrix_from_device_to_host( &self, matrix: &DeviceMatrix<F>, ) -> ColMajorMatrix<F>
Transport a device matrix to host. This should only be used for testing / debugging
purposes.
fn transport_committed_trace_data_to_device( &self, committed_trace: &CommittedTraceData<CpuColMajorBackend<SC>>, ) -> CommittedTraceData<PB>
fn transport_proving_ctx_to_device( &self, ctx: &ProvingContext<CpuColMajorBackend<SC>>, ) -> ProvingContext<PB>
Source§impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> MultiRapProver<GenericGpuBackend<HS>, TS> for GpuDevice
impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> MultiRapProver<GenericGpuBackend<HS>, TS> for GpuDevice
Source§type Artifacts = Vec<BinomialExtensionField<MontyField31<BabyBearParameters>, 4>>
type Artifacts = Vec<BinomialExtensionField<MontyField31<BabyBearParameters>, 4>>
The random opening point r where the batch constraint sumcheck reduces to evaluation
claims of trace matrices T, T_{rot} at r_{n_T}.
Source§type PartialProof = (GkrProof<<HS as GpuHashScheme>::SC>, BatchConstraintProof<<HS as GpuHashScheme>::SC>)
type PartialProof = (GkrProof<<HS as GpuHashScheme>::SC>, BatchConstraintProof<<HS as GpuHashScheme>::SC>)
The partial proof is the proof that the trace matrices satisfy all constraints assuming that
certain polynomial opening claims are validated. In other words, it is a proof that reduces
the constraint satisfaction claim to certain polynomial opening claims.
type Error = ProverError
fn prove_rap_constraints( &self, transcript: &mut TS, mpk: &DeviceMultiStarkProvingKey<GenericGpuBackend<HS>>, ctx: &ProvingContext<GenericGpuBackend<HS>>, _common_main_pcs_data: &StackedPcsDataGpu<F, HS::Digest>, ) -> Result<((GkrProof<HS::SC>, BatchConstraintProof<HS::SC>), Vec<EF>), Self::Error>
Source§impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> OpeningProver<GenericGpuBackend<HS>, TS> for GpuDevice
impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> OpeningProver<GenericGpuBackend<HS>, TS> for GpuDevice
Source§type OpeningPoints = Vec<BinomialExtensionField<MontyField31<BabyBearParameters>, 4>>
type OpeningPoints = Vec<BinomialExtensionField<MontyField31<BabyBearParameters>, 4>>
The shared vector r where each trace matrix T, T_{rot} is opened at r_{n_T}.
Source§type OpeningProof = (StackingProof<<HS as GpuHashScheme>::SC>, WhirProof<<HS as GpuHashScheme>::SC>)
type OpeningProof = (StackingProof<<HS as GpuHashScheme>::SC>, WhirProof<<HS as GpuHashScheme>::SC>)
PCS opening proof on host. This should not be a reference.
Source§type Error = ProverError
type Error = ProverError
Computes the opening proof.
The
common_main_pcs_data is the PcsData for the collection of common main trace
matrices. It is owned by the function and may be mutated.
The pre_cached_pcs_data_per_commit is the PcsData for the preprocessed and cached trace
matrices. These are specified by their PcsData per commitment.fn prove_openings( &self, transcript: &mut TS, mpk: &DeviceMultiStarkProvingKey<GenericGpuBackend<HS>>, ctx: ProvingContext<GenericGpuBackend<HS>>, common_main_pcs_data: StackedPcsDataGpu<F, HS::Digest>, r: Vec<EF>, ) -> Result<Self::OpeningProof, Self::Error>
Source§impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> ProverDevice<GenericGpuBackend<HS>, TS> for GpuDevice
impl<HS: GpuHashScheme, TS: GpuFiatShamirTranscript<HS::SC>> ProverDevice<GenericGpuBackend<HS>, TS> for GpuDevice
type Error = ProverError
Source§type DeviceCtx = GpuDeviceCtx
type DeviceCtx = GpuDeviceCtx
Device-specific context (e.g., CUDA stream). Unit
() for CPU devices.fn device_ctx(&self) -> &GpuDeviceCtx
Source§impl<HS: GpuHashScheme> TraceCommitter<GenericGpuBackend<HS>> for GpuDevicewhere
HS::MerkleHash: MerkleTreeConstructor,
impl<HS: GpuHashScheme> TraceCommitter<GenericGpuBackend<HS>> for GpuDevicewhere
HS::MerkleHash: MerkleTreeConstructor,
type Error = ProverError
fn commit( &self, traces: &[&DeviceMatrix<F>], ) -> Result<(HS::Digest, StackedPcsDataGpu<F, HS::Digest>), Self::Error>
Auto Trait Implementations§
impl Freeze for GpuDevice
impl RefUnwindSafe for GpuDevice
impl Send for GpuDevice
impl Sync for GpuDevice
impl Unpin for GpuDevice
impl UnsafeUnpin for GpuDevice
impl UnwindSafe for GpuDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more