Skip to main content

Crate tenferro_xla

Crate tenferro_xla 

Source
Expand description

Experimental StableHLO lowering and runtime PJRT plugin loading for tenferro.

This crate is an optional peer executor over tenferro-runtime GraphProgram values. It does not implement TensorBackend and it does not change native CPU, CUDA, or WebGPU execution.

§Examples

use tenferro_runtime::{GraphCompiler, TracedTensor};
use tenferro_xla::lower_to_stablehlo;

let x = TracedTensor::from_vec_col_major(vec![2], vec![1.0_f64, 2.0]).unwrap();
let y = (&x + &x).unwrap();
let mut compiler = GraphCompiler::new();
let program = compiler.compile(&y).unwrap();
let module = lower_to_stablehlo(&program).unwrap();
assert!(module.as_str().contains("stablehlo.add"));

Structs§

PjrtPlugin
Dynamically loaded PJRT plugin.
StableHloModule
StableHLO MLIR module text plus a deterministic fingerprint.
StableHloModuleFingerprint
SHA-256 fingerprint of StableHLO module text.
XlaExecutor
Experimental peer executor for XLA/PJRT.
XlaExecutorOptions
Options for the experimental XLA executor.

Enums§

Error
Error type for StableHLO lowering and runtime PJRT plugin loading.

Constants§

TENFERRO_PJRT_GPU_PLUGIN_ENV
Environment variable used for a GPU-specific PJRT plugin path.
TENFERRO_PJRT_PLUGIN_ENV
Environment variable used for the default PJRT plugin path.

Functions§

lower_to_stablehlo
Lower a static-shaped graph program to StableHLO MLIR text.

Type Aliases§

Result
Result alias for tenferro-xla.