Miscellaneous#
Status#
- class cutlass.operators.status.Status(error: Exception | None = None)#
Bases:
objectA simple status class to wrap an optional exception.
- __bool__() bool#
Return
Trueif this represents success,Falseotherwise.Example
>>> if not (status := operator.supports(args)): ... raise status.error
- classmethod fail(
- error: str | Exception,
Create a failed status with an error.
- Parameters:
error (str | Exception) – Error string or
Exceptiondescribing the failure
- raise_on_error() None#
Raise the stored exception if this status represents a failure.
Configuration#
- class cutlass.operators.config.GlobalOptions#
Bases:
objectSingleton class that configures global options for CUTLASS Operator API.
This can be used to enable or disable certain features of the API. For example, the user can enable TVM-FFI support to allow for the use of framework-level tensors at run time.
Each option may also be initialized from an environment variable read the first time
GlobalOptions()is instantiated. Programmatic changes via the property setters always override the environment value afterwards.Supported environment variables:
CUTLASS_OPERATORS_USE_TVM_FFI–>GlobalOptions().use_tvm_ffi
Example:
GlobalOptions().use_tvm_ffi = True
- property use_tvm_ffi: bool#
Check if TVM FFI support is enabled.
Default:
Trueiftvm_ffiis installed.Can be overridden at process start by setting the
CUTLASS_OPERATORS_USE_TVM_FFIenvironment variable to a boolean value (1/0,true/false,yes/no,on/off).When enabled, conversions from DLPack compatible tensors to cute.Tensor is via TVM FFI. Additionally, invoking the compiled Operator happens via TVM FFI. Both can offer significant (3x-10x) speedups.
Dependencies:
Required:
tvm_ffi(pip install apache-tvm-ffi).Optional:
torch_c_dlpack_ext(pip install torch-c-dlpack-ext).
- save() dict#
Save the current options to a dictionary.
- restore(inp: dict) None#
Restore previously saved options from a dictionary.