gobackend

package
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 6 modules, 6 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 gobackend implements a native Go compute.Backend: 100% portable (including WASM) with optional SIMD/assembly acceleration (AVX2, AVX-512, ARM64 NEON/SME), fused operations, and constant weight caching.

Configuration options can be passed via GOMLX_BACKEND="go:<option1>,<option2>=<value>" or compute.NewWithConfig("go:..."). Supported options:

  • parallelism=<N>: maximum intra-op worker goroutines and concurrent Execute() calls (default: physical CPU cores when AVX-512 is active, or GOMAXPROCS otherwise. Because modern CPUs are very heterogeneous — hybrid P/E cores, SMT, multi-CCD, and 64-192+ core EPYC/Xeon NUMA servers where single-stream fan-out often peaks around 32-64 cores — the default may not always be optimal for every workload; override with parallelism=<N> when tuning).
  • intra_call_parallelism=<N>: optional cap on workers used inside a single Execute() call (intra-op + inter-op) without limiting inter-call concurrency (default: 0 = same as parallelism). Expected to be useful on 64-192+ core EPYC/Xeon servers (e.g., parallelism=192, intra_call_parallelism=32) so concurrent requests utilize all cores while each single call avoids cross-CCD/NUMA synchronization overhead.
  • num_executors=<N>: maximum concurrent node executors in parallel mode (default: 8).
  • ops_sequential / ops_parallel: force sequential or parallel inter-op execution (default: dynamic).
  • dependency_order / creation_order: topological scheduling strategy (default: dependency_order).
  • quantized_cache=<always|balanced|never>: constant weight/scale/zero-point/bias caching policy for FusedQuantizedDense (default: balanced; aliases: true/1 or bare quantized_cache for always; false/none/0 for never). See docs/GoBackendMemoryUsage.md for details.
  • constant_arena[=<true|false>]: allocate cached/pre-packed constant buffers in 2 MiB-aligned off-heap mmap chunks advised with MADV_HUGEPAGE on Linux, reference-counted per Builder/Executable so chunks are unmapped back to the OS when all referencing executables are finalized (default: true; can also be configured via GOMLX_GO_CONSTANT_ARENA).
  • no_ops: skip kernel math for scheduling/framework overhead benchmarking.

Passing an unknown option such as GOMLX_BACKEND="go:help" returns an error listing all valid options.

This package is a thin wrapper around internal/gobackend.

Index

Constants

View Source
const BackendName = "go"

BackendName to be used in GOMLX_BACKEND to specify this backend.

Variables

View Source
var GetBackend = sync.OnceValue(func() compute.Backend {
	backend, err := New("")
	if err != nil {
		panic(err)
	}
	return backend
})

GetBackend returns a singleton Go backend, created with the default configuration. The backend is only created at the first call of the function.

The singleton is never destroyed.

Functions

func New

func New(config string) (compute.Backend, error)

New constructs a new Go Backend using the comma-separated configuration options in config. See package documentation or https://gomlx.github.io/docs/backends/#2-the-go-backend-go for supported options.

Types

This section is empty.

Jump to

Keyboard shortcuts

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