Skip to content

Add support for MLU kernelize #701

Description

@atri2549

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions