前往业界动态栏目前往脑场特工栏目暂未开通前往IN评测栏目暂未开通前往大家的PCINLIFE暂未开通

赞助商广告

官方活动宣传

发新话题
打印

[体系架构] NVIDIA 下一代 GPU 体系架构猜测、讨论专题

本主题由 Edison 于 2008-9-12 02:01 提升
1024sp,1024bit显存,双核心甚至4核心

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

偶看一个wrap其实就是一条SIMD指令--是32路的SIMD指令,由于只有8个ALU,ALU的延迟为4,为了跑满载,所以要分成4批来执行。
一个计算类wrap是无法半路切换的,而是必须执行完,然后是执行下一个wrap。 下一个wrap是谁,由调度器决定。

调度器就像乱序OOO-E调度器,发射激活就绪的wrap-SIMD指令而已。  

对于分支类 wrap就要很惨很惨了。。, 运气差的话,会需要很多wrap(--指令)替他擦屁股。



一个wrap就是一条指令。SP主频除以4,什么都清楚了。



--即一个wrap是一条32SIMD指令(支持G/S),单周期延迟,单周期吞吐的小强指令。一般向量计算都很难做到单周期延迟。确实小强了。

SIMT
是虚的打打广告,而SIMD是真的。32路哦。


 


--
回一下楼下。
偶说"像"乱序OOO-E调度器。
说乱序OOO-E调度器就是CPU的OOO,那是楼下的发明。
另外,模仿一下楼下的腔调--CPU的OOO调度器实现方法较多,利用CAM来实现是其一种而已,多去看看书,寒一个。
另外“像”与“是”是两个字,楼下太激动了。  
引用:
原帖由 predaking 于 2008-9-5 16:24 发表 
你说我好心提示你,却……呵呵 果然不搞技术的思路就是不一样 牛了

还有,搞了N年Arch今天学会一个新名词“物理线程”,所以感谢楼上:〉
搞了N年Arch都没听说过物理线程?
话说回来,intel够无知的。
看这里就有你眼里的草包Intel的话
The threads you create with a threading package are logical threads, which map onto the
physical threads of the hardware.
--Threading Building Blocks.pdf


[ 本帖最后由 gaiban 于 2008-9-5 22:04 编辑 ]

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 Prescott 于 2008-9-5 15:35 发表

这里边说的非常清楚了。首先wrap中所有线程执行的是一样的代码。
比如下面这段代码:
if (condition) {
    a;
}
else {
    b;
}
这种代码,如果wrap中的一半线程condition成立,那么第一个cycle,这一半就先执行语句a,另外一半线程停滞,第二个cycle,前一半语句停滞,后一半执行b,执行过程是串行的。
同样的逻辑,写成LRB的代码就是
condition -> mask_reg
(mask_reg) a;
~(mask_reg) b;
本质上G80和LRB在这方面没什么区别。唯一不同的大概是G80的4cycle warp的机制。
这种代码CUDA编译器会编译为predicate风格的代码。

比如
mov r0 a
setgt rc condition 0
movc r0 b

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 gaiban 于 2008-9-5 16:31 发表
偶看一个wrap其实就是一条SIMD指令--是32路的SIMD指令,由于只有8个ALU,ALU的延迟为4,为了跑满载,所以要分成4批来执行。
一个计算类wrap是无法半路切换的,而是必须执行完,然后是执行下一个wrap。 下一个wrap是 ...
G80的ALU延迟应该远大于4。
具体可以查询文档。里面提到为了避免register l/s hazard,需要的最小线程数字。
我认为4 cycle的设计只是为了简化/节约调度器的复杂度而已。

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 RacingPHT 于 2008-9-6 02:18 发表


G80的ALU延迟应该远大于4。
具体可以查询文档。里面提到为了避免register l/s hazard,需要的最小线程数字。
我认为4 cycle的设计只是为了简化/节约调度器的复杂度而已。
偶看对于常用计算指令:
一条算数指令的延迟是固定的,不同算数种类的指令有不同的延迟。


而主要算数指令fadd, fmul, madd,iadd等的延迟应该就是4。 
例如下面有两条指令,指令2对指令1是有dependent关系的,而指令2一定是可以4个cycles后就能保证正确性了。
指令延迟说的就是dependent条件下的吞吐间隔。
  除非第二条指令需要等更多cycles才能保证正确性,那才能说是延迟超过4cycle。

指令1:fadd fr0=fr1+fr2
指令2:fadd fr2=fr0+fr0

pdf里的:
Arithmetic Instructions 
To issue one instruction for a warp, a multiprocessor takes:
4 clock cycles for:
single-precision floating-point add, multiply, and multiply-add,
integer add,
bitwise operations, compare, min, max, type conversion instruction; 
 __mul24 and __umul24 provide signed and unsigned 24-bit integer multiplication in 4
clock cycles.

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

偶前面说的“wrap”,可能和wrap有点区别。   wrap好像是一段“warp”,wrap是可以有很多“wrap”,一般可每隔4cycle发射一个"wrap", 偶说的"wrap"应该是构成wrap的最小指令单位sub.wrap,或最小的wrap,仅仅含有一条指令的基本wrap。

例如下面是一个wrap,含有两个"wrap","wrap"--fr0=fr1+fr2,与"wrap"--fr2=fr0+fr0
fadd fr0=fr1+fr2
fadd fr2=fr0+fr0

你知道偶的意思就行了,是说一个wrap单位(wrap unit)--对应一条指令。

[ 本帖最后由 gaiban 于 2008-9-6 10:40 编辑 ]

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 RacingPHT 于 2008-9-6 02:18 发表


G80的ALU延迟应该远大于4。
具体可以查询文档。里面提到为了避免register l/s hazard,需要的最小线程数字。
我认为4 cycle的设计只是为了简化/节约调度器的复杂度而已。
说的确切点,偶看"wrap"内的"4线程"是个假象,就是用8个ALU分4批实现32路SIMD。说寄存器数量的问题, 反正一个"wrap"里的寄存器本质上是一定要耗用32X8字节的寄存器空间,你去按32去除好了,你会有何发现? 正好对上了。

[ 本帖最后由 gaiban 于 2008-9-6 10:52 编辑 ]

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

"To issue one instruction for a warp, a multiprocessor takes: 4 clock cycles for:”
的意思是issue一个指令,这个和latency我认为完全没有关系。这个可以认为是throuput。

你只看到4 cycle,那么你看的很不购细。programming guide里面还有这样一段
"
Generally, accessing a register is zero extra clock cycles per instruction, but delays
may occur due to register read-after-write dependencies and register memory bank
conflicts.
The delays introduced by read-after-write dependencies can be ignored as soon as
there are at least 192 active threads per multiprocessor to hide them.
"
这里面有一些综合的信息。192 /  8 = 24,也就是说一个SM的最坏指令延迟大约是24 cycle。

另外一个信息来自Anandtech:
http://www.anandtech.com/video/showdoc.aspx?i=3334&p=6
http://anandtech.com/video/showdoc.aspx?i=3336
建议你可以看看。

"The latency is approximately 22 clocks (this is the 1.35 GHz clock on 8800 GTX), and it takes 4 clocks to execute an arithmetic instruction (ADD, MUL, MAD, etc,) for a whole warp."

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 RacingPHT 于 2008-9-6 12:32 发表
"To issue one instruction for a warp, a multiprocessor takes: 4 clock cycles for:”
的意思是issue一个指令,这个和latency我认为完全没有关系。这个可以认为是throuput。

你只看到4 cycle,那么你看的很不 ...
要保证后续有register-dependent关系的wrap指令的正确执行的话,是说等24个cycles后,才能被发射?!
偶还以为,4个cycles后就可以了。 要等24个cycle啊?!

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 Edison 于 2008-9-4 22:44 发表
  

在 Excel 里画了一个 G80/G100 的 SIMT 执行示意图,可能还不是很准确:



根据主要是:
“ E ...
那么一个HW thread一个fiber如何跑出64个GPU threads,其中一种形式见下图

即使是有 read-after-write dependencies,也仅需要64个GPU threads就能隐藏延迟,跑满载了。

而G80是需要at least 192 active threads。

[ 本帖最后由 gaiban 于 2008-9-6 23:46 编辑 ]

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

大家这么专业,我觉得如果能省一半电最好.

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

下一代GPU必然是是在NV30的基础上修补修补,然后重用标量架构。

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

为什么是nv30

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

Realworld Tech 的 Tesla II 体系架构报道:



http://www.realworldtech.com/page.cfm?ArticleID=RWT090808195242&p=7

“They’re the world’s leading designers and manufacturers of CPUs – how hard could it be to build a GPU? I mean, come on, how hard could it be? That crummy little company down the road builds them – we could build them in our sleep. Come on, how hard could it be?” ——NVIDIA David Kirk

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

在 G100 的 "dual issue" 实现上, RWT 也有比较清晰的阐述:

Dual 'Issue'

One of the interesting complexities of NVIDIA’s microarchitecture is the relationship between latency and throughput. In general, CPUs execute most operations in a single cycle - but the latency of the fastest operation for an SP core is 4 cycles. Since the SM can issue one warp instruction every 2 'fast' cycles, it should be possible to have multiple instructions in flight at once. In fact, this ability is what NVIDIA refers to as ‘dual issue’ – although in reality it is simply parallel execution across functional units. The SP cores execute one instruction over 4 cycles, and other execution units can be in use, processing a different warp instruction simultaneously.


Figure 6 – Dual 'Issue' for NVIDIA's Execution Units

As Figure 6 illustrates, the SM can issue a warp instruction every 2 clocks. In the first cycle, a MAD is issued to the FPU. Two cycles later, a MUL instruction is issued to the SFU. Two cycles after that, the FPU is free again and can execute another MAD. Two cycles after that, the SFU is free and can begin to execute a long running transcendental instruction. Using this technique, the computational throughput of the shader core is increased by 50%, while retaining the simplicity of issuing only one warp every 2 cycles, which simplifies the scoreboarding logic. Not all combinations can be executed in parallel. For instance, the double precision unit and the single precision units share logic and cannot be active simultaneously as a result.

“They’re the world’s leading designers and manufacturers of CPUs – how hard could it be to build a GPU? I mean, come on, how hard could it be? That crummy little company down the road builds them – we could build them in our sleep. Come on, how hard could it be?” ——NVIDIA David Kirk

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 Edison 于 2008-9-11 11:05 发表
Realworld Tech 的 Tesla II 体系架构报道:



http://www.realworldtech.com/page.cfm?ArticleID=RWT090808195242&p=7
 图上很清楚,硬件还是基于SIMD的。

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 Edison 于 2008-9-11 11:25 发表
在 G100 的 "dual issue" 实现上, RWT 也有比较清晰的阐述:

Dual 'Issue'

One of the interesting complexities of NVIDIA’s microarchitecture is the relationship between latency and throughput. In g ...
  cuda.pdf--是4个SP cycles发射一个wrap。RWT有笔误。
或者RWT说的"fast cycle"相当于2 SP cycles。

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

我记得 Issue 那里的频率是 1/2  SP。

“They’re the world’s leading designers and manufacturers of CPUs – how hard could it be to build a GPU? I mean, come on, how hard could it be? That crummy little company down the road builds them – we could build them in our sleep. Come on, how hard could it be?” ——NVIDIA David Kirk

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

偶细细的想了想SIMD分支的实现问题,偶看G80的SIMD分支处理原理应该是--

举个最简单的SIMD方式下实现基础性if-else分支的例子来说明,所有if-else映射到汇编语言,实际上一般就是一条条具体的分支指令--当条件不成立时继续执行,当条件成立时跳转--或者向前跳,或向后跳转。

假定指令1-6都是一般的计算指令,分支指令branch B0为后向跳转分支(假设分支指令条件比较的结果是—有三个SP(true for SP2/6/7)需要向后跳到B0),具体wrap指令的软件顺序如下:


branch B0  //分支指令--如果成立,则跳到B0,如果不成立,则继续执行(if true, then goto B0)
instruction1  //计算指令1
instruction2  //指令2
instruction3  //指令3
instruction4  //指令4
B0:         //分支入口B0
instruction5  //指令5
instruction6  //指令6


那么硬件处理该SIMD分支指令时,就需要指令1-6都被执行,其执行顺序(execution order)与掩盖模式如下:

instruction1&mask2|6|7  //执行指令1时,但掩盖(mask)SP2、SP6、SP7的计算
instruction2&mask2|6|7  //执行指令2时,但掩盖(mask)SP2、SP6、SP7的计算
instruction3&mask2|6|7  //执行指令3时,但掩盖(mask)SP2、SP6、SP7的计算
instruction4&mask2|6|7  //执行指令4时,但掩盖(mask)SP2、SP6、SP7的计算
instruction5  //正常执行指令5,即8个SP都进行计算
instruction6  //正常执行指令6,即8个SP都进行计算


而对前向分支的处理,可能要复杂一点。至于比较复杂的分支指令(例如使用多个独立的计数器)或多个分支嵌套的情况,则有可能出现需要很多次迭代执行,效率极低,但其基础实现思想都是类似于上面原理的。

[ 本帖最后由 gaiban 于 2008-9-11 18:27 编辑 ]

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

引用:
原帖由 RacingPHT 于 2008-9-6 12:32 发表
"To issue one instruction for a warp, a multiprocessor takes: 4 clock cycles for:”
的意思是issue一个指令,这个和latency我认为完全没有关系。这个可以认为是throuput。

你只看到4 cycle,那么你看的很不 ...
关于底层是基于SIMD,nv已经确认。
而且很有类似与32路的SIMD。

偶的分析达到了无比精准的地步。

另外还有多个线程内的指令会像类似OOO-E模式的发射wrap-instruction,也说对了。

当然了,Eji大大确实很牛X。还是Eji说的对,G80是指令级的OOO-E处理器。而OOO发射的必要条件是多线程。也可以视为数据级OOO。单个线程内可能还是in-order。

[ 本帖最后由 gaiban 于 2008-10-1 16:37 编辑 ]

TOP

[广告] 买猫头鹰CPU散热器特价,还送i7 扣具一套! | Vista降临,PC够强吗?远景带您进入绚烂的美化世界

G80的shader架构师与cuda的硬件架构师John Erik Lindholm准确的描述了G80的多线程SIMD硬件:
System and method for processing thread groups in a SIMD architecture
United States Patent 20070130447Kind Code:
A1





Abstract:
A SIMD processor efficiently utilizes its hardware resources to achieve higher data processing throughput. The effective width of a SIMD processor is extended by clocking the instruction processing side of the SIMD processor at a fraction of the rate of the data processing side and by providing multiple execution pipelines, each with multiple data paths. As a result, higher data processing throughput is achieved while an instruction is fetched and issued once per clock. This configuration also allows a large group of threads to be clustered and executed together through the SIMD processor so that greater memory efficiency can be achieved for certain types of operations like texture memory accesses performed in connection with graphics processing.
http://www.freepatentsonline.com/y2007/0130447.html


[ 本帖最后由 gaiban 于 2008-10-1 16:59 编辑 ]

TOP

[广告]