Table of Contents

Class GpuPINNTrainingOptions

Namespace
AiDotNet.PhysicsInformed
Assembly
AiDotNet.dll

Configuration options for GPU-accelerated PINN training.

public class GpuPINNTrainingOptions
Inheritance
GpuPINNTrainingOptions
Inherited Members

Remarks

For Beginners: These options control how GPU acceleration is used during physics-informed training. GPU acceleration can significantly speed up training by parallelizing operations across thousands of collocation points simultaneously.

Key settings:

  • EnableGpu: Master switch for GPU acceleration
  • BatchSizeGpu: Larger batches benefit more from GPU parallelism
  • ParallelDerivativeComputation: Compute derivatives for multiple points at once
  • AsyncTransfers: Overlap CPU/GPU data transfers with computation

Properties

AsyncTransfers

Gets or sets whether to use asynchronous GPU transfers. When enabled, data transfers overlap with computation for better performance.

public bool AsyncTransfers { get; set; }

Property Value

bool

BatchSizeGpu

Gets or sets the batch size for GPU operations. Larger batches provide better GPU utilization but require more memory. Default is 1024, which works well for most GPUs.

public int BatchSizeGpu { get; set; }

Property Value

int

Remarks

For Beginners: GPUs are most efficient when processing many operations at once. A larger batch size means more parallel work, but requires more GPU memory. Start with 1024 and increase if you have a high-end GPU with lots of memory.

CpuOnly

Creates options that disable GPU entirely (CPU-only mode).

public static GpuPINNTrainingOptions CpuOnly { get; }

Property Value

GpuPINNTrainingOptions

Default

Creates default options suitable for most GPUs.

public static GpuPINNTrainingOptions Default { get; }

Property Value

GpuPINNTrainingOptions

EnableGpu

Gets or sets whether to enable GPU acceleration (default: true if GPU available).

public bool EnableGpu { get; set; }

Property Value

bool

GpuConfig

Gets or sets the GPU acceleration configuration.

public GpuAccelerationConfig GpuConfig { get; set; }

Property Value

GpuAccelerationConfig

HighEnd

Creates options optimized for high-end GPUs (RTX 4090, A100, H100).

public static GpuPINNTrainingOptions HighEnd { get; }

Property Value

GpuPINNTrainingOptions

LowMemory

Creates options optimized for memory-constrained GPUs.

public static GpuPINNTrainingOptions LowMemory { get; }

Property Value

GpuPINNTrainingOptions

MinPointsForGpu

Gets or sets the minimum number of collocation points to trigger GPU usage. Below this threshold, CPU may be faster due to transfer overhead.

public int MinPointsForGpu { get; set; }

Property Value

int

NumStreams

Gets or sets the number of CUDA streams for parallel operations. More streams allow more parallel work but have diminishing returns.

public int NumStreams { get; set; }

Property Value

int

ParallelDerivativeComputation

Gets or sets whether to compute derivatives in parallel across the batch. This can significantly speed up PDE residual computation.

public bool ParallelDerivativeComputation { get; set; }

Property Value

bool

UseMixedPrecision

Gets or sets whether to use mixed precision (FP16) for forward/backward passes. Can provide 2x speedup on modern GPUs but with reduced precision.

public bool UseMixedPrecision { get; set; }

Property Value

bool

UsePinnedMemory

Gets or sets whether to pin memory for faster GPU transfers. Pinned memory allows faster CPU-GPU data transfer but uses more resources.

public bool UsePinnedMemory { get; set; }

Property Value

bool

VerboseLogging

Gets or sets whether to enable verbose GPU logging for debugging.

public bool VerboseLogging { get; set; }

Property Value

bool