ncclll

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 17 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

Code generated by gen-nccl-extensions. DO NOT EDIT.

Package ncclll provides Go bindings for the NCCL low-latency buffer host API.

This API is not in any released NCCL. It is an unmerged contribution carried by the fork named in headers/README.md, where the implementation compiles into libnccl rather than a library of its own. A stock libnccl loads and exports none of these symbols, so gate every call on the matching Has predicate.

Data types, result codes, and streams use the types in github.com/tmc/lib/nvidia/nccl.

Only the host side is bound. The device-side ncclLLBuffer template takes its synchronization mode as a template parameter and is compiled into a CUDA kernel; it has no ABI symbol and cannot be called through a dynamic loader.

Of the three synchronization modes the enum declares, LL128 is unimplemented in the fork. Only LL and Poison carry working device-side support.

The buffers these functions describe and poison are device memory owned by the caller. PoisonBufferAsync writes on the given stream and does not synchronize.

Sizing

Poisoning

Code generated by gen-nccl-extensions. DO NOT EDIT.

Code generated by gen-nccl-extensions. DO NOT EDIT.

Code generated by gen-nccl-extensions. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcMinReductionBufferSize

func CalcMinReductionBufferSize(mode LLSyncMode, nElts int32, eltSize int32, nRanks int32, nBlocks int32, roundRobinFactor int32) (uint, error)

CalcMinReductionBufferSize wraps ncclCalcMinReductionBufferSize. The error reports an unavailable library or symbol.

func Close

func Close() error

Close unloads the library and clears all bound function pointers.

The function pointers are package-level state, so Close must not be called concurrently with any other call into this package: doing so is a use-after-free. It is intended for test teardown, not for reclaiming a live library.

func Has

func Has(symbol string) bool

Has reports whether the named C symbol resolved in the loaded library, loading it first if necessary. It returns false if the library failed to load. Use it to gate on capabilities before calling into them.

func HasCalcMinReductionBufferSize

func HasCalcMinReductionBufferSize() bool

HasCalcMinReductionBufferSize reports whether ncclCalcMinReductionBufferSize resolved in the loaded library.

func HasLLGetPoisonValue

func HasLLGetPoisonValue() bool

HasLLGetPoisonValue reports whether ncclLLGetPoisonValue resolved in the loaded library.

func HasLLPoisonBuffer

func HasLLPoisonBuffer() bool

HasLLPoisonBuffer reports whether ncclLLPoisonBuffer resolved in the loaded library.

func HasLLPoisonBufferAsync

func HasLLPoisonBufferAsync() bool

HasLLPoisonBufferAsync reports whether ncclLLPoisonBufferAsync resolved in the loaded library.

func LLGetPoisonValue

func LLGetPoisonValue(dtype nccl.DataType) (uint32, error)

LLGetPoisonValue wraps ncclLLGetPoisonValue. The error reports an unavailable library or symbol.

func LLPoisonBuffer

func LLPoisonBuffer(buffer uintptr, sizeBytes uint, dtype nccl.DataType) error

LLPoisonBuffer wraps ncclLLPoisonBuffer.

func LLPoisonBufferAsync

func LLPoisonBufferAsync(buffer uintptr, sizeBytes uint, dtype nccl.DataType, stream driver.Stream) error

LLPoisonBufferAsync wraps ncclLLPoisonBufferAsync.

func Load

func Load(path string) error

Load opens the shared library from path, or from the default search list when path is empty, and binds all symbols. Callers that need to direct loading should call Load before any other function; otherwise the first call loads from the default search list.

Load is idempotent: calling it again with the same path, or with an empty path, returns nil. Calling it with a different path after a successful load returns *LibraryConflictError rather than replacing the library. After a failed load, Load retries.

func Loaded

func Loaded() bool

Loaded reports whether the library is currently loaded. It does not trigger a load.

func Path

func Path() string

Path returns the path or name the loaded library was opened from, or the empty string if no library is loaded.

Types

type BindFailure

type BindFailure struct {
	Symbol string
	Err    error
}

BindFailure names a symbol the loaded library exports but that could not be bound, and why.

func BindFailures

func BindFailures() []BindFailure

BindFailures returns the symbols the loaded library exports that could not be bound, sorted by symbol name, or nil if every exported symbol bound. Calling one of these reports *SymbolError with the same Err.

A load that reports no error can still leave symbols unbound: the library is fine and the signatures are not representable here. Call this after Load to find that out at once rather than one call site at a time. It does not trigger a load, and returns nil if none has happened.

type CallError

type CallError = nccl.CallError

CallError is the error a failed call returns. It is NCCL's, so errors.As matches it whichever package made the call.

type LLSyncMode

type LLSyncMode int32

LLSyncMode represents ncclLLSyncMode_t.

const (
	LL     LLSyncMode = 0 // 8+8 flag format (8 bytes data, 8 bytes flags)
	LL128  LLSyncMode = 1 // 120+8 flag format (NOT YET IMPLEMENTED)
	Poison LLSyncMode = 2 // Poison-based synchronization
)

func (LLSyncMode) String

func (e LLSyncMode) String() string

String returns the constant name, or a numeric representation for unknown values.

type LibraryAttempt

type LibraryAttempt struct {
	Name string // path or soname passed to dlopen
	Err  error
}

LibraryAttempt records one failed attempt to open the shared library.

type LibraryConflictError

type LibraryConflictError struct {
	Loaded    string
	Requested string

	// Implicit reports that the loaded library was opened lazily and no
	// successful Load has since acknowledged it. A
	// caller that sees this called some
	// other function first, and that call took the default search list.
	Implicit bool
}

LibraryConflictError reports a Load call naming a different library than the one already loaded. Only one library is loaded per process.

func (*LibraryConflictError) Error

func (e *LibraryConflictError) Error() string

Error reports the conflicting library paths, and whether the library that is already loaded got there without a Load call.

type LibraryError

type LibraryError struct {
	Library  string
	Env      string
	Path     string
	Attempts []LibraryAttempt
	Hint     string
}

LibraryError reports that libnccl could not be opened. Attempts lists every name tried in order. Path is set when an explicit path, from Load or NCCL_LIB_PATH, was requested and failed. Hint reports pkg-config discovery results and query failures, when discovery ran.

func (*LibraryError) Error

func (e *LibraryError) Error() string

Error describes the library load attempts and their errors.

func (*LibraryError) Unwrap

func (e *LibraryError) Unwrap() []error

Unwrap returns the error from each attempt.

type Result

type Result = nccl.Result

Result is the NCCL result code shared by this extension and NCCL.

type SymbolError

type SymbolError struct {
	Symbol string
	Err    error
}

SymbolError reports that a symbol is not callable.

Err distinguishes the two ways that happens. A nil Err means the loaded library does not export the symbol, which is what an installation older than the symbol looks like. A non-nil Err means the library does export it and the binding itself failed; the library is not at fault.

func (*SymbolError) Error

func (e *SymbolError) Error() string

Error reports the uncallable library symbol and, when the symbol was present but could not be bound, why.

func (*SymbolError) Unwrap

func (e *SymbolError) Unwrap() error

Unwrap returns the reason the symbol could not be bound, or nil when the loaded library does not export it.

Jump to

Keyboard shortcuts

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