Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: Extending CPU feature detection framework to support IBM Z SIMD #20552

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 8 commits into from
Dec 14, 2021

Conversation

pradghos
Copy link
Contributor

@pradghos pradghos commented Dec 9, 2021

We would like to extend CPU feature detection infrastructure for IBM Z CPU features.
Eventually It will help to add and enable Z specific SIMD builtins and instructions.

As part of the PR, we have extended ccompiler_opt.py, npy_cpu_features.c.src,
npy_cpu_features.h, other files for Z CPU feature detection and added test files for
VX/VXE/VXE2 in distutils/checks.

cc @edelsohn @Andreas-Krebbel @potula-chandra @ajaypvictor

@edelsohn
Copy link

edelsohn commented Dec 9, 2021

@seiko2plus Sayed, what's your progress?

@seiko2plus seiko2plus added component: numpy.distutils component: SIMD Issues in SIMD (fast instruction sets) code or machinery labels Dec 11, 2021
Copy link
Member

@seiko2plus seiko2plus left a comment

Choose a reason for hiding this comment

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

Hello @pradghos, along with the following suggestions we still need to add to test runtime detection similar to:

is_power = re.match("^(powerpc|ppc)64", machine, re.IGNORECASE)
@pytest.mark.skipif(not is_linux or not is_power, reason="Only for Linux and Power")
class Test_POWER_Features(AbstractTest):
features = ["VSX", "VSX2", "VSX3"]
features_map = dict(VSX2="ARCH_2_07", VSX3="ARCH_3_00")
def load_flags(self):
self.load_flags_auxv()
.

@seiko2plus
Copy link
Member

@edelsohn,

@seiko2plus Sayed, what's your progress?

we have several SIMD kernels now written by universal intrinsics, and more coming. I was working on s390x implementation but I pause it in favor of replacing/implementing more kernels to universal intrinsics first.

@pradghos
Copy link
Contributor Author

Hi @seiko2plus, I have incorporated the review comments now, Thank you very much for the review !

pradghos and others added 7 commits December 14, 2021 03:49
We would like to extend CPU feature detection infrastructure
for IBM Z CPU features. Eventually It will help to add and
enable Z specific SIMD builtins and instructions.
As part of the PR, we have extended ccompiler_opt.py,
npy_cpu_features.c.src, npy_cpu_features.h, other files for
Z CPU feature detection and added test files for VX/VXE/VXE2
in distutils/checks.
Copy link
Member

@seiko2plus seiko2plus left a comment

Choose a reason for hiding this comment

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

Thank you Pradipta, I have updated the document of build options, and added extra tests for s390x to guarantee that IBM Z features don't get affected by future changes to our infrastructure.

@mattip mattip merged commit 8111d51 into numpy:main Dec 14, 2021
@mattip
Copy link
Member

mattip commented Dec 14, 2021

Thanks @pradghos, @seiko2plus

@potula-chandra
Copy link

Excellent thank you @pradghos, @seiko2plus and @mattip

x86_gcc="-msse -msse2", x86_icc="-msse -msse2",
x86_iccw="/arch:SSE2",
x86_msvc="/arch:SSE2" if self.march() == "x86" else "",
ppc64_gcc= "-mcpu=power8",
ppc64_clang="-maltivec -mvsx -mpower8-vector",
armhf_gcc="-mfpu=neon-fp16 -mfp16-format=ieee",
aarch64=""
aarch64="",
s390="-mzvector -march=arch12"
Copy link
Member

Choose a reason for hiding this comment

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

what a typo see #20588

@InessaPawson
Copy link
Member

Hi-five on merging your first pull request to NumPy, @pradghos! We hope you stick around! Your choices aren’t limited to programming – you can review pull requests, help us stay on top of new and old issues, develop educational material, work on our website, add or improve graphic design, create marketing materials, translate website content, write grant proposals, and help with other fundraising initiatives. For more info, check out: https://numpy.org/contribute/.
Also, consider joining our mailing list. This is a great way to connect with other cool people in our community and be part of important conversations that affect the development of NumPy: https://mail.python.org/mailman/listinfo/numpy-discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 - Enhancement component: numpy.distutils component: SIMD Issues in SIMD (fast instruction sets) code or machinery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants