異質系統架構(Heterogeneous System Architecture, HSA)是一個由HSA基金會(HSA Foundation)提出的異質計算硬體架構。該架構之統一記憶體架構(HSA Unified Memory Architecture, hUMA)使得資料得以共享於異質裝置中,其提供之使用者層級排隊模型(HSA Queuing Model, hQ)亦能以低成本將程式調度於不同異質裝置上執行,這些特色使得應用程式得以使用更有效率的異質計算。然而,今日之大多數異質計算卻無法得力於hUMA與hQ,甚至大部分市場上的應用程式都以傳統之循序執行模型來實作。 此論文目的為建構一個全自動化的框架以自動轉移循序應用程式至HSA平台上,其包含使用多面體記憶體相依分析、階段化調度預測以及記憶體存取合併優化。此框架亦使用hUMA及hQ所帶來之好處,於符合HSA標準之機器上達成低成本之工作調度。在AMD Carrizo機型上(符合HSA標準),我們的框架最快可以使一個循序應用程式在同一機器上加速至原先之8.66倍。在傳統認為工作量不夠大而無法得力於非HSA異質計算之許多情形中,我們的框架仍能帶來一定程度的加速。此外,其所帶來之加速程度,在同一台Carrizo機器上有時甚至超過人為使用不論HSA平台或非HSA平台轉移之結果。此架構使得許多以循序模型實作之既有傳統應用程式能夠因為HSA的異質計算而達到效能的提升。
Heterogeneous System Architecture (HSA) is a hardware architecture for heterogeneous computing proposed by the HSA Foundation. Its Unified Memory Architecture (hUMA) enables data sharing between heterogeneous devices and its user-level Queuing Model (hQ) enables low overhead kernel launching. With such features, applications could enjoy more efficient and effective heterogeneous computing. However, most of today's heterogeneous-computing applications have not leveraged the hUMA and hQ features. Moreover, the majority of applications on the market are implemented in traditional sequential models. This thesis looks at building a fully automatic framework to migrate sequential applications to HSA. The framework includes polyhedral-guided memory aliasing analysis, a staged dispatching predictor, and memory coalescing optimization. It also takes advantages of hUMA and hQ to achieve low overhead job dispatching on HSA-compliant systems. On an AMD Carrizo machine (HSA-compliant), a sequential application runs through our framework could be 8.66x faster on Carrizo than before. In several cases where workloads are considered insufficient to benefit from conventional or non-HSA heterogeneous computing, our framework could still deliver significant speedups. In addition, the performance obtained through our framework can sometimes exceed the performance gain from manual tuning for both HSA and non-HSA platforms, running on the same Carrizo machine. With this framework, many existing applications coded in traditional sequential models could get performance boost from HSA-based heterogeneous computing.