8000 MAINT: Enable building tanh on vector length agnostic architectures by abhishek-iitmadras · Pull Request #28294 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Enable building tanh on vector length agnostic architectures #28294

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

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

abhishek-iitmadras
Copy link
Contributor

This PR enables compilation when building NumPy's tanh implementation on vector length agnostic architecture.

Changes Made:

  • Fixed non-constexpr Lanes() usage in if-constexpr conditions by using MaxLanes()
  • Removed vector length agnostic -incompatible array storage of vector types
  • Replaced array-based struct approach with direct output parameters for vector interleaving
  • Modified temporary storage to use individual variables instead of arrays

The changes ensure proper compilation while maintaining the same functionality and optimizations for both fixed-width SIMD and scalable vector architectures.

@abhishek-iitmadras
Copy link
Contributor Author

For more detail issue, please have a look into https://github.com/numpy/numpy/actions/runs/13188758586/job/36817109169?pr=28263

@ngoldbaum
Copy link
Member

ping @Mousius

Copy link
Member
@r-devulap r-devulap left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @abhishek-iitmadras. Will wait a bit for @Mousius's review before merging.

@charris charris changed the title Enable numpy/_core/src/umath/loops_hyperbolic.dispatch.cpp.src for vector length agnostic architecture ENH: Enable building tanh on vector length agnostic architectures Feb 9, 2025
@charris charris changed the title ENH: Enable building tanh on vector length agnostic architectures MAINT: Enable building tanh on vector length agnostic architectures Feb 9, 2025
@abhishek-iitmadras
Copy link
Contributor Author

@Mousius
Please help with review and merge

@r-devulap
Copy link
Member

Thanks @abhishek-iitmadras . @Mousius's feedback can be incorporated whenever he gets to it.

@r-devulap r-devulap merged commit 74f6905 into numpy:main Feb 13, 2025
69 checks passed
@Mousius
Copy link
Member
Mousius commented Feb 17, 2025

Apologies I was out on leave 😸 I think this looks fine, but it would be good for it to be tested by some target. Does this improve the performance on any platform @abhishek-iitmadras ?

@abhishek-iitmadras
Copy link
Contributor Author
abhishek-iitmadras commented Feb 17, 2025

Apologies I was out on leave 😸 I think this looks fine, but it would be good for it to be tested by some target. Does this improve the performance on any platform @abhishek-iitmadras ?

Thanks @Mousius

Adding aarch64 CI that help to test these targets: #28263

Regarding Performance: Will share

@abhishek-iitmadras abhishek-iitmadras deleted the abhishek_sve_tanh branch March 12, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0