Summary
I'd like to propose adding runtime device support for Cambricon MLU accelerators to the kernels Python package. This would follow the same pattern as PR #155 (NPU) and PR #285 (Neuron), enabling the kernels library to recognize, route, and load kernels targeting MLU hardware.
Motivation
Cambricon MLU is a custom AI accelerator used in several production environments. Currently, attempting to use kernelize() with an MLU device raises: ValueError: Unknown device type: mlu. This prevents MLU users from participating in the kernel hub ecosystem, even when using MLU-compatible kernels registered via register_kernel_mapping().
Proposed scope
Runtime support only — this PR would not touch kernel-builder or nix-builder. Specifically:
kernels/ Python package: _MLURepos class, MLU backend detection via torch.mlu.device_count(), device validation, benchmark CLI support
kernels-data/ Rust library: Backend::Mlu variant across all config versions (v1–v5) and Python bindings (Backend.MLU)
- Tests:
mlu_only pytest marker, test_hub_forward_mlu() (with fallback allowance since no MLU kernels exist in kernels-community yet)
- Documentation: update
nix-builder/README.md hardware support table (Tier 3, same as NPU/Neuron)
References
Looking forward to your feedback!
Summary
I'd like to propose adding runtime device support for Cambricon MLU accelerators to the
kernelsPython package. This would follow the same pattern as PR #155 (NPU) and PR #285 (Neuron), enabling thekernelslibrary to recognize, route, and load kernels targeting MLU hardware.Motivation
Cambricon MLU is a custom AI accelerator used in several production environments. Currently, attempting to use
kernelize()with an MLU device raises:ValueError: Unknown device type: mlu. This prevents MLU users from participating in the kernel hub ecosystem, even when using MLU-compatible kernels registered viaregister_kernel_mapping().Proposed scope
Runtime support only — this PR would not touch kernel-builder or nix-builder. Specifically:
kernels/Python package:_MLUReposclass, MLU backend detection viatorch.mlu.device_count(), device validation, benchmark CLI supportkernels-data/Rust library:Backend::Mluvariant across all config versions (v1–v5) and Python bindings (Backend.MLU)mlu_onlypytest marker,test_hub_forward_mlu()(with fallback allowance since no MLU kernels exist in kernels-community yet)nix-builder/README.mdhardware support table (Tier 3, same as NPU/Neuron)References
kernels: add support for Neuron and NKI #285 (Neuron)Looking forward to your feedback!