Documentation
¶
Overview ¶
Package cudabackend implements a Pure-Go (CGO_ENABLED=0) direct CUDA compute backend for GoMLX (github.com/gomlx/compute).
Importing this package registers the "cuda" backend with github.com/gomlx/compute:
import _ "github.com/gomlx/compute-cuda"
Configuration options can be passed via GOMLX_BACKEND="cuda:<opt1>,<opt2>=<val>" or compute.NewWithConfig("cuda:..."). Supported options:
- device=<N>: default CUDA device ordinal to target (default: 0).
Index ¶
- Constants
- func New(config string) (compute.Backend, error)
- type Backend
- func (b *Backend) BufferFromFlatData(deviceNum compute.DeviceNum, flat any, shape shapes.Shape) (compute.Buffer, error)
- func (b *Backend) Builder(name string) compute.Builder
- func (b *Backend) Capabilities() compute.Capabilities
- func (b *Backend) Description() string
- func (b *Backend) DeviceDescription(deviceNum compute.DeviceNum) string
- func (b *Backend) Finalize()
- func (b *Backend) HasSharedBuffers() bool
- func (b *Backend) IsFinalized() bool
- func (b *Backend) Name() string
- func (b *Backend) NewSharedBuffer(deviceNum compute.DeviceNum, shape shapes.Shape) (compute.Buffer, any, error)
- func (b *Backend) NumDevices() int
- func (b *Backend) String() string
- type Buffer
- func (buf *Buffer) Backend() compute.Backend
- func (buf *Buffer) CopyToDevice(deviceNum compute.DeviceNum) (compute.Buffer, error)
- func (buf *Buffer) Data() (any, error)
- func (buf *Buffer) DeviceNum() (compute.DeviceNum, error)
- func (buf *Buffer) Finalize() error
- func (buf *Buffer) Shape() (shapes.Shape, error)
- func (buf *Buffer) ToFlatData(flat any) error
- type Builder
- type Executable
- type Function
- func (f *Function) Abs(x compute.Value) (compute.Value, error)
- func (f *Function) Add(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) ArgMinMax(x compute.Value, axis int, outputDType dtypes.DType, isMin bool) (compute.Value, error)
- func (f *Function) Atan2(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) BatchNormForInference(operand, scale, offset, mean, variance compute.Value, epsilon float32, ...) (compute.Value, error)
- func (f *Function) BatchNormForTraining(operand, scale, offset compute.Value, epsilon float32, featureAxis int) (compute.Value, compute.Value, compute.Value, error)
- func (f *Function) BatchNormGradient(operand, scale, mean, variance, gradOutput compute.Value, epsilon float32, ...) (compute.Value, compute.Value, compute.Value, error)
- func (f *Function) BitCount(x compute.Value) (compute.Value, error)
- func (f *Function) Bitcast(x compute.Value, targetDType dtypes.DType) (compute.Value, error)
- func (f *Function) BitwiseAnd(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) BitwiseNot(x compute.Value) (compute.Value, error)
- func (f *Function) BitwiseOr(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) BitwiseXor(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) BroadcastInDim(operand compute.Value, outputShape shapes.Shape, broadcastAxes []int) (compute.Value, error)
- func (f *Function) Builder() compute.Builder
- func (f *Function) Call(target compute.Function, inputs ...compute.Value) ([]compute.Value, error)
- func (f *Function) Ceil(x compute.Value) (compute.Value, error)
- func (f *Function) Clamp(minVal, x, maxVal compute.Value) (compute.Value, error)
- func (f *Function) Closure() (compute.Function, error)
- func (f *Function) Clz(x compute.Value) (compute.Value, error)
- func (f *Function) Complex(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Concatenate(axis int, operands ...compute.Value) (compute.Value, error)
- func (f *Function) Conj(x compute.Value) (compute.Value, error)
- func (f *Function) Constant(flat any, dims ...int) (compute.Value, error)
- func (f *Function) ConstantFromBuffer(buf compute.Buffer, donate bool) (compute.Value, error)
- func (f *Function) ConvGeneral(input, kernel compute.Value, axes compute.ConvolveAxesConfig, strides []int, ...) (compute.Value, error)
- func (f *Function) ConvertDType(x compute.Value, dtype dtypes.DType) (compute.Value, error)
- func (f *Function) Cos(x compute.Value) (compute.Value, error)
- func (f *Function) CumMax(operand compute.Value, axis int, options compute.CumSumOptions) (compute.Value, error)
- func (f *Function) CumSum(operand compute.Value, axis int, options compute.CumSumOptions) (compute.Value, error)
- func (f *Function) Div(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) DotGeneral(lhs compute.Value, lhsContractingAxes, lhsBatchAxes []int, rhs compute.Value, ...) (compute.Value, error)
- func (f *Function) DynamicBroadcastInDim(operand compute.Value, broadcastAxes []int, ...) (compute.Value, error)
- func (f *Function) DynamicDimensionSize(operand compute.Value, axis int) (compute.Value, error)
- func (f *Function) DynamicIota(dtype dtypes.DType, iotaAxis int, dimensions ...compute.DynamicDimensionSpec) (compute.Value, error)
- func (f *Function) DynamicPad(x, fillValue compute.Value, axesConfig ...compute.DynamicPadAxis) (compute.Value, error)
- func (f *Function) DynamicReshape(operand compute.Value, dimensions ...compute.DynamicDimensionSpec) (compute.Value, error)
- func (f *Function) DynamicShape(operand compute.Value) (compute.Value, error)
- func (f *Function) DynamicSlice(operand compute.Value, startIndices []compute.Value, sliceDims []int) (compute.Value, error)
- func (f *Function) DynamicUpdateSlice(operand, update compute.Value, startIndices []compute.Value) (compute.Value, error)
- func (f *Function) Equal(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) EqualTotalOrder(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Erf(x compute.Value) (compute.Value, error)
- func (f *Function) Exp(x compute.Value) (compute.Value, error)
- func (f *Function) Expm1(x compute.Value) (compute.Value, error)
- func (f *Function) Floor(x compute.Value) (compute.Value, error)
- func (f *Function) FusedActivation(x compute.Value, cfg compute.ActivationConfig) (compute.Value, error)
- func (f *Function) FusedActivationVJP(y, x, dOutput compute.Value, cfg compute.ActivationConfig) (compute.Value, error)
- func (f *Function) FusedAttentionQKVProjection(x, wQKV, biasQ, biasK, biasV compute.Value, queryDim, keyValueDim int) (query, key, value compute.Value, err error)
- func (f *Function) FusedDense(x, weight, bias compute.Value, options compute.DenseConfig) (compute.Value, error)
- func (f *Function) FusedDenseVJP(x, weight, bias, y, dOutput compute.Value, options compute.DenseConfig) (dx, dWeight, dBias compute.Value, err error)
- func (f *Function) FusedLayerNorm(x compute.Value, axes []int, epsilon float64, gamma, beta compute.Value) (compute.Value, error)
- func (f *Function) FusedLayerNormVJP(x, dOutput compute.Value, axes []int, epsilon float64, ...) (dx, dGamma, dBeta compute.Value, err error)
- func (f *Function) FusedQuantizedDense(x, weight, bias compute.Value, options compute.FusedQuantizedDenseConfig) (compute.Value, error)
- func (f *Function) FusedQuantizedDenseVJP(x, weight, bias, y, dOutput compute.Value, ...) (dx, dBias compute.Value, err error)
- func (f *Function) FusedScaledDotProductAttention(query, key, value compute.Value, axesLayout compute.AttentionAxesLayout, ...) (output compute.Value, statesForVJP []compute.Value, err error)
- func (f *Function) FusedSoftmax(x compute.Value, axis int) (compute.Value, error)
- func (f *Function) FusedTopK(operand compute.Value, k int, cfg compute.FusedTopKConfig) (values, indices compute.Value, err error)
- func (f *Function) Gather(operand, startIndices compute.Value, indexVectorAxis int, ...) (compute.Value, error)
- func (f *Function) GreaterOrEqual(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) GreaterOrEqualTotalOrder(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) GreaterThan(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) GreaterThanTotalOrder(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Identity(x compute.Value) (compute.Value, error)
- func (f *Function) If(pred compute.Value, trueBranch, falseBranch compute.Function) ([]compute.Value, error)
- func (f *Function) Imag(x compute.Value) (compute.Value, error)
- func (f *Function) Iota(shape shapes.Shape, iotaAxis int) (compute.Value, error)
- func (f *Function) IsFinite(x compute.Value) (compute.Value, error)
- func (f *Function) IsNaN(x compute.Value) (compute.Value, error)
- func (f *Function) LessOrEqual(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) LessOrEqualTotalOrder(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) LessThan(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) LessThanTotalOrder(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Log(x compute.Value) (compute.Value, error)
- func (f *Function) Log1p(x compute.Value) (compute.Value, error)
- func (f *Function) LogicalAnd(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) LogicalNot(x compute.Value) (compute.Value, error)
- func (f *Function) LogicalOr(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) LogicalXor(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Logistic(x compute.Value) (compute.Value, error)
- func (f *Function) Max(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Min(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Mul(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Name() string
- func (f *Function) Neg(x compute.Value) (compute.Value, error)
- func (f *Function) NonZero(operand compute.Value, cfg compute.NonZeroConfig) (compute.Value, error)
- func (f *Function) NotEqual(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) NotEqualTotalOrder(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) OptimizationBarrier(operands ...compute.Value) ([]compute.Value, error)
- func (f *Function) Pad(x, fillValue compute.Value, axesConfig ...compute.PadAxis) (compute.Value, error)
- func (f *Function) Parameter(name string, shape shapes.Shape, sharding *compute.ShardingSpec) (compute.Value, error)
- func (f *Function) Parent() compute.Function
- func (f *Function) Pow(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) QuantizedGather(x, indices compute.Value, xQuantization *compute.Quantization) (compute.Value, error)
- func (f *Function) RNGBitGenerator(state compute.Value, shape shapes.Shape, algorithm compute.RNGAlgorithm) (compute.Value, compute.Value, error)
- func (f *Function) Real(x compute.Value) (compute.Value, error)
- func (f *Function) ReduceBitwiseAnd(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceBitwiseOr(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceBitwiseXor(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceLogicalAnd(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceLogicalOr(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceLogicalXor(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceMax(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceMin(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceProduct(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceSum(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) ReduceWindow(input compute.Value, reductionType compute.ReduceOpType, ...) (compute.Value, error)
- func (f *Function) Rem(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Reshape(x compute.Value, dimensions ...int) (compute.Value, error)
- func (f *Function) Return(outputs []compute.Value, shardings []*compute.ShardingSpec) error
- func (f *Function) Reverse(x compute.Value, axes ...int) (compute.Value, error)
- func (f *Function) Round(x compute.Value) (compute.Value, error)
- func (f *Function) Rsqrt(x compute.Value) (compute.Value, error)
- func (f *Function) ScatterMax(operand, scatterIndices, updates compute.Value, indexVectorAxis int, ...) (compute.Value, error)
- func (f *Function) ScatterMin(operand, scatterIndices, updates compute.Value, indexVectorAxis int, ...) (compute.Value, error)
- func (f *Function) ScatterSum(operand, scatterIndices, updates compute.Value, indexVectorAxis int, ...) (compute.Value, error)
- func (f *Function) SchedulingBarrier(operand compute.Value, dependencies ...compute.Value) (compute.Value, error)
- func (f *Function) SelectAndScatterMax(operand, source compute.Value, windowDimensions, windowStrides []int, ...) (compute.Value, error)
- func (f *Function) SelectAndScatterMin(operand, source compute.Value, windowDimensions, windowStrides []int, ...) (compute.Value, error)
- func (f *Function) Shape(v compute.Value) (shapes.Shape, error)
- func (f *Function) ShiftLeft(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) ShiftRightArithmetic(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) ShiftRightLogical(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Sign(x compute.Value) (compute.Value, error)
- func (f *Function) Sin(x compute.Value) (compute.Value, error)
- func (f *Function) Slice(x compute.Value, starts, limits, strides []int) (compute.Value, error)
- func (f *Function) Sort(comparator compute.Function, axis int, isStable bool, inputs ...compute.Value) ([]compute.Value, error)
- func (f *Function) Sqrt(x compute.Value) (compute.Value, error)
- func (f *Function) Sub(lhs, rhs compute.Value) (compute.Value, error)
- func (f *Function) Tanh(x compute.Value) (compute.Value, error)
- func (f *Function) Transpose(x compute.Value, permutation ...int) (compute.Value, error)
- func (f *Function) Where(condition, onTrue, onFalse compute.Value) (compute.Value, error)
- func (f *Function) While(cond, body compute.Function, initialState ...compute.Value) ([]compute.Value, error)
Constants ¶
const BackendName = "cuda"
BackendName is the name registered with github.com/gomlx/compute.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements compute.Backend using NVIDIA's CUDA Driver API and cuBLAS in Pure Go.
func (*Backend) BufferFromFlatData ¶
func (b *Backend) BufferFromFlatData(deviceNum compute.DeviceNum, flat any, shape shapes.Shape) (compute.Buffer, error)
BufferFromFlatData transfers host flat data into a GPU VRAM buffer.
func (*Backend) Capabilities ¶
func (b *Backend) Capabilities() compute.Capabilities
Capabilities returns the operations, data types, and features supported by this backend.
func (*Backend) Description ¶
Description returns a human-readable description of the backend.
func (*Backend) DeviceDescription ¶
DeviceDescription returns a description of the given device ordinal.
func (*Backend) Finalize ¶
func (b *Backend) Finalize()
Finalize releases all backend resources immediately and waits for in-flight operations to finish. Finalize is goroutine-safe and idempotent.
func (*Backend) HasSharedBuffers ¶
HasSharedBuffers returns false because discrete GPU VRAM is not directly CPU-addressable without Unified Memory page-fault overhead.
func (*Backend) IsFinalized ¶
IsFinalized reports whether Finalize has been called on this backend.
func (*Backend) NewSharedBuffer ¶
func (b *Backend) NewSharedBuffer(deviceNum compute.DeviceNum, shape shapes.Shape) (compute.Buffer, any, error)
NewSharedBuffer is not supported by the CUDA backend.
func (*Backend) NumDevices ¶
NumDevices returns the number of CUDA devices exposed by this backend.
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer implements compute.Buffer backed by CUDA device VRAM.
func (*Buffer) CopyToDevice ¶
CopyToDevice returns an independent deep copy of this buffer on deviceNum.
func (*Buffer) Finalize ¶
Finalize releases the GPU memory owned by this buffer. Finalize is goroutine-safe, idempotent, and a safe no-op after Backend.Finalize().
func (*Buffer) ToFlatData ¶
ToFlatData transfers the GPU buffer contents into a Go flat slice matching the buffer's dtype and size.
type Builder ¶
type Builder struct {
notimplemented.Builder
// contains filtered or unexported fields
}
Builder implements compute.Builder for the CUDA backend.
func (*Builder) Compile ¶
func (b *Builder) Compile() (compute.Executable, error)
Compile validates and lowers the recorded graph (and all sub-functions/closures) into a runnable *Executable.
func (*Builder) NewFunction ¶
NewFunction creates a new named function within this builder.
type Executable ¶
type Executable struct {
// contains filtered or unexported fields
}
Executable represents a compiled CUDA computation ready to run.
func (*Executable) Execute ¶
func (e *Executable) Execute(inputs []compute.Buffer, donate []bool, defaultDevice compute.DeviceNum) ([]compute.Buffer, error)
Execute runs the compiled computation on the GPU.
func (*Executable) Finalize ¶
func (e *Executable) Finalize()
Finalize releases resources associated with this executable. Finalize is goroutine-safe, idempotent, and safe to call after Backend.Finalize().
func (*Executable) Inputs ¶
func (e *Executable) Inputs() ([]string, []shapes.Shape)
Inputs returns the parameter names and shapes in order of creation.
func (*Executable) Outputs ¶
func (e *Executable) Outputs() []shapes.Shape
Outputs returns the output shapes in order passed to Function.Return.
type Function ¶
type Function struct {
notimplemented.Function
// contains filtered or unexported fields
}
Function implements compute.Function for the CUDA backend.
func (*Function) BatchNormForInference ¶
func (*Function) BatchNormForTraining ¶
func (*Function) BatchNormGradient ¶
func (*Function) BitwiseAnd ¶
func (*Function) BitwiseXor ¶
func (*Function) BroadcastInDim ¶
func (*Function) Closure ¶
Closure creates a new closure function nested inside f that may capture values from ancestor scopes.
func (*Function) Concatenate ¶
func (*Function) Constant ¶
Constant creates a constant node backed by flat host slice data copied into the graph.
func (*Function) ConstantFromBuffer ¶
ConstantFromBuffer creates a constant node backed by an existing CUDA buffer.
func (*Function) ConvGeneral ¶
func (*Function) ConvertDType ¶
func (*Function) DotGeneral ¶
func (f *Function) DotGeneral( lhs compute.Value, lhsContractingAxes, lhsBatchAxes []int, rhs compute.Value, rhsContractingAxes, rhsBatchAxes []int, config compute.DotGeneralConfig, ) (compute.Value, error)
DotGeneral records a generalized tensor contraction (batched matrix multiplication / einsum).
func (*Function) DynamicBroadcastInDim ¶
func (*Function) DynamicDimensionSize ¶
func (*Function) DynamicIota ¶
func (*Function) DynamicPad ¶
func (*Function) DynamicReshape ¶
func (*Function) DynamicShape ¶
func (*Function) DynamicSlice ¶
func (*Function) DynamicUpdateSlice ¶
func (*Function) EqualTotalOrder ¶
func (*Function) FusedActivation ¶
func (f *Function) FusedActivation(x compute.Value, cfg compute.ActivationConfig) (compute.Value, error)
FusedActivation applies the configured activation function (including SwiGLU).
func (*Function) FusedActivationVJP ¶
func (f *Function) FusedActivationVJP(y, x, dOutput compute.Value, cfg compute.ActivationConfig) (compute.Value, error)
FusedActivationVJP computes the VJP of FusedActivation.
func (*Function) FusedAttentionQKVProjection ¶
func (f *Function) FusedAttentionQKVProjection( x, wQKV, biasQ, biasK, biasV compute.Value, queryDim, keyValueDim int, ) (query, key, value compute.Value, err error)
FusedAttentionQKVProjection performs fused Q/K/V linear projection + split + optional biases.
func (*Function) FusedDense ¶
func (f *Function) FusedDense(x, weight, bias compute.Value, options compute.DenseConfig) (compute.Value, error)
FusedDense performs fused matmul + optional bias + optional activation.
func (*Function) FusedDenseVJP ¶
func (f *Function) FusedDenseVJP(x, weight, bias, y, dOutput compute.Value, options compute.DenseConfig) (dx, dWeight, dBias compute.Value, err error)
FusedDenseVJP computes gradients (dx, dWeight, dBias) for FusedDense.
func (*Function) FusedLayerNorm ¶
func (f *Function) FusedLayerNorm(x compute.Value, axes []int, epsilon float64, gamma, beta compute.Value) (compute.Value, error)
FusedLayerNorm applies layer normalization over specified axes with optional gamma and beta.
func (*Function) FusedLayerNormVJP ¶
func (f *Function) FusedLayerNormVJP(x, dOutput compute.Value, axes []int, epsilon float64, gamma, beta compute.Value) (dx, dGamma, dBeta compute.Value, err error)
FusedLayerNormVJP computes gradients (dx, dGamma, dBeta) for FusedLayerNorm.
func (*Function) FusedQuantizedDense ¶
func (f *Function) FusedQuantizedDense(x, weight, bias compute.Value, options compute.FusedQuantizedDenseConfig) (compute.Value, error)
FusedQuantizedDense performs fused quantized matrix multiplication + optional bias + optional activation + optional output re-quantization across QuantLinear, QuantNF4, and QuantGGML.
func (*Function) FusedQuantizedDenseVJP ¶
func (f *Function) FusedQuantizedDenseVJP( x, weight, bias, y, dOutput compute.Value, options compute.FusedQuantizedDenseConfig, ) (dx, dBias compute.Value, err error)
FusedQuantizedDenseVJP computes gradients (dx, dBias) for FusedQuantizedDense keeping quantized weights frozen.
func (*Function) FusedScaledDotProductAttention ¶
func (f *Function) FusedScaledDotProductAttention( query, key, value compute.Value, axesLayout compute.AttentionAxesLayout, options *compute.ScaledDotProductAttentionConfig, ) (output compute.Value, statesForVJP []compute.Value, err error)
FusedScaledDotProductAttention computes FlashAttention-style multi-head scaled dot-product attention.
func (*Function) FusedSoftmax ¶
FusedSoftmax computes softmax along the specified non-negative axis.
func (*Function) FusedTopK ¶
func (f *Function) FusedTopK(operand compute.Value, k int, cfg compute.FusedTopKConfig) (values, indices compute.Value, err error)
FusedTopK selects the k largest (or smallest) elements and their Int32 indices along cfg.Axis.
func (*Function) GreaterOrEqual ¶
func (*Function) GreaterOrEqualTotalOrder ¶
func (*Function) GreaterThan ¶
func (*Function) GreaterThanTotalOrder ¶
func (*Function) LessOrEqual ¶
func (*Function) LessOrEqualTotalOrder ¶
func (*Function) LessThanTotalOrder ¶
func (*Function) LogicalAnd ¶
func (*Function) LogicalXor ¶
func (*Function) NotEqualTotalOrder ¶
func (*Function) OptimizationBarrier ¶
func (*Function) Parameter ¶
func (f *Function) Parameter(name string, shape shapes.Shape, sharding *compute.ShardingSpec) (compute.Value, error)
Parameter creates a computation input parameter (supporting both static and dynamic shapes).
func (*Function) Parent ¶
Parent returns the parent function for closures, or nil for top-level functions.
func (*Function) QuantizedGather ¶
func (f *Function) QuantizedGather(x, indices compute.Value, xQuantization *compute.Quantization) (compute.Value, error)
QuantizedGather performs quantized row gather (embedding lookup) with on-the-fly unpacking or dequantization across QuantNone, QuantLinear, QuantNF4, and all 12 QuantGGML types.
func (*Function) RNGBitGenerator ¶
func (*Function) ReduceBitwiseAnd ¶
func (*Function) ReduceBitwiseOr ¶
func (*Function) ReduceBitwiseXor ¶
func (*Function) ReduceLogicalAnd ¶
func (*Function) ReduceLogicalOr ¶
func (*Function) ReduceLogicalXor ¶
func (*Function) ReduceProduct ¶
func (*Function) ReduceWindow ¶
func (*Function) ScatterMax ¶
func (*Function) ScatterMin ¶
func (*Function) ScatterSum ¶
func (*Function) SchedulingBarrier ¶
func (*Function) SelectAndScatterMax ¶
func (*Function) SelectAndScatterMin ¶
func (*Function) ShiftRightArithmetic ¶
func (*Function) ShiftRightLogical ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
arena
Package arena provides pooled, zero-allocation scratch storage for low-latency CUDA Driver API and cuBLAS calls (such as cuLaunchKernel kernelParams arrays and scalar argument buffers).
|
Package arena provides pooled, zero-allocation scratch storage for low-latency CUDA Driver API and cuBLAS calls (such as cuLaunchKernel kernelParams arrays and scalar argument buffers). |
|
cublas
Package cublas provides Pure-Go (CGO_ENABLED=0) dynamic bindings to NVIDIA's cuBLAS library (libcublas.so.13 / libcublas.so.12 / libcublas.so) built on top of internal/dynlib.
|
Package cublas provides Pure-Go (CGO_ENABLED=0) dynamic bindings to NVIDIA's cuBLAS library (libcublas.so.13 / libcublas.so.12 / libcublas.so) built on top of internal/dynlib. |
|
driver
Package driver provides Pure-Go bindings to NVIDIA's CUDA Driver API (libcuda.so.1 / nvcuda.dll) loaded dynamically via internal/dynlib.
|
Package driver provides Pure-Go bindings to NVIDIA's CUDA Driver API (libcuda.so.1 / nvcuda.dll) loaded dynamically via internal/dynlib. |
|
dynlib
Package dynlib isolates all Pure-Go dynamic shared library loading (currently backed by github.com/ebitengine/purego) behind a minimal internal API.
|
Package dynlib isolates all Pure-Go dynamic shared library loading (currently backed by github.com/ebitengine/purego) behind a minimal internal API. |
|
pool
Package pool implements a lock-free per-P object pool modeled after go-xla/internal/pool, providing very low-latency object reuse for hot-path CUDA Driver API / cuBLAS calls.
|
Package pool implements a lock-free per-P object pool modeled after go-xla/internal/pool, providing very low-latency object reuse for hot-path CUDA Driver API / cuBLAS calls. |
|
ptx
Package ptx manages embedded precompiled CUDA PTX/fatbin modules and caches loaded CUmodule / CUfunction handles per CUDA DeviceContext.
|
Package ptx manages embedded precompiled CUDA PTX/fatbin modules and caches loaded CUmodule / CUfunction handles per CUDA DeviceContext. |