Skip to main content

Python class

KernelLibrary

KernelLibrary

class max.graph.KernelLibrary(context, paths=[])

Parameters:

  • context (mlir.Context )
  • paths (list [ Path ] )

add_path()

add_path(path)

Parameters:

path (Path )

library_paths()

library_paths()

Return type:

list[Path]

load_paths()

load_paths(context, custom_extensions)

Load the custom operations from provided library paths.

Performs additional “smart” library loading logic for custom operation libraries in additional formats. The loading logic supports the following formats:

  • Compiled Mojo binary packages with .mojopkg extension
  • Mojo source directory with custom operations

The loaded libraries are added to the current kernel library.

Parameters:

  • context (Context ) – The MLIR context for loading MLIR operations
  • custom_extensions (Iterable [ Path ] ) – File paths to the custom operation libraries

verify_custom_op()

verify_custom_op(custom_op)

Parameters:

custom_op (Operation )