Most of new mobile devices have GPUs to process 3D graphics content, and the more and more com-puting power for GPUs are being requested as the applications such as games and graphical user interfac-es (GUIs) are evolving on those devices. Especially, the embedded GPU requires low power consumption and small area since the mobile devices are battery-powered and portable units.
The GPU is consist of the programmable shader, which performs geometry transform, lighting calcula-tion, color blending, and manipulation the texture, a triangle setup unit, a rasterizer, a texture unit, a texture cache, and a raster operation unit. The programmable shader, which manipulates massive floating-point num-ber data, is very important function block in the GPU design.
In the traditional 3D graphics system, the four-component vectors are considered as the minimum op-erating unit since the geometry information (i.e., {x, y, z, w}) and the color information (i.e., {r, g, b, a}) are consist of four components. So 4-way SIMD architecture is considered as the optimal solution. But the recent visual effects processed in the programmable shader are more delicate and complex, and the four-component vector is not a basic operating unit any more. It means that the resource allocation of the 4-way SIMD archi-tecture is inefficient when the new visual effect program is performed in the programmable shader.
In this work, the unified shader is designed by using a scalar stream processor, which performs a pro-gram independently. This proposed architecture reduces the idle state of data-paths, and it is suitable for mo-bile devices which have limited area and power budget.
The proposed processor has the variable latency when it performs multi-component vector operation while the SIMD processor has the fixed latency regardless of the component count. A few component vector and scalar processing is performed more efficiently in the proposed processor.
To evaluate the proposed design, various architectures (e.g., SIMD, VLIW, and super-scalar) for the embedded GPU are compared in terms of data-path utilization, area, and latency. The benchmark programs have average 37.3% of four-component vector instructions, and the expected maximum resource utilization of the SIMD architecture is about 68%. The proposed architecture achieves 88% utilization gain.
The proposed architecture has two main problem, which are the instruction inefficiency and the special function unit overhead. The first problem is that the vector instruction is represented the multiple scalar in-structions and this requires more instruction memory space. About 3.3 times instructions are required in the scalar processor to perform the same job. The instruction compaction technique is proposed and it makes the instruction overhead only 2%. The second problem is that each SP in the shader core requires their own SFU, and this is large area overhead. In this work, the partial SFU feature which is the data-path sharing and the table loader feature which is the LUT sharing are proposed. The partial SFU is only 10% area overhead of its base data-path and the table loader makes the multiple virtual read ports even though there is only one physi-cal LUT. The table loader includes two main features which are the bank-partition and the multi-fetch.
Data-path utilization is 88% and 48% higher than that of the single SIMD and heterogeneous SP archi-tectures respectively. The normalized area-delay product is respectively 22% and 36% better than that of those architectures. The power consumption of this work is less than 15% of that of heterogeneous SP architecture.
All functions are incorporated into the FPGA evaluation platform, which has an ARM9 host processor and a full 3D graphics pipeline for the functional verification.
3D 그래픽 컨텐츠가 대중화되면서 최근 모바일 디바이스에서도 3D 그래픽 가속을 위한 하드웨어가 필수적으로 사용되고 있다. 모바일 기기의 디스플레이 해상도가 높아지고 어플리케이션이 복잡해지면서 모바일용 3D 그래픽 가속 엔진인 GPU의 성능도 예전의 데스크탑용 GPU를 넘어설 정도로 향상되고 있다. 배터리에 의해 전원이 공급되고, 휴대를 위해 작은 크기를 유지해야 하는 모바일 기기의 특성상 모바일용 GPU는 적은 전력소모와 작은 크기를 가져야 할 필요가 있다.
GPU는 정점(vertex)의 기하 변환과 조명 효과를 계산하고, 픽셀(pixel) 단위의 색상과 텍스쳐 표현을 처리하는 프로그래머블 쉐이더(Programmable shader)와 그래픽 처리에 특화된 하드웨어로 구성된 래스터라이저, 텍스쳐 장치 및 텍스쳐 캐시, 래스터 명령 처리 장치 등으로 구성되어 있다. 특히 프로그래머블 쉐이더는 대량의 부동소수점 데이터를 연산하는 장치로 data-path의 설계나 자원의 분배가 중요한 설계 요소가 된다.
전통적으로 3D 그래픽스에서 사용되는 지오메트리 정보나 색상 정보는 각각 {x,y,z,w}나 {r,g,b,a}와 같은 4개의 요소를 가진 벡터를 기반으로 한다. 기존의 쉐이더 프로그램은 비교적 간단한 지오메트리 변환이나 조명 효과로 이루어져 있기 때문에 벡터의 요소들을 일괄적으로 같이 처리할 수 있는 것이 효과적으로 인식되어 왔기 때문에 4-way SIMD 구조의 data-path가 도입되었다. 그러나, 최근에는 영상 효과들을 처리하기 위한 쉐이더 프로그램이 복잡해지면서 기존의 4개의 요소를 한 번에 처리하기 보다는 개별 요소들을 따로 처리하는 명령들의 비율이 높아지게 되었다. 따라서, 기존의 4-way SIMD 구조의 data-path가 모두 사용되지 못하고 유휴 상태로 되는 현상이 자주 발생하게 된다.
본 연구에서는 data-path의 유휴 상태가 되는 빈도를 줄임으로써, 특히나 면적이나 전력의 제한이 큰 모바일 환경에서 효율적으로 이용할 수 있는, 개별 요소 단위의 독립적인 프로그램 수행이 가능한 scalar data-path로 이루어진 스트림 프로세서를 사용하여 통합 쉐이더를 설계한다. 또한, 개별 정점이나 픽셀들 사이에는 의존성이 없기 때문에, 이들 data를 scalar data-path에서 수행하면서도 동일한 스트림 프로세서를 병렬로 두어 전체적으로는 SIMD 형태의 데이터 처리가 가능하게 함으로써 명령어 사용의 효율을 높이고 성능을 높일 수 있도록 하였다.
제안한 동형 스트림 프로세서는 여러 요소를 가진 벡터 연산을 SIMD 구조의 data-path에서 수행하지 않고, scalar data-path에서 순차적으로 수행함으로써 1-4 요소를 가지는 vector를 동일한 latency로 수행하는 SIMD 구조와는 달리, 가변적인 latency를 가지게 된다. 따라서, 4개의 요소를 벡터를 연산하는 명령 비율이 적은 경우 SIMD 구조에 비해 data-path를 더 효율적으로 운용할 수 있고, latency를 줄일 수 있는 장점이 있다.
제안한 구조의 타당성을 도출하기 위하여, 기본적인 4-way SIMD data-path와 함께 VLIW나 super-scalar 형태와 같이 성능 향상을 위해 기존 연구들에서 제안되었던 구조에서 여러 가지 쉐이더 프로그램들을 수행했을 때의 data-path utilization과 latency의 차이를 비교하였다. 벤치마크 프로그램들은 평균적으로 37.3%만의 4요소 벡터 명령을 가지고 있었고, 이를 통해 예측할 수 있는 SIMD 구조의 최대 효율은 68%이다. 벤치마크 프로그램의 실험 결과에서 utilization의 경우 베이스라인 구조에 비해 88%의 효율 향상이 있었고, 다음으로 가장 효율이 좋은 구조에 비해서도 48%의 효율 향상이 있었다. 특히, 4-component 사용 빈도가 다소 높은 vertex shader 프로그램보다 pixel shader에서의 효율 향상이 두드러졌다.
제안된 구조가 자원 효율성이나 성능 면에서의 장점을 가지고 있지만 크게 2가지의 문제점을 가지고 있는데, 하나는 scalar data-path 사용으로 인한 명령어의 효율 저하이고 나머지 하나는 3D 그래픽스 효과를 위해 자주 사용되는 여러 가지 elementary 함수의 연산을 가속하는 하드웨어인 special function unit (SFU)가 더 많이 필요하게 되는 문제이다.
첫 번째 문제는 SIMD data-path의 경우 1-4개의 요소 vector 명령을 한 개의 명령으로 처리 가능한데 비해 1-4개의 scalar 명령으로 변환해서 수행하여야 하는 구조의 특성 상 더 많은 명령어 메모리를 사용해야 하는 문제이다. 이를 보완하기 위하여 벡터 명령에 대해 2-bit 카운터를 두어 하나의 명령어를 반복 수행하고 각 레지스터 번호에 가변 오프셋을 두었다. 이러한 명령어 압축 기능으로 SIMD 구조 대비 평균적으로 3.3배 증가하는 명령어 개수를 실질적으로 2-6% 이내의 차이로 줄였다.
두 번째 문제는 기존 구조들은 scalar data-path의 4개에 해당하는 vector data-path와 SFU가 1:1로 대응되는 구조로, 제안된 구조는 scalar data-path와 SFU가 1:1로 대응되기 때문에 약 4배의 면적상의 부담(overhead)이 발생한다. SFU는 elementary 함수를 한정된 범위에서 여러 개의 구간으로 나누어 각 구간에서 다항식으로 근사화하는 구조를 가지게 되는데, 하드웨어 적으로는 크게 다항식을 계산하는 연산기와 각 구간에서의 다항식의 계수들을 저장하는 룩업 테이블(LUT)의 두 부분으로 구성된다. 본 논문에서는 전자는 각 스트림 프로세서의 연산기를 SFU 연산기와 공유하여 스트림 프로세서의 약 10% 정도의 면적 증가 내에서 SFU 기능을 내장할 수 있도록 하였고, 후자는 하나의 룩업 테이블을 여러 개의 스트림 프로세서가 공유하도록 하였다. 룩업 테이블을 공유함으로써 발생하게 되는 병목 현상을 해결하기 위해서 룩업 테이블을 멀티 뱅크 구조로 설계하여 각 뱅크 별로 별도의 읽기 포트를 두어 가상적으로 여러 개의 읽기 포트를 가지는 효과를 얻었고, 각 스트림 프로세서에서 요청하는 룩업 테이블의 주소(index)를 모니터링하고, 각 뱅크별로 주소를 관리하고 동일한 주소를 판별하여 한 번의 룩업 테이블 요청으로 여러 개의 스트림 프로세서에 결과값을 돌려주는 멀티 펫치 기능으로 읽기 요청 수를 줄여주는 효과를 얻었다. 벤치마크 테스트 결과에서는, 여기에 실제 룩업 테이블이 요청되는 시점과 결과 값이 사용되는 파이프라인 스테이지 상의 3 cycle 차이로 인해 지연 시간 감춤(latency hiding) 효과가 더해져서 각 스트림 프로세서마다 별개의 룩업 테이블을 두엇을 때와 거의 동일한 성능을 얻을 수 있었다.
최종 평가로 자원 이용률 면에서 기준 구조 대비 88% 향상, 수행시간은 6% 향상되었으며, 면적은 약 30% 감소하였고, 전력 소모면에서는 경쟁 구조인 이형 스트림 프로세서 구조 대비 15% 감소하였다.
마지막으로 제안한 구조의 구현 가능성(feasibility)을 확인하고 기능 검증(functional verification)을 하기 위해 ARM9 호스트 프로세서를 포함한 FPGA 플랫폼 상에 그래픽스 파이프라인을 구축하고, 어플리케이션을 수행하였다. 또한 ASIC 칩 제작을 하였다.