Skip to content

Conversation

PawelSwider2000
Copy link

Implementation of kernels for complex datatype support for 4 ops: mm, bmm,addmm, baddbmm using OneMKL.

Current implementation of this ops for XPU is in pytorch/aten/src/ATen/native/mkldnn/xpu/Blas.cpp. Since OneMKL is a torch-xpu-ops dependency and is available only with USE_ONEMKL_XPU=ON (which is a default value). Implementation needs to be in torch-ops-xpu and kernels and TORCH_LIBRARY_IMPL are in ifdef macro to avoid complication error when OneMKL is not supported. Newly declared op will be called from existing torch implementation using c10::Dispatcher.

This is part of: #1853

@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 11:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements OneMKL-based kernels for complex datatype support in matrix multiplication operations (mm, bmm, addmm, baddbmm) on XPU devices. The implementation provides optimized BLAS operations for complex numbers using OneMKL library integration.

Key changes include:

  • Addition of OneMKL-based complex matrix multiplication kernels
  • Implementation of four core matrix operations with complex number support
  • Conditional compilation support for OneMKL availability

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@PawelSwider2000
Copy link
Author

@CuiYifeng @kbinias Please review

@PawelSwider2000
Copy link
Author

Follow up change with tests: #1993

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants