In this message we introduce and illustrate how to use APYFAL, which is an abstraction layer to easily operate ready-to-use accelerated functions that are available on AccelStore and that are deployed in a public, private or hybrid Cloud environment.
APYFAL is an open source Python library that provides a REST API (REpresentational State Transfer Application Programming Interface) to operate functions that are accelerated using FPGA devices. This API allows Cloud application developers to operate accelerated functions that are deployed in public cloud infrastructures such as on AWS EC2 F1 instances and OVH Public Cloud instances, and on premise.
A remote execution with the APYFAL REST API allows multiple instances to speak to multiple accelerators in parallel, while a local execution on an cloud instance is also possible for tighter integration. These 2 scenarios are illustrated below. Running APYFAL locally on a Cloud instance allows to minimize the impact of the network bandwidth while reducing the end-to-end processing latency.
APYFAL allows Cloud application developers to control the accelerated processing of files that are stored on a machine, on a cloud storage bucket (AWS S3, OpenStack Swift…), or on public Internet (using a HTTP URL).
APYFAL mainly consists of the Accelerator class that represents the Accelerator and its host (the FPGA cloud instance). Application developers use three simple methods to operate any accelerated function:
This method handles the Accelerator configuration:
This method is the core of APYFAL. It runs the accelerated function and returns the result.
This method terminates the Cloud instance according to a set of predefined rules that you can select.
The following example shows how to use the gzip compression accelerator developed by CAST to boost the compression of a file stored in a AWS S3 bucket. Files are compressed up to 25x faster than CPU compression when using simple APYFAL methods to operate the gzip compression accelerator.
The following example illustrates how to use APYFAL to control the execution of an FPGA accelerator to compress all files in a directory.
Python is a powerful language that allows software developers to replace existing functions with their equivalent FPGA accelerated function. Here we illustrate how to patch Python Pseudo Random Number Generator (PRNG) with the TRNG accelerator (True Random Number Generator) developed by Secure-IC so as improve cryptographic applications. This accelerator generates true random numbers (based on electronic noise, which is better than any software-based random number generator) while significantly decreasing random number generation time.
When using Python to develop cryptographic functions, developers often rely on the os.urandom function to generate Pseudo random numbers. Patching this function with the TRNG accelerator improves the quality of generated random numbers. This also applies to any function that calls os.urandom under the hood, such as in the Python secrets library and cryptography package. The following lines of code illustrate how to easily leverage the TRNG accelerator when patching the os.urandom function using APYFAL. Application developers only need a few minutes to integrate the APYFAL library and accelerate functions.
The same approach can be applied to accelerate and improve the generation of random numbers in gaming/lottery, banking/financial applications.
The following example illustrates how to use APYFAL to orchestrate a pool 1,000 accelerated functions in order to boost search and replace operations in a set of 1,000 large files (e.g. log files, DNA sequences...). We use the Ultra Fast Search & Replace for Data Analytics accelerator, which has been developed by Axonerve to boost search and replace operations in ascii files more than 1000x faster than a sed (stream editor) command. In this case, all the accelerators in the pool are configured to perform the same search and replace operations on different files. This is achieved by configuring all the accelerators with the same corpus file. Each accelerator function (each FPGA instance) in the pool is then used to process a single large file.
from concurrent.futures import ThreadPoolExecutor
The open source APYFAL library provides a powerful abstraction layer to leverage the power of accelerated functions in your Cloud context. APYFAL operates the accelerated functions that are available on AccelStore, and that are currently deployed on AWS F1 instances and OVH FPGA instances.
The APYFAL library is easy to use and brings tremendous acceleration benefits to a large number of Cloud Application developers in many spaces such as Video Transcoding, Imaging , Security, Compression, Big Data Analytics, AI, Genomics, etc...
APYFAL is also available for deployment on on-premise servers, and testing it through AccelStore only takes a few minutes, so anyone interested in leveraging it should contact Accelize to get more details.