Documentation
¶
Overview ¶
Package stablehlo helps build a StableHLO program (text format) to then be JIT-compiled and executed by PJRT (github.com/gomlx/gopjrt/pjrt).
Among its features:
- Translates an API to rendered (human-readable) StableHLO text. - Shape inference: it calculates the output shapes for operations. - Written purely in Go, no C/C++ external dependencies.
It was written as a replacement for `gopjrt/xlabuilder` and attempts to keep a similar or identical interface.
See StableHLO documentation and specifications in https://openxla.org/stablehlo/spec
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is used to construct a StableHLO program. See New.
func New ¶
New creates a new Builder object holding a computation graph in construction.
Add operations (ops) one by one, until you defined the desired graph, and then call the method Build, which returns a Computation. A pjrt.Client can use a Computation as input to JIT-compile and execute efficiently.
func (*Builder) Build ¶
func (b *Builder) Build(outputs ...*Op) (*Computation, error)
Build builds the Computation with the requested operations (the outputOp and all its dependencies) or returns a non-ok status.
Note that all ops that have been enqueued will be moved to the computation being returned and will no longer be valid.
type Computation ¶
Computation holds a rendered computation graph, that can be fed to PJRT. It is created with Builder.Build.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package optypes defines OpType and lists the supported operations.
|
Package optypes defines OpType and lists the supported operations. |
|
Package shapeinference calculates the shape resulting from operations, and validates its inputs.
|
Package shapeinference calculates the shape resulting from operations, and validates its inputs. |
|
Package shapes defines Shape and DType and associated tools.
|
Package shapes defines Shape and DType and associated tools. |
|
Package types is mostly a top level directory for GoMLX important types.
|
Package types is mostly a top level directory for GoMLX important types. |