Skip to content

[feature request] Vec256 power le vsx support #27678

@quickwritereader

Description

@quickwritereader

I would like to add vsx support to aten Vec256 for power le platform.
The work is still in progress. I open this issue to discuss this topic as I saw Vec256 is kept modified.
For now
I am simulating 256bit using 2 128 bit vector variables.
For supporting vsx inside pytorch
-cmake for vsx detection
-pytorch modifications for handling power
-Vector codes for Vec256, Vec256, Vec256<int16_t>, Vec256< int32_t>, Vec256< int64_t> ,Vec256

I keep those Vec256 changes isolated from PyTorch for testing purposes and it was not fully incorporated and ready to ship. As there are not any benchtests I just looked at generated codes. Under gcc8 -Ofast compiler-generated assemblies were quite good.

For now, for me, the main obstacle is the way to implement trigonometric, other mathematical functions. Firstly, I went with avx_mathfun and translated its codes into vsx:
-all avx_mathfun sin,cos,exp.log was implemented inside Vec256
-I also implemented pow, sin, cosh and other functions.

Pytorch team is using sleef library for some functions. I checked sleef library and they have support for 128bit vsx functions. I could either translate those into simulated 256bit or I could use cephes implementations as it was done with avx_mathfun.

I am planning to add vsx support as separate headers like vec256_*_vsx.h.

I also think that we could add test cases for Vec256 using either google test or catch. I only used the later.
Any guidance on this topic is appreciated. I want that my changes fit both ibm and pytorch team.

cc @ezyang @gchanan @zou3519 @VitalyFedyunin @ngimel @mruberry

Metadata

Metadata

Labels

featureA request for a proper, new feature.high prioritymodule: POWERIssues specific to the POWER/ppc architecturemodule: cpuCPU specific problem (e.g., perf, algorithm)module: performanceIssues related to performance, either of kernel code or framework gluemodule: vectorizationRelated to SIMD vectorization, e.g., Vec256triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions