SAP HANA External Machine Learning (EML) as part of the SAP HANA Application Function Library (AFL) allows the execution of already trained TensorFlow models. This allows you to benefit from the advantages of this framework and address many machine learning issues. TensorFlow is particularly suitable for the application of neural networks, for example in deep learning.
TensorFlow is a platform independent open source framework for machine learning, artificial intelligence and deep learning, which was originally developed by Google. It offers a wide range of possible applications, for example in the areas of image recognition, speech recognition and time series analysis and enables creation of learning neural networks. It is characterized by excellent scalability and can be used in an on-premise scenario or in the cloud on a variety of computer cores (CPUs, GPUs, TPUs). Furthermore, TensorFlow supports several programming languages such as Python and C++.
The integration of Google TensorFlow into SAP HANA is based on the SAP HANA Application Function Library (AFL). It is possible to interact with the TensorFlow models via SQL Script. This SQL script is executed in SAP HANA. Using the gRPC remote procedure call from Google, SAP HANA accesses models exported in SavedModel format from the TensorFlow Serving system.
An overview of the architecture can be found in the following sketch:
With the AFL framework, predefined TensorFlow models can be called remotely via gRPC calls, which are encapsulated in AFL procedures. The EML AFL is the TensorFlow Serving Client implementation for SAP HANA.
Using the TensorFlow ModelServer (TMS), TensorFlow models exported in SavedModel format can be executed via gRPC remote procedure calls. The models are stored in SavedModel format on the TMS. The active models are models that are available for execution. The gRPC server serves as an interface for communication with the TMS client.
To be able to use SAP HANA EML functions, you need the SAP HANA Platform with the matching version of EML. You also must install the Application Function Library (AFL), which contains the External Machine Learning Library (EML). Please note that the revision number of the AFL must match the revision number of SAP HANA. Finally, you must activate the Script Server on the SAP HANA instance. For more information, see SAP Notes 1898497 and 1650957.
The TMS can be used in the SAP HANA landscape or on separate hardware resources.
Co-deployment in SAP HANA is the simplest setup, as no additional hardware is required. This type of setup is mainly used for test, development and other non-productive scenarios. For additional security and robustness, the TMS instances should be configured so that they run in a suitably configured container on the host computers.
In production environments, however, TMS resources must be kept separate from SAP HANA.
Due to special characteristics of the HANA database not all TensorFlow data types and shapes are supported. External machine learning AFL supports those Tensor shapes and data types that are relatively easy to map between standard SQL tables and data types and tensors.
An overview of the supported data types and forms can be found in the following table:
SAP HANA External Machine Learning (EML) generates predictions as part of the SAP Application Function Library (AFL) using externally pre-trained TensorFlow models. As a platform, TensorFlow is state of the art, popular with business users and can derive valuable forecasts from data. However, the possibility to train the model or update it over time is missing. Furthermore, not all tensor types are supported due to HANA-specific limitations. Therefore the tool cannot represent the full ML life cycle and is complicated to use. Business users in particular often prefer to use TensorFlow via the programming language Python and have little knowledge of the corresponding SAP tools.
If you want to gain valuable insights while maintaining full insight and control, we recommend our white paper "SAP BW and State of the Art Machine Learning". In this paper, we examine SAP's machine learning portfolio and give clear recommendations on how you can generate valuable added value from your data.