Skip to content

Port Sleef to AIX#629

Merged
shibatch merged 1 commit intoshibatch:masterfrom
KamathForAIX:gh_628
Feb 14, 2025
Merged

Port Sleef to AIX#629
shibatch merged 1 commit intoshibatch:masterfrom
KamathForAIX:gh_628

Conversation

@KamathForAIX
Copy link
Copy Markdown
Contributor

Closes #628.

@shibatch
Copy link
Copy Markdown
Owner

The cross-compilation test is not passing.
Could you take a look at it a little bit?

https://shibatch.dns-cloud.net/jenkins8086/job/sleef/job/PR-629/1/consoleFull

[219/248] Linking C executable bin/qiutdspx2
FAILED: bin/qiutdspx2 
: && /usr/bin/powerpc64le-linux-gnu-gcc-14 -Wall -Wno-unused-function -Wno-attributes -Wno-unused-result -Wno-psabi -ffp-contract=off -fno-math-errno -fno-trapping-math -fno-strict-aliasing -O3 -DNDEBUG  src/quad-tester/CMakeFiles/qiutdspx2.dir/qiutsimd.c.o src/quad-tester/CMakeFiles/qiutdspx2.dir/__/common/main_checkfeature.c.o src/quad-tester/CMakeFiles/qiutdspx2.dir/qtesterutil.c.o -o bin/qiutdspx2 -L/home/jenkins/workspace/sleef_PR-629/build/submodules/tlfloat/lib   -L/home/jenkins/workspace/sleef_PR-629/build/lib   -L/home/jenkins/workspace/sleef_PR-629/build/src/common -Wl,-rpath,/home/jenkins/workspace/sleef_PR-629/build/submodules/tlfloat/lib:/home/jenkins/workspace/sleef_PR-629/build/lib:/home/jenkins/workspace/sleef_PR-629/build/src/common  lib/libsleefquad.a  lib/libsleef.a  /usr/powerpc64le-linux-gnu/lib/libm.so  /usr/powerpc64le-linux-gnu/lib/librt.a && :
/usr/lib/gcc-cross/powerpc64le-linux-gnu/14/../../../../powerpc64le-linux-gnu/bin/ld: lib/libsleefquad.a(qdispx2.c.o):(.toc+0x0): undefined reference to `Sleef_fmaq2_u05vsx'
/usr/lib/gcc-cross/powerpc64le-linux-gnu/14/../../../../powerpc64le-linux-gnu/bin/ld: lib/libsleefquad.a(qdispx2.c.o):(.toc+0x8): undefined reference to `Sleef_ilogbq2_vsx'

@KamathForAIX
Copy link
Copy Markdown
Contributor Author

KamathForAIX commented Feb 14, 2025

@shibatch I am not sure why this happened because when I tried in PPC Linux with the same commands as in the Jenkins build, it worked. I have made a guess looking at the library name that it might have to do something with the change in src/common/quaddef.h.

Can we check again with the recent change I made?

@shibatch
Copy link
Copy Markdown
Owner

The culprit seems to be this?

-- Performing Test COMPILER_SUPPORTS_VSX - Failed

Is VSX support removed in gcc-14?

#error \"Only VSX(ISA2.07) little-endian mode is supported \"
#if !defined(__LITTLE_ENDIAN__) && !defined(_AIX)
#error \"Only VSX(ISA2.07) little-endian mode and AIX is supported \"
#endif
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

You don't need this #endif here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@shibatch I have corrected this. Thank you for pointing out.

@KamathForAIX
Copy link
Copy Markdown
Contributor Author

@shibatch It is possible since I see
-- Performing Test COMPILER_SUPPORTS_FLOAT128 - Success
-- Performing Test COMPILER_SUPPORTS_QUADMATH
-- Performing Test COMPILER_SUPPORTS_QUADMATH - Success
-- Performing Test COMPILER_SUPPORTS_VSX
-- Performing Test COMPILER_SUPPORTS_VSX - Success
-- Performing Test COMPILER_SUPPORTS_VSX3

In my PPC Linux LPAR.

@shibatch shibatch merged commit b8abbd5 into shibatch:master Feb 14, 2025
@shibatch
Copy link
Copy Markdown
Owner

I am sorry, but the AIX support will be removed before SLEEF 4.0 is released.

#673

You may think that the code for AIX support is minimal and untested, so the cost may seem low.
However, even if the code itself for AIX support is small, having a lot of such code makes the code dirty and difficult to maintain.

Especially for IBM related architectures, there are already two, powerpc and S390X, and S390X is a big endian architecture, which is rare these days, so there is an extra maintenance cost. These architectures do not have a large market share, and we cannot accept additional cost increases on top of the maintenance costs we are currently paying for free.

@KamathForAIX
Copy link
Copy Markdown
Contributor Author

@shibatch I understand your concern.

But we do need sleef to be working on AIX for PyTorch. Otherwise our customers and users will not be able to do pip3 install torch since the sleef submodule will not compile.

AIX is putting an effort to modernize, and we are supported in CMake, ONNXRuntime, Scipy, Numpy, Pandas, Meson, and even in talks with the PyTorch community via PRs for AIX support.

You can feel free to change anything you want to in the future in Sleef without worrying about AIX. We have CIs internally running and will make sure Sleef is working in AIX, and if something breaks, I will raise a PR to fix it.

You can also connect with @ranjitshs, @ayappanec or me (@KamathForAIX) for any queries related to AIX.

Having said that, is there anything we can do that would work for AIX and you that you have in mind? Kindly let me know. We are open to suggestions.

@shibatch
Copy link
Copy Markdown
Owner

At this time, the SLEEF project has no sponsor and is basically maintained entirely by myself.
As I have repeatedly stated in the CoC below and elsewhere, it is my view that if a company is profiting from the deliverables of this project, they deserve to be a sponsor of this project.
As I mentioned above, as far as IBM is concerned, I already maintain two architectures, powerpc and S390x, for free, and I do not see how it makes sense for me to provide any more effort for free.
IBM is asked for sponsorship.

https://github.com/shibatch/nofreelunch?tab=coc-ov-file

#673

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.

Port Sleef to AIX

2 participants