backendtest

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: 22 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

Index

Constants

This section is empty.

Variables

Functions

func BenchmarkConvGeneral added in v0.1.24

func BenchmarkConvGeneral(b *testing.B, backend compute.Backend)

BenchmarkConvGeneral runs standard 1D and 2D convolution benchmarks (forward, VJP wrt input, and VJP wrt kernel).

func BenchmarkDense

func BenchmarkDense(b *testing.B, backend compute.Backend)

func BenchmarkDotGeneral

func BenchmarkDotGeneral(b *testing.B, backend compute.Backend)

func BenchmarkFusedActivation added in v0.1.9

func BenchmarkFusedActivation(b *testing.B, backend compute.Backend)

func BenchmarkGelu

func BenchmarkGelu(b *testing.B, backend compute.Backend)

func BenchmarkLayerNorm

func BenchmarkLayerNorm(b *testing.B, backend compute.Backend)

func BenchmarkQuantizedDense

func BenchmarkQuantizedDense(b *testing.B, backend compute.Backend)

BenchmarkQuantizedDense compares fused quantized-dense (which uses highway SIMD when available) against a decomposed path and float32 Dense as a reference.

The decomposed path is only benchmarked for Int8 because the go backend does not support bitwise shift ops needed for NF4/Int4 nibble extraction.

func BenchmarkRoPE added in v0.1.37

func BenchmarkRoPE(b *testing.B, backend compute.Backend)

func BenchmarkScaledDotProductAttention added in v0.1.30

func BenchmarkScaledDotProductAttention(b *testing.B, backend compute.Backend)

func BenchmarkSoftmax

func BenchmarkSoftmax(b *testing.B, backend compute.Backend)

func RunAll

func RunAll(t *testing.T, b compute.Backend, opts *AllTestsConfiguration)

RunAll runs all generic backend tests on the given backend.

If opts is nil, all tests will be run with all default test configurations.

func RunAllBenchmarks

func RunAllBenchmarks(b *testing.B, backend compute.Backend)

func TestBarriers

func TestBarriers(t *testing.T, b compute.Backend)

func TestBinaryOps

func TestBinaryOps(t *testing.T, b compute.Backend)

func TestBitcast

func TestBitcast(t *testing.T, b compute.Backend)

func TestConvGeneral

func TestConvGeneral(t *testing.T, b compute.Backend, opts *AllTestsConfiguration)

func TestConvertDType

func TestConvertDType(t *testing.T, b compute.Backend)

func TestDataDependentOps added in v0.1.29

func TestDataDependentOps(t *testing.T, b compute.Backend)

func TestDotGeneral

func TestDotGeneral(t *testing.T, backend compute.Backend)

func TestDynamicOps added in v0.1.29

func TestDynamicOps(t *testing.T, b compute.Backend)

TestDynamicOps tests dynamic shape operations, anonymous/minted axis names, zero-sized dimensions, and related operator corner cases across backends.

func TestExec

func TestExec(t *testing.T, b compute.Backend)

func TestFinalize added in v0.1.33

func TestFinalize(t *testing.T, newBackend func() (compute.Backend, error))

TestFinalize verifies backend finalization semantics:

  • Idempotent Backend.Finalize() and IsFinalized() reporting.
  • Derived objects (Builder, Executable, Buffer) return errors wrapping compute.ErrBackendFinalized instead of panicking or crashing after Backend.Finalize().
  • Finalize() on derived Buffer and Executable objects after Backend.Finalize() is a safe no-op.
  • Concurrent Execute / buffer creation / buffer reads race cleanly with Backend.Finalize(), which waits for in-flight operations before tearing down resources.

Because these tests finalize the backend, callers provide a factory function newBackend that constructs a fresh Backend instance per subtest.

func TestFunctions

func TestFunctions(t *testing.T, b compute.Backend)

func TestFusedOps

func TestFusedOps(t *testing.T, b compute.Backend)

func TestSpecialOps

func TestSpecialOps(t *testing.T, b compute.Backend)

func TestUnaryOps

func TestUnaryOps(t *testing.T, b compute.Backend)

Types

type AllTestsConfiguration

type AllTestsConfiguration struct {
	ConvGeneralDTypes []dtypes.DType
}

AllTestsConfiguration allows you to configure (select) which tests are run, in can your backend not support certain feature and you want to disable some specific tests.

The zero value always means "run all supported variants".

Jump to

Keyboard shortcuts

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