Unlocking the Power of AI on Mainframe with IBM Machine Learning for z
Mainframe celebrated its 60th birthday in April 2024. It is tremendous to see a technology sustain, or, should I say, thrive, for over six decades. Mainframes have evolved over time and adapted to new offerings in the IT world. In this blog, we will talk about one such AI offering on Mainframe — IBM Machine Learning (MLz) on z.
Chapter 1 : What Is Machine Learning, Deep Learning?
First things first, let’s understand what ML is. In layman’s terms, machine learning is a subset of AI that enables a machine to learn from existing data. Machine learning uses a wide variety of algorithms to learn from and predict outcomes from the data. Example: A model that predicts potential credit card transaction frauds from historical data.
Typically, machine learning involves the following steps:
· Build or use an existing algorithm like Random Forest.
· Feed the data into an algorithm like historical credit card transaction data.
· Use this data to train a model.
· Test and deploy the model.
Deep learning (DL) is a subset of machine learning, and it uses multi-layered or neural networks for machine learning. Deep learning is well-known for its applications in image and speech recognition, as it works to see complex patterns in large amounts of data.
The below image summarizes the discussion until now.
In general, these ML and DL models are built and run on x86 servers. IBM Machine Learning for z now allows you to build or bring these models on or to z (zOS and Linux on z).
Chapter 2 : IBM Machine Learning for z Overview
IBM Machine Learning for z/OS (formerly known as Watson Machine Learning for z) is an end-to-end machine learning platform that enables all types of data professionals to build, deploy, score, and monitor machine learning and deep learning models on IBM z. To reiterate, you can build or bring models to run on z.
The ‘Bring models onto z’ is made possible with ONNX (Open Neural Network Exchange), which is an open standard for representing machine learning models. Essentially, ONNX promotes interoperability between different deep learning frameworks, making it easier to share and deploy models in the AI ecosystem. In this case, the interoperability between the x86 architecture and the z architecture. Once on Z, the MLz compiles and deploys these models onto Z, as shown in the image below:
There are two version of MLz available in market as of today :
1. Machine Learning for IBM z/OS — Enterprise Edition:
a. The full-featured machine learning platform, training AI models anywhere or on IBM Z and readily deploying those models on z/OS, co-located with enterprise applications, transaction data and business logic for in-transaction scoring in near real-time without impact to SLAs.
2. Machine Learning for IBM z/OS — Core Edition
a. The lightweight version of MLz provides the essential core AI services that are REST-API-based for machine learning operations including online scoring, enabling AI Powered Offerings (IBM or ISV) to leverage AI in their stack.
Key features of MLz Enterprise edition include :
- GUI Configuration: Web-based Configuration Tool for Single Instance and High Availability Configuration.
- Model training tool: Integrated Jupyter notebook server for model training on Z; also leverage IBM z Spark 3.2 and Python AI Toolkit for training and scoring.
- Scoring Engines: Online scoring for Spark, PMML, ONNX, Python, etc. Leverage the z16 on-chip AI accelerator for ONNX model scoring.
- Integrated Scoring: In-transaction scoring through the native CICS and WOLA interfaces for CICS, IMS, and BATCH COBOL applications. Note that models can also be invoked using REST APIs.
- UI Dashboard: Web-based UI for the WMLz environment and end-to-end model lifecycle management.
In a nutshell,, below is the flow to enable models to run on z.
- Build and train models in any popular framework on any platform of your choice.
- Use ONNX, an open-source tool for framework interoperability. Models are converted to the ONNX interchange format. Leverage zCX and run on zIIP engines.
- The IBM DLC (Deep Learning Compiler), optimized for performance and new libraries, generates a program from the model for execution on z/OS or Linux on IBM z16.
- Deploy on IBM z16 with MLz and infuse AI into workload applications.
Anticipating a query around GenAI adding this para. GenAI requires no introduction, but the most basic explanation is that it is a subset of machine learning (ML) that focuses on creating fresh data samples that closely mimic real-world data. The GenAI uses a transformer model. A transformer is a neural network design that accepts one text sequence as input and returns another text sequence as output. As of today (July 2024), Transformer models are not enabled to run on MLz.
Chapter 3 :Benefits of running ML models on IBM z
One of the obvious questions is, ‘Why should you run ML models on Z?”. This can be answered in two parts:
Part 1 : To leverage the benefits of co-locating ML models, mainframe applications, and data
To gain real-time insights at the point of transactions with in-transaction scoring (inferencing) using MLz. This boosts performance since all the components required to leverage a model are present on the platform itself, for example, credit card authentication, the authorization app, customer data, and trained ML models. Note that the data is kept in-place for higher throughput and lower latency, and sensitive data remains encrypted and secure.
Part 2 : To leverage the features of Z hardware
The IBM Z16 comes with an in-built Telum chip specifically built for AI workloads. The IBM z16 can perform 3.5 million inferences per second with 1 ms of latency. Also, On-Chip AI Accelerator Telon offers a 20-fold speedup in AI inference over running them on commodity servers.
Note that the MLz workload is zIIP offloadable; hence, it does not directly contribute to General Processor (MIPS) consumption.
Chapter 4 :How to Integrate MLz into Mainframe Applications
As previously stated, one of the key features of MLz’s offering is the ability to integrate models into mainframe applications. For the sample Cobol CICS application, one of the key components for this integration is the MLz scoring service, which is embedded in a CICS region as a program called ALNSCORE.
Use the CICS LINK command in your CICS COBOL application to call ALNSCORE for online scoring for SparkML, PMML, and ONNX models. This is similar to how you invoke any other subroutine in CICS. The call uses special containers to transfer the scoring input and output between the COBOL application and the ALNSCORE program.
Below is the sample code to be added to the Prodecure Division Cobol-Cics application to invoke MLz models (the code is not exhaustive but just an indicator of how models can be embedded into the Cobol-CICS program).
* MLz Model deployment ID
EXEC CICS
PUT CONTAINER(‘ALN_DEPLOY_ID’) CHANNEL(‘ABCD’)
FROM(‘XYZ-This is model id number when deploy it to z’)
END-EXEC.
* Invoke ALNSCORE to do Scoring
EXEC CICS
LINK PROGRAM(‘ALNSCORE’) CHANNEL(‘ABCD’)
END-EXEC.
EXEC CICS
GET CONTAINER(‘ALN_OUTPUT_DATA’) CHANNEL(‘ABCD’)
INTO(WS-COPYBOOK)
END-EXEC.
* Check for outcome of model execution Ex: Card transaction is fraudulent or not
IF probability > 0.90 THEN
PERFORM XXX
ELSE
PERFORM YYY
END-IF.
The below image depicts a high-level view of the integration of mainframe applications with models.
Chapter 5 : Conclusion
In summary, IBM’s Machine Learning for z enables enterprises to harness the power of AI directly on IBM z systems. This offering allows organizations to build, deploy, and manage machine learning models on z, ensuring high performance, security, and scalability. MLz integrates seamlessly with the IBM z application, facilitating real-time decision-making and insights within transactional systems. This solution empowers businesses to leverage their existing mainframe infrastructure for advanced machine learning applications.
Side note: The AI term was coined first in the mid-1950s at the Dartmouth Conference in summer 1956, 8 years before the first mainframe was released!!
References :
(1) https://www.ibm.com/products/machine-learning-for-zos
(2) https://ibm-zcouncil.com/wp-content/uploads/2020/03/wmlz-State-CA-zCouncile_Mar2020-1.pdf
(3) https://www.ibm.com/think/topics/ai-vs-machine-learning-vs-deep-learning-vs-neural-networks
Disclaimer: The views and opinions expressed in this blog are solely those of the author and do not necessarily reflect the official policy or position of the author’s employer or any other organization. The information provided is based on personal experience and research and is intended for informational purposes only.