tpu

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Unlicense Imports: 10 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

This section is empty.

Functions

func NewTPUIndexImpl

func NewTPUIndexImpl(cfg types.GPUConfig) (types.Index, error)

Types

type HBMManager

type HBMManager struct {
	// contains filtered or unexported fields
}

HBMManager manages High Bandwidth Memory on the TPU. It uses a slab-like allocation strategy to minimize fragmentation.

func NewHBMManager

func NewHBMManager(total int64) *HBMManager

func (*HBMManager) Allocate

func (m *HBMManager) Allocate(deviceID int32, size int64) (unsafe.Pointer, error)

func (*HBMManager) Free

func (m *HBMManager) Free(ptr unsafe.Pointer) error

type TPUBackend

type TPUBackend struct {
	// contains filtered or unexported fields
}

func NewTPUBackend

func NewTPUBackend(deviceID int32) (*TPUBackend, error)

func (*TPUBackend) GetDeviceInfo

func (b *TPUBackend) GetDeviceInfo() (*types.GPUInfo, error)

func (*TPUBackend) Initialize

func (b *TPUBackend) Initialize() error

type TPUIndex

type TPUIndex struct {
	// contains filtered or unexported fields
}

func (*TPUIndex) Add

func (i *TPUIndex) Add(ids []int64, vectors []float32) error

func (*TPUIndex) AddPQ

func (i *TPUIndex) AddPQ(ids []int64, codes []byte, m int) error

func (*TPUIndex) AddTurboQuant

func (i *TPUIndex) AddTurboQuant(ids []int64, tqData []byte, bitsPerAngle int) error

func (*TPUIndex) AssignToClusters

func (i *TPUIndex) AssignToClusters(vectors []float32, centroids []float32) ([]uint32, error)

func (*TPUIndex) Backend

func (i *TPUIndex) Backend() types.GPUBackend

func (*TPUIndex) Clear

func (i *TPUIndex) Clear() error

func (*TPUIndex) Close

func (i *TPUIndex) Close() error

func (*TPUIndex) DeviceID

func (i *TPUIndex) DeviceID() int32

func (*TPUIndex) EncodePQ

func (i *TPUIndex) EncodePQ(vectors []float32) ([]byte, error)

func (*TPUIndex) GetDeviceInfo

func (i *TPUIndex) GetDeviceInfo() (*types.GPUInfo, error)

func (*TPUIndex) GetMemoryInfo

func (i *TPUIndex) GetMemoryInfo() (total, free, used int64, err error)

func (*TPUIndex) GetUtilization

func (i *TPUIndex) GetUtilization() (float32, error)

func (*TPUIndex) GraphExpand

func (i *TPUIndex) GraphExpand(seeds []uint32, depth int, alpha float32) ([]uint32, []float32, error)

func (*TPUIndex) HaversineSearch

func (i *TPUIndex) HaversineSearch(centerLat, centerLon float32, points []float32, earthRadius float32) ([]float32, error)

func (*TPUIndex) NormBatch

func (i *TPUIndex) NormBatch(vectors []float32, dims int) ([]float32, error)

func (*TPUIndex) PruneNeighbors

func (i *TPUIndex) PruneNeighbors(candidateIds []uint32, candidateDists []float32, maxNeighbors int, allVectors []float32) ([]uint32, error)

func (*TPUIndex) Reset

func (i *TPUIndex) Reset() error

func (*TPUIndex) Search

func (i *TPUIndex) Search(vector []float32, k int) ([]int64, []float32, error)

func (*TPUIndex) SearchBatch

func (i *TPUIndex) SearchBatch(vectors [][]float32, k int) ([][]int64, [][]float32, error)

func (*TPUIndex) SearchBatchDistances

func (i *TPUIndex) SearchBatchDistances(query []float32, candidateIDs []uint32) ([]float32, error)

func (*TPUIndex) SearchComplex64

func (i *TPUIndex) SearchComplex64(vector []uint16, k int) ([]int64, []float32, error)

func (*TPUIndex) SearchComplex128

func (i *TPUIndex) SearchComplex128(vector []float32, k int) ([]int64, []float32, error)

func (*TPUIndex) SearchFloat16

func (i *TPUIndex) SearchFloat16(vector []uint16, k int) ([]int64, []float32, error)

func (*TPUIndex) SearchGreedy

func (i *TPUIndex) SearchGreedy(query []float32, entryPoint uint32, entryDist float32) (uint32, float32, error)

func (*TPUIndex) SearchInt8

func (i *TPUIndex) SearchInt8(vector []int8, k int) ([]int64, []float32, error)

func (*TPUIndex) SearchInt16

func (i *TPUIndex) SearchInt16(vector []int16, k int) ([]int64, []float32, error)

func (*TPUIndex) SearchPQ

func (i *TPUIndex) SearchPQ(lookupTable []float32, m int, k int) ([]int64, []float32, error)

func (*TPUIndex) SearchTurboQuant

func (i *TPUIndex) SearchTurboQuant(vector []float32, k int, bitsPerAngle int) ([]int64, []float32, error)

func (*TPUIndex) SearchUint8

func (i *TPUIndex) SearchUint8(vector []uint8, k int) ([]int64, []float32, error)

func (*TPUIndex) SearchUint16

func (i *TPUIndex) SearchUint16(vector []uint16, k int) ([]int64, []float32, error)

func (*TPUIndex) Sync

func (i *TPUIndex) Sync() error

func (*TPUIndex) TrainPQ

func (i *TPUIndex) TrainPQ(vectors []float32, m int, k int) error

func (*TPUIndex) UpdateGraph

func (i *TPUIndex) UpdateGraph(offsets []uint32, neighbors []uint32, weights []float32) error

type VMEMManager

type VMEMManager struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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