graphbridge

package
v0.28.38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package graphbridge provides internal conversion helpers between the public core/graph wrapper types and the internal internal/graphimpl engine types, as well as internal graph operations used by higher-level GoMLX packages (such as ml/model, ml/nn, ml/layers, and core/autodiff).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachState

func AttachState(g *graph.Graph, key, value any)

AttachState attaches auxiliary state keyed by key to the Graph.

func BackendOutputs

func BackendOutputs(n *graph.Node) []compute.Value

BackendOutputs returns the underlying backend compute.Value slice for a Node.

func BatchNormForInference

func BatchNormForInference(operand, scale, offset, mean, variance *graph.Node, epsilon float32, axis int) *graph.Node

BatchNormForInference wraps the backend BatchNormForInference operation.

func BatchNormForTraining

func BatchNormForTraining(operand, scale, offset *graph.Node, epsilon float32, axis int) (normalized, batchMean, batchVariance *graph.Node)

BatchNormForTraining wraps the backend BatchNormForTraining operation.

func BatchNormGradient

func BatchNormGradient(operand, scale, mean, variance, gradOutput *graph.Node, epsilon float32, axis int) (gradOperand, gradScale, gradOffset *graph.Node)

BatchNormGradient wraps the backend BatchNormGradient operation.

func ConstBuffer

func ConstBuffer(g *graph.Graph, buf compute.Buffer, donate bool) *graph.Node

ConstBuffer creates a Constant node in g backed by buf.

func Exec

func Exec(impl *graphimpl.ExecImpl) *graph.Exec

Exec converts an internal *graphimpl.ExecImpl to its public *graph.Exec wrapper.

func ExecImpl

func ExecImpl(e *graph.Exec) *graphimpl.ExecImpl

ExecImpl returns the underlying *graphimpl.ExecImpl for a public *graph.Exec.

func Executable

func Executable(g *graph.Graph) compute.Executable

Executable returns the compiled compute.Executable of a compiled Graph.

func FinalizeConstantValue

func FinalizeConstantValue(val compute.Value)

FinalizeConstantValue releases backend resources held by a shared constant compute.Value.

func Function

func Function(impl *graphimpl.FunctionImpl) *graph.Function

Function converts an internal *graphimpl.FunctionImpl to its public *graph.Function wrapper.

func FunctionImpl

func FunctionImpl(f *graph.Function) *graphimpl.FunctionImpl

FunctionImpl returns the underlying *graphimpl.FunctionImpl for a public *graph.Function.

func FusedActivation

func FusedActivation(x *graph.Node, cfg compute.ActivationConfig) *graph.Node

FusedActivation invokes BackendFusedActivation on the underlying GraphImpl.

func FusedAttentionQKVProjection

func FusedAttentionQKVProjection(x, wQKV, biasQ, biasK, biasV *graph.Node, queryDim, keyValueDim int) (query, key, value *graph.Node)

FusedAttentionQKVProjection invokes BackendFusedAttentionQKVProjection on the underlying GraphImpl.

func FusedDense

func FusedDense(x, weight, bias *graph.Node, options compute.DenseConfig) *graph.Node

FusedDense invokes BackendFusedDense on the underlying GraphImpl.

func FusedLayerNorm

func FusedLayerNorm(x *graph.Node, axes []int, epsilon float64, gamma, beta *graph.Node) *graph.Node

FusedLayerNorm invokes BackendFusedLayerNorm on the underlying GraphImpl.

func FusedOpCaller

func FusedOpCaller(fused, decomposed func() *graph.Node, useDecomposedAlternateVJP bool) (output *graph.Node, opFused bool)

FusedOpCaller invokes fused and falls back to decomposed if the backend returns ErrNotImplemented or if fusion is disabled via graph.FusionEnv.

func FusedOpCallerMulti

func FusedOpCallerMulti(fused, decomposed func() []*graph.Node, useDecomposedAlternateVJP bool) (outputs []*graph.Node, opFused bool)

FusedOpCallerMulti is the multi-output variant of FusedOpCaller.

func FusedQuantizedDense

func FusedQuantizedDense(x, weight, bias *graph.Node, cfg graph.QuantizedDenseConfig) *graph.Node

FusedQuantizedDense invokes BackendFusedQuantizedDense on the underlying GraphImpl.

func FusedScaledDotProductAttention

func FusedScaledDotProductAttention(query, key, value *graph.Node, axesLayout compute.AttentionAxesLayout, options *compute.ScaledDotProductAttentionConfig) (output *graph.Node, statesForVJP []*graph.Node)

FusedScaledDotProductAttention invokes BackendFusedScaledDotProductAttention on the underlying GraphImpl.

func Graph

func Graph(impl *graphimpl.GraphImpl) *graph.Graph

Graph converts an internal *graphimpl.GraphImpl to its public *graph.Graph wrapper.

func GraphImpl

func GraphImpl(g *graph.Graph) *graphimpl.GraphImpl

GraphImpl returns the underlying *graphimpl.GraphImpl for a public *graph.Graph.

func Node

func Node(impl *graphimpl.NodeImpl) *graph.Node

Node converts an internal *graphimpl.NodeImpl to its public *graph.Node wrapper.

func NodeImpl

func NodeImpl(n *graph.Node) *graphimpl.NodeImpl

NodeImpl returns the underlying *graphimpl.NodeImpl for a public *graph.Node.

func NodeImpls

func NodeImpls(nodes []*graph.Node) []*graphimpl.NodeImpl

NodeImpls converts a slice of *graph.Node to []*graphimpl.NodeImpl.

func Nodes

func Nodes(impls []*graphimpl.NodeImpl) []*graph.Node

Nodes converts a slice of *graphimpl.NodeImpl to []*graph.Node.

func QuantizationFromImpl

func QuantizationFromImpl(q *graphimpl.Quantization) *graph.Quantization

QuantizationFromImpl converts a *graphimpl.Quantization back to *graph.Quantization.

func QuantizationToImpl

func QuantizationToImpl(q *graph.Quantization) *graphimpl.Quantization

QuantizationToImpl converts a public *graph.Quantization to *graphimpl.Quantization.

func QuantizedDenseConfigFromImpl

func QuantizedDenseConfigFromImpl(cfg graphimpl.QuantizedDenseConfig) graph.QuantizedDenseConfig

QuantizedDenseConfigFromImpl converts a graphimpl.QuantizedDenseConfig back to graph.QuantizedDenseConfig.

func QuantizedDenseConfigToImpl

func QuantizedDenseConfigToImpl(cfg graph.QuantizedDenseConfig) graphimpl.QuantizedDenseConfig

QuantizedDenseConfigToImpl converts a public graph.QuantizedDenseConfig to graphimpl.QuantizedDenseConfig.

func QuantizedGather

func QuantizedGather(x, indices *graph.Node, tq *graph.Quantization) *graph.Node

QuantizedGather invokes BackendQuantizedGather on the underlying GraphImpl.

func SharedConstant

func SharedConstant(g *graph.Graph, val compute.Value) *graph.Node

SharedConstant creates a Constant node in g reusing a backend constant compute.Value.

func State

func State(g *graph.Graph, key any) any

State retrieves auxiliary state attached to the Graph for key.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL