Skip to content

Comprehensive Tensor Class Overhaul and Library Downloader - #32

Merged
CodeWithKyrian merged 18 commits into
0.4.0-devfrom
bump-math-matrix
May 11, 2024
Merged

CodeWithKyrian merged 18 commits into
0.4.0-devfrom
bump-math-matrix

Conversation

@CodeWithKyrian

Copy link
Copy Markdown
Owner

Description:

This PR represents a significant overhaul of the Tensor class within the project, introducing several optimizations and new features to enhance performance and functionality. Additionally, it introduces a new library downloader package to streamline the installation process for required shared libraries.

What's New:

  • Overhaul Tensor Buffer Implementation: The Tensor class has been revamped to utilize OpenBlas and FFI, resulting in improved performance and efficiency.
  • New Tensor Methods: Several new methods, including topk, divide, and slice, have been added to the Tensor class, along with corresponding changes to existing implementations to leverage these methods.
  • Refactor Stack Method: The stack method in the Tensor class has been refactored for enhanced performance.
  • Allow Normal PHP Buffer with Inference Session: Updates have been made to allow the Tensor class to work seamlessly with the InferenceSession, enabling easier integration with other components.
  • Move Thumbnail Method: The thumbnail method has been relocated from the feature extractor to the Image class for improved organization.
  • Code Cleanup and Style Review: The codebase has undergone cleanup and style review to ensure consistency and readability.
  • Optimize Image and Tensor Conversion: Efforts have been made to optimize the speed of conversion between Image and Tensor objects, enhancing overall performance.
  • Standardize Image Driver Setting: The setting of the image driver has been standardized for consistency across the project.
  • Custom FFI Integration: A custom FFI has been implemented, facilitating easier conversion of Tensor objects to ONNX Tensors by simplifying memory copying.
  • Add Proper Types for InferenceSession: Proper types have been introduced for the InferenceSession class to improve code clarity and maintainability.
  • Introduce Libraries Downloader Package: A new library downloader package has been introduced to automate the downloading of required shared libraries, such as onnxruntime, openblas, and rindow-matlib, during the Composer install process.

Summary:

This PR marks a significant milestone in enhancing the performance and functionality of the Tensor class while introducing convenient tools to streamline the installation of essential dependencies. These improvements not only optimize existing operations but also pave the way for future enhancements and expanded capabilities within the project.

@CodeWithKyrian
CodeWithKyrian merged commit 0037528 into 0.4.0-dev May 11, 2024
@CodeWithKyrian
CodeWithKyrian deleted the bump-math-matrix branch May 11, 2024 23:37
@martindewawd martindewawd mentioned this pull request Mar 25, 2025
1 of 4 tasks
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.

1 participant