Class Nvfp4Linear
java.lang.Object
smile.llm.quant.Nvfp4Linear
- All Implemented Interfaces:
AutoCloseable, LinearOp
NVFP4 weight-only linear for Blackwell (sm_100+).
Wraps LibTorch / cuBLASLt NVFP4 GEMM when available. Until the linked
LibTorch exposes a stable NVFP4 scaled-mm entry point, forward(Tensor)
throws a clear error (no Marlin fallback on Blackwell).
-
Constructor Summary
ConstructorsConstructorDescriptionNvfp4Linear(Tensor weight, Tensor weightScale, Tensor bias) Creates an NVFP4 weight-only linear layer. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Applies the linear transformation.intReturns the input feature count.intReturns the output feature count.
-
Constructor Details
-
Nvfp4Linear
-
-
Method Details
-
inFeatures
public int inFeatures()Returns the input feature count.- Returns:
- input features.
-
outFeatures
public int outFeatures()Returns the output feature count.- Returns:
- output features.
-
forward
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-