Documentation
¶
Overview ¶
Package jaccl implements RDMA collective communication in Go.
It uses the Apple RDMA bindings directly. It does not call libjaccl or use cgo. The initial implementation targets Apple Thunderbolt RDMA on darwin/ arm64; unsupported platforms return ErrUnsupported.
Index ¶
- Constants
- Variables
- func Available() bool
- type Config
- type DType
- type Group
- func (g *Group) AllGather(ctx context.Context, dst, src []byte) error
- func (g *Group) AllMax(ctx context.Context, dst, src []byte, dtype DType) error
- func (g *Group) AllMin(ctx context.Context, dst, src []byte, dtype DType) error
- func (g *Group) AllReduce(ctx context.Context, dst, src []byte, dtype DType, op ReduceOp) error
- func (g *Group) AllSum(ctx context.Context, dst, src []byte, dtype DType) error
- func (g *Group) Barrier(ctx context.Context) error
- func (g *Group) Close() error
- func (g *Group) Rank() int
- func (g *Group) Recv(ctx context.Context, src int, dst []byte) error
- func (g *Group) RegisterBuffer(buf []byte) error
- func (g *Group) Send(ctx context.Context, dst int, src []byte) error
- func (g *Group) Size() int
- func (g *Group) UnregisterBuffer(buf []byte) error
- type ReduceOp
- type Topology
Constants ¶
const Uint8 = UInt8
Uint8 is kept as the spelling used by the first Go API.
Variables ¶
var ( // ErrUnsupported reports that the local platform or RDMA provider is not supported. ErrUnsupported = errors.New("jaccl: unsupported") // ErrInvalidConfig reports an invalid group configuration. ErrInvalidConfig = errors.New("jaccl: invalid config") // ErrProtocol reports an invalid or mismatched peer protocol message. ErrProtocol = errors.New("jaccl: protocol error") // ErrClosed reports use of a closing or closed group. ErrClosed = errors.New("jaccl: group closed") // ErrPoisoned reports a group made unsafe by a transport failure. ErrPoisoned = errors.New("jaccl: group poisoned") )
Functions ¶
Types ¶
type Config ¶
type Config struct {
Rank int
Size int
GroupID string
Coordinator string
Device string
// Devices is the upstream JACCL directed connectivity matrix. Each cell
// names zero or more RDMA devices for one source-to-destination link.
Devices [][][]string
// PreferRing asks ConfigFromEnv to choose a valid ring before a mesh.
PreferRing bool
Port uint8
Topology Topology
}
Config describes one rank in a group.
func ConfigFromEnv ¶
ConfigFromEnv reads the standalone JACCL configuration variables. It accepts JACCL_* names first, then the MLX_* aliases used by the upstream library.
The returned Config retains the full device matrix for parity tooling. The native backend uses the matrix during setup: a mesh selects its first directed device and a ring retains each directed wire.
type DType ¶
type DType uint8
DType is an element representation used by AllReduce. Its values match the standalone JACCL Dtype enum so an external parity fixture can use the same type table in both implementations.
const ( // Bool is a boolean element. Bool DType = iota // Int8 is a signed 8-bit integer element. Int8 // Int16 is a signed 16-bit integer element. Int16 // Int32 is a signed 32-bit integer element. Int32 // Int64 is a signed 64-bit integer element. Int64 // UInt8 is an unsigned 8-bit integer element. UInt8 // UInt16 is an unsigned 16-bit integer element. UInt16 // UInt32 is an unsigned 32-bit integer element. UInt32 // UInt64 is an unsigned 64-bit integer element. UInt64 // Float16 is an IEEE 754 binary16 element. Float16 // BFloat16 is a bfloat16 element. BFloat16 // Float32 is an IEEE 754 binary32 element. Float32 // Float64 is an IEEE 754 binary64 element. Float64 // Complex64 is a pair of IEEE 754 binary32 values. Complex64 )
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is a live RDMA communicator.
func OpenEnv ¶
OpenEnv reads a standalone JACCL-compatible environment configuration and opens the resulting group.
func (*Group) RegisterBuffer ¶
RegisterBuffer pre-registers a page-aligned buffer (e.g. mmap or Metal unified-memory slab) across all RDMA links in the group so subsequent collectives can use zero-copy direct MRs without hot-path ibv_reg_mr skew. Apple's RDMA provider registers only memory below 1 TiB, so a buffer from the Go heap cannot be registered; collectives on it use staging copies. Shared Metal buffers (macOS 27.2) land below 1 TiB and register. Buffers smaller than 64 KiB, or whose start or length is not a multiple of the page size, are not registered and RegisterBuffer returns nil. Callers should synchronize peers (e.g. Barrier) after registration and call UnregisterBuffer before freeing or unmapping buf.
func (*Group) UnregisterBuffer ¶
UnregisterBuffer deregisters a buffer previously registered with RegisterBuffer.
type Topology ¶
Topology reports the directly connected peers for a rank.
Peers must return no duplicate, self, or out-of-range ranks. Open validates both the local report and reciprocal reports exchanged with peers.
Source Files
¶
- available_unsupported.go
- cleanup.go
- config.go
- connectivity.go
- credit.go
- destination_exchange.go
- doc.go
- env.go
- errors.go
- group.go
- meshreduce.go
- mr_cache.go
- open_unsupported.go
- operation.go
- overlap.go
- protocol.go
- ready.go
- reduce.go
- reduce_kernels_default.go
- rendezvous.go
- ring.go
- ring_reduce.go
- slots.go
- slots_pipeline.go
- types.go
- wire_spans_other.go
- workid.go