Class AttentionBackends
java.lang.Object
smile.llm.attention.AttentionBackends
Process-wide attention backend selector (installed at chat-service startup).
-
Method Summary
Modifier and TypeMethodDescriptionstatic AttentionBackendcurrent()Returns the currently installed backend.static booleanReports whether FlashInfer support is present in the native library.static voidinstall(AttentionBackend selected) Installs the attention backend for this process.static AttentionKernelkernel()Returns the kernel forcurrent().
-
Method Details
-
install
Installs the attention backend for this process.When
AttentionBackend.FLASHINFERis requested but the native library lacks FlashInfer support, falls back toAttentionBackend.TORCH_NATIVEand logs a warning.- Parameters:
selected- backend from config.
-
current
Returns the currently installed backend.- Returns:
- currently installed backend.
-
kernel
-
flashInferAvailable
public static boolean flashInferAvailable()Reports whether FlashInfer support is present in the native library.- Returns:
truewhen FlashInfer was compiled intolibsmile_torch.
-