Software-emulation & acceleration triton kernels for MASE.
Please ensure you are using Python 3.11 or later, and run MASE-Triton on CUDA-enabled GPU.
pip install mase-triton-
Install uv
-
Build the package
uv build
The wheel file can be found in
dist/folder. You can install it bypip install path/to/wheel/file.whl
- Random Bitflip
functional APIs: random bitflip function with backward support.layers.py: subclasses oftorch.nn.Modulethat can be used in neural networks.RandomBitflipDropoutRandomBitflipLinear
- Optical Transformer
functional APIs: optical transformer function with backward support.ot_quantizeot_linearot_matmul
layers.py: subclasses oftorch.nn.Modulethat can be used in neural networks.OpticalTransformerLinear
- MXFP: Simulate MXFP formats on CPU & GPU using PyTorch & Triton.
functionalextract_mxfp_tensor: Cast a tensor to MXFP format (extracting the shared exponent and Minifloat elements).compose_mxfp_tensor: Cast an MXFP tensor to FP format (composing MXFP components).mxfp_linear: functional linear operation with MXFP support.mxfp_matmul: functional matrix multiplication with MXFP support.
layersMXFPLinearPTQ: Linear layer with MXFP support for post-training quantization (no back propagation support).
- Minifloat: Simulate minifloat formats on CPU & GPU using PyTorch & Triton.
functionalextract_minifloat_component: Extract minifloat components from a tensor.compose_minifloat_component: Compose minifloat components back to a tensor.quantize_dequantize: Quantize and dequantize tensors using minifloat format.minifloat_linear: functional linear operation with minifloat support.minifloat_matmul: functional matrix multiplication with minifloat support.
layersMinifloatLinearPTQ: Linear layer with minifloat support for post-training quantization (no back propagation support).
-
Install uv
-
Install dependencies for development
uv sync