Introduction
Graphics Processing Units (GPUs) have revolutionized high-performance computing, offering massive parallel processing capabilities. However, for many Small and Medium-sized Enterprises (SMEs), a significant "GPU programming wall" exists. Harnessing this power typically requires specialized expertise in languages like CUDA or OpenCL, which are often beyond the reach of non-expert engineers. While automatic translation tools exist, they frequently suffer from poor usability, limited applicability to complex industrial code, and high barriers to entry due to complex installation requirements.
To address these challenges, the GPSME system was developed as a user-centered, web-based automatic code translation tool. It aims to bridge the expertise gap by allowing non-experts to translate standard C++ code into optimized GPU code through a simple, accessible interface.
The GPSME System: A User-Centered Approach
The GPSME system is designed with "learnability" and "usability" as core features. Unlike traditional command-line tools, GPSME provides a comprehensive web-service interface built on the ExtJS framework. This allows users to upload, edit, and translate their source files directly within a browser, eliminating the "installation nightmare" often associated with compiler frameworks.
The backend of GPSME is powered by the ROSE compiler framework and extends the capabilities of the MINT translator. It incorporates an encryption scheme to protect user intellectual property during the translation process, ensuring that sensitive industrial code remains secure while being processed on the server.
Technical Innovations: Handling Complex Loops
A major limitation of previous automated tools was their inability to handle non-perfectly nested loops, particularly triangular loops where the inner loop's boundaries depend on the outer loop. Such structures are common in industrial applications, such as covariance matrix calculations. GPSME introduces a robust solution for these scenarios.
Instead of failing or producing inefficient code, GPSME maps the triangular iteration space onto a rectangular grid of GPU thread blocks. It then utilizes "membership tests" within the generated GPU kernel to determine if a specific thread falls within the valid triangular region. This approach ensures that all necessary computations are performed while maintaining a structured threading model that the GPU can execute efficiently.
Additionally, GPSME introduces specialized pragmas for Sliding Window Operations (SWO), which are essential for image processing tasks like median filtering. By providing high-level directives, the system can automatically generate complex CUDA kernels that utilize texture memory and optimized data transfer patterns, further boosting performance for specific industrial domains.
Industrial Evaluation and Results
The efficacy of GPSME was validated through real-world applications provided by four industrial partners (IME Ltd, B3C, Rotasoft, and AnSmart) and standard machine learning benchmarks. The results demonstrate that automated translation can achieve performance comparable to manual optimization:
- Significant Speedups: Industrial applications saw performance gains ranging from 2.1x to 13.6x compared to CPU-only implementations.
- Machine Learning Efficiency: In SVM tasks using the MNIST dataset, GPSME-generated code outperformed commercial compilers like PGI and standard OpenMP implementations, approaching the speed of hand-optimized libraries like GPU-LibSVM.
- Productivity Gains: In a case study involving medical image analysis (colon centerline extraction), a non-expert was able to achieve a 3x speedup in just one hour using GPSME—a task that previously required several days of expert manual programming.
Conclusion
GPSME demonstrates that a user-centered approach to automatic code translation can effectively lower the barrier to GPU acceleration for SMEs. By combining a simplified web interface with advanced compiler techniques for handling triangular loops and sliding window operations, the system provides significant productivity and performance gains. Future work will focus on expanding the range of supported algorithmic structures and further automating memory optimizations like shared memory tiling to continue improving the utility of GPUs in industrial settings.
Summary updated