Skip to content

Enable _linalg_det, _linalg_slogdet and _linalg_solve_ex related operations on xpu #1660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

huiyan2021
Copy link
Contributor

@huiyan2021 huiyan2021 commented May 14, 2025

This pull request stacks on #1563. It introduces support for _linalg_det, _linalg_slogdet and _linalg_solve_ex related operations on XPU devices:

  • _linalg_det & _linalg_det.result
  • _linalg_slogdet & _linalg_slogdet.sign
  • '_linalg_solve_ex' & _linalg_solve_ex.result

It also removes fallback implementations for these operations in favor of optimized XPU-specific implementations. Corresponding tests have been updated to reflect the new support.

New XPU Kernel Implementations:

Since _linalg_det, _linalg_slogdet and _linalg_solve_ex call linalg_lu_factor_ex.out underneath, which has been implemented in #1563, no new kernels need to be added in this pull request. Only dispatching these operations in third_party/torch-xpu-ops/yaml/native/native_functions.yaml would work.

Removal of Fallbacks:

Removed fallback entries for _linalg_det, _linalg_slogdet and _linalg_solve_ex related operations from third_party/torch-xpu-ops/src/ATen/native/xpu/XPUFallback.template. These operations now have dedicated XPU implementations.

Test Adjustments:

Updated the skip list in test/xpu/skip_list_common.py to remove passed and removed linalg_det, linalg_slogdet and _linalg_solve_ex related UTs.

Fix #1597

@huiyan2021 huiyan2021 requested a review from Copilot May 14, 2025 09: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 pull request introduces optimized XPU-specific support for determinant and sign/log-determinant operations by dispatching to dedicated XPU kernels and removing fallbacks. It also updates the test suite and skip lists accordingly to reflect the new support.

  • Added YAML entries for _linalg_det and _linalg_slogdet with structured delegates and XPU-specific dispatch.
  • Updated test files to include new LU-family and LU-solve tests while removing obsolete fallback tests.
  • Removed fallback implementations and adjusted skip lists in test files.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yaml/native/native_functions.yaml Added structured function entries for _linalg_det and _linalg_slogdet with XPU dispatch support.
test/xpu/test_linalg_xpu.py Introduced new tests for LU-family and LU-solve operations; refactored imports and test registration.
test/xpu/skip_list_common.py Removed skip tests related to linalg_det and linalg_slogdet operations.
src/ATen/native/xpu/mkl/BatchLinearAlgebra.h Defined new MKL-based linear algebra function prototypes for XPU.
src/ATen/native/xpu/BatchLinearAlgebra.cpp Added XPU kernel implementations for SVD, LU solve, and LU factor with CPU fallback support.
Files not reviewed (1)
  • src/ATen/native/xpu/XPUFallback.template: Language not supported

@huiyan2021 huiyan2021 requested review from CuiYifeng and xytintel May 14, 2025 09:05
@huiyan2021 huiyan2021 changed the title Enable _linalg_det and _linalg_slogdet related operations on xpu Enable _linalg_det, _linalg_slogdet and _linalg_solve_ex related operations on xpu May 22, 2025
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.

Implement aten::_linalg_solve_ex.result on xpu
3 participants