BatchNLPKernels.jl

BatchNLPKernels.BatchModelType
BatchModel{MT,E}

A wrapper around ExaModel that pre-initializes buffers for batch operations. Allows efficient evaluation of multiple points simultaneously.

Fields

  • model::ExaModel: The underlying ExaModel
  • batch_size::Int: Number of points to evaluate simultaneously
  • obj_work::MT: Batch objective values (nobj × batch_size)
  • cons_work::MT: Batch constraint values (nconaug × batch_size)
  • cons_out::MT: Dense constraint output buffer (ncon × batch_size)
  • grad_work::MT: Batch gradient values (nnzg × batch_size)
  • grad_out::MT: Dense gradient output buffer (nvar × batch_size)
  • jprod_work::MT: Batch jacobian values (nnzj × batch_size)
  • hprod_work::MT: Batch hessian values (nnzh × batch_size)
  • jprod_out::MT: Batch jacobian-vector product buffer (ncon × batch_size)
  • jtprod_out::MT: Batch jacobian transpose-vector product buffer (nvar × batch_size)
  • hprod_out::MT: Batch hessian-vector product buffer (nvar × batch_size)
  • viols_cons_out::MT: Constraint violation output buffer (ncon × batch_size)
  • viols_vars_out::MT: Variable violation output buffer (nvar × batch_size)
  • viols_cons::Interval: Constraint bounds as interval set
  • viols_vars::Interval: Variable bounds as interval set
source
BatchNLPKernels.BatchModelMethod
BatchModel(model::ExaModel, batch_size::Int; config=BatchModelConfig())

Create a BatchModel wrapper around an ExaModel with pre-allocated buffers for batch operations. Use config to specify which buffers to allocate.

source
BatchNLPKernels.BatchModelConfigType
BatchModelConfig

Configuration struct for controlling which buffers are allocated in a BatchModel.

Fields

  • obj::Bool: Allocate objective buffer (default: true)
  • cons::Bool: Allocate constraint buffers (default: true)
  • grad::Bool: Allocate gradient buffers (default: false)
  • jac::Bool: Allocate jacobian buffer (default: false)
  • hess::Bool: Allocate hessian buffer (default: false)
  • jprod::Bool: Allocate jacobian-vector product buffer (default: false)
  • jtprod::Bool: Allocate jacobian transpose-vector product buffer (default: false)
  • hprod::Bool: Allocate hessian-vector product buffer (default: false)
  • viols::Bool: Allocate constraint and variable violation buffers (default: false)
source
BatchNLPKernels.BatchModelConfigMethod
BatchModelConfig(; obj=true, cons=true, grad=false, jac=false, hess=false, jprod=false, jtprod=false, hprod=false, viols=false)

Create a BatchModelConfig with specified buffer allocations.

source
BatchNLPKernels.all_violations!Method
all_violations!(bm::BatchModel, X::AbstractMatrix, Θ::AbstractMatrix)

Compute all constraint and variable violations for a batch of solutions and parameters.

source
BatchNLPKernels.constraints!Method
constraints!(bm::BatchModel, X::AbstractMatrix, Θ::AbstractMatrix)

Evaluate constraints for a batch of solutions and parameters.

source
BatchNLPKernels.constraints_jprod!Method
constraints_jprod!(bm::BatchModel, X::AbstractMatrix, Θ::AbstractMatrix, V::AbstractMatrix, Jv::AbstractMatrix)

Evaluate Jacobian-vector products for a batch of points.

source
BatchNLPKernels.constraints_jtprod!Method
constraints_jtprod!(bm::BatchModel, X::AbstractMatrix, Θ::AbstractMatrix, V::AbstractMatrix)

Evaluate Jacobian-transpose-vector products for a batch of points.

source
BatchNLPKernels.constraints_jtprod!Method
constraints_jtprod!(bm::BatchModel, X::AbstractMatrix, Θ::AbstractMatrix, V::AbstractMatrix, Jtv::AbstractMatrix)

Evaluate Jacobian-transpose-vector products for a batch of points.

source
BatchNLPKernels.lagrangian_hessian!Method
lagrangian_hessian!(bm::BatchModel, X::AbstractMatrix, Θ::AbstractMatrix, Y::AbstractMatrix; obj_weight=1.0)

Evaluate Hessian coordinates for a batch of points.

source
BatchNLPKernels.lagrangian_hprod!Method
lagrangian_hprod!(bm::BatchModel, X::AbstractMatrix, Y::AbstractMatrix, V::AbstractMatrix; obj_weight=1.0)

Evaluate Hessian-vector products for a batch of points.

source
BatchNLPKernels.lagrangian_hprod!Method
lagrangian_hprod!(bm::BatchModel, X::AbstractMatrix, Θ::AbstractMatrix, Y::AbstractMatrix, V::AbstractMatrix; obj_weight=1.0)

Evaluate Hessian-vector products for a batch of points.

source
BatchNLPKernels.objective_gradient!Method
objective_gradient!(bm::BatchModel, X::AbstractMatrix, Θ::AbstractMatrix, G::AbstractMatrix)

Evaluate gradients for a batch of points with different parameters.

source