Skip to content

Conversation

@HydrogenSulfate
Copy link
Collaborator

This pull request adds support for the MAGMA linear algebra library to the Iluvatar GPU backend in PaddlePaddle, enabling efficient computation of eigenvalues and eigenvectors via a new eig kernel. It introduces MAGMA as a dependency, integrates its usage into the build system, implements the CUDA eig kernel leveraging MAGMA, and provides comprehensive unit tests for the new functionality. Additionally, it enhances the runtime context to support solver handles required for MAGMA operations.

MAGMA integration and eig kernel implementation:

  • Added a new CMake module external/magma.cmake to download, verify, and integrate the MAGMA library as a third-party dependency for Linux platforms. This includes logic for handling downloads, MD5 verification, and linking the shared library. (backends/iluvatar_gpu/cmake/external/magma.cmake)
  • Updated backends/iluvatar_gpu/CMakeLists.txt to include MAGMA in the build process, add its source and dynload files, and link the MAGMA library to the backend target. (backends/iluvatar_gpu/CMakeLists.txt) [1] [2] [3]
  • Implemented a new CUDA eig kernel for the Iluvatar GPU backend that utilizes MAGMA for eigenvalue and eigenvector computation, including handling for real and complex input types and device-to-host data transfers. (backends/iluvatar_gpu/kernels/cuda_kernels/eig_kernel.cu)

Runtime context enhancements:

  • Extended the runtime context to manage a global solver handle (cusolverDnHandle_t), including thread-safe initialization and retrieval functions, to support MAGMA operations. (backends/iluvatar_gpu/runtime/iluvatar_context.h) [1] [2]

Testing and validation:

  • Added a comprehensive unit test suite for the new eig kernel, covering static and dynamic graph modes, gradient checks, error handling for invalid inputs, and validation against NumPy results. (backends/iluvatar_gpu/tests/unittests/test_eig_op_iluvatar.py)

Submodule update:

  • Updated the Paddle submodule pointer to a newer commit, likely to synchronize with dependencies required for MAGMA integration. (Paddle)

@paddle-bot
Copy link

paddle-bot bot commented Dec 24, 2025

Thanks for your contribution!

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.

2 participants