Power Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only

Pytorch on AIX: Bringing AI to the AIX enterprise world.

By Aditya Kamath posted Fri June 20, 2025 02:14 PM

  

IBM AIX operating system is a known and trusted environment to run mission-critical workloads in enterprise environments.

But what if these systems could do more than just run? What if they could learn?

With PyTorch running on AIX, you can bring the power of machine learning directly to your enterprise core in Power Systems without moving data off the box.

PyTorch, transformers, tokenizers, and sentence-transformers are now available for AIX users having OS level 7.3 and higher in AIX Toolbox.

Why run PyTorch on AIX?

  1. Use AI near your data—logs, monitoring.

  2. Do inference of open-source models.

  3. Train lightweight models locally on Power CPUs with on-chip accelerators (MMA).

  4. Embed intelligence in backend services, shell scripts, or background jobs.

  5. Do anomaly detection inside your AIX workloads.

What can you do? Some of the real use cases.

  • Generate embeddings from open-source models.

  • Simple binary decision tasks.

  • Detect anomalous things, like in logs, with auto-encoders.

  • Run lightweight inference in production.

  • Forecast system metrics using LSTM.

And many more...

How to install pytorch on AIX

Do,

dnf update
dnf install python3-torch    

PyTorch on AIX can be used by SREs, sysadmins, developers, testers, data scientists, and AI teams looking to integrate deep learning into core infrastructure.

PyTorch on AIX is more than portability—it’s about potential since one can run AI at the center of the enterprise infrastructure.

Where the logs are, the business data lives, decisions are made,

AIX offers a reliable and scalable foundation for enterprise workloads, and when paired with PyTorch, it now enables deep learning capabilities.

Installing tokenizers, transformers, and sentence-transformers on AIX.

Building and Installing tokenizers from source

# ToolBox dependencies
dnf install rust*
dnf install python3-maturin
dnf install python3-scikit-learn
dnf install python3-devel

# Path to your OpenXL compiler
export CC="/opt/IBM/openxlC/17.1.2/bin/ibm-clang_r -pthread -maix64"
export CXX="/opt/IBM/openxlC/17.1.2/bin/ibm-clang++_r -pthread -maix64"
export RUSTFLAGS="-C link-args=/usr/lib/libc++abi.a"

wget https://files.pythonhosted.org/packages/92/76/5ac0c97f1117b91b7eb7323dcd61af80d72f790b4df71249a7850c195f30/tokenizers-0.21.1.tar.gz
tar -xf tokenizers-0.21.1.tar.gz
cd tokenizers-0.21.1

pip3 install . --no-build-isolation --no-deps -I

# Installing transformers and sentence-transformers

pip3 install tqdm
pip3 install transformers --no-build-isolation --no-deps -I
pip3 install sentence-transformers --no-build-isolation --no-deps -I


#AIXOpenSource
6 comments
98 views

Permalink

Comments

22 days ago

@Alexander Pettitt 

Since the tokenizer code is in Rust and Rust is compiled in openXL, we have some compatibility issues during compilation of tokenizers/transformers if we use the GCC compiler to do the same. 

The Toolbox team is working towards resolving it, and once done, we will let you know. For now kindly use OpenXL for the same. We have tested LLM use cases for embedding, training, and inferencing, and things will work smoothly in AIX. Thank you for the information.

23 days ago

My first use case is getting a LLM running locally on AIX as a POC.

Could you replace the Open XL compiler instructions with GCC ones from the AIX Toolbox? That would make it easier for most customers.

23 days ago

@Alexander Pettitt

Thank you very much for the feedback.

Yes, one has to use the Toolbox Python (/opt/freeware/python3.9) to use PyTorch. By the way, the latest version of protobuf is uploaded, and now you should be able to install/update PyTorch smoothly. 

By the way, we are going to update PyTorch in the AIX toolbox whenever possible. Can you tell me what use case you are using PyTorch for in AIX? This will help us in understanding AIX user requirements better and help us improve our user experience.

23 days ago

Note if you are trying to get this to work under AIX 7.3 the python3 in the path is not the one that has torch library available.
Not this one:
# ls -l /usr/bin/python3
lrwxrwxrwx    1 root     system           30 Sep 02 13:12 /usr/bin/python3 -> /usr/opt/python3/bin/python3.9

Instead use the AIX toolbox one
/opt/freeware/bin/python3
# /opt/freeware/bin/python3
Python 3.9.23 (main, Jul 22 2025, 00:57:36)
[GCC 10.3.0] on aix
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> x = torch.rand(5, 3)
>>> print(x)
tensor([[0.5685, 0.2492, 0.2876],
        [0.0444, 0.7707, 0.4733],
        [0.5356, 0.7330, 0.7011],
        [0.7815, 0.4419, 0.6539],
        [0.2172, 0.6219, 0.7007]])

Testing idea from https://pytorch.org/get-started/locally/

29 days ago

@Alexander Pettitt

Kindly try the below way,
dnf install python3-torch-2.7.0-1 python3.9-torch-2.7.0-1

The latest version of Protobuf is in the batch of uploads and will get uploaded soon. Will keep you posted. 

29 days ago

Thanks Aditya for the quick response