Re: [理工] [計組] performance相關計算已刪文

看板Grad-ProbAsk作者 (馬不理不思議)時間15年前 (2010/09/28 00:37), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串4/4 (看更多)
: By Amadal law, : 1/ ((0.4*1.5)/1.5+0.6/1.5) -1 =1/0.8 -1 =1.25 = 0.25. : When clock rate of CPU increases to 1.5 times than the origin, : the instructions of B and C types can also benefit from the improving. : For B and C: : CPU time = Cycle per instuction * Instuction count / Cycle rate. : ^^^^^^^^^^ : much higher : The reason is cycle rate, not the CPI, and the "0.6" is the percent of B and C : instructions. 我試著把我的癥結點盡量清楚地提出來 對我自己的認知來說 Amadal's law 是用在表達不同比例間"時間"上的壓縮  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ 這個方向很好想像非常好理解 那麼如果是在clock rate固定的情況 就可以推廣到"cycles數"上的壓縮 所以我們可以看到一般題目的敘述 都是提到不同class或是instr."執行時間"的比例  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ 但這題似乎並不是!? 按照題目敘述似乎表達的是各class間所佔"IC"的比例 照理來說Amadal's law所呈現的speedup比值公式結果是可以 從計算原CPUtime再推來的 如果我們來試試 這時候問題就來了 CPUtime[ori.]=(0.4a + kb + tc)*IC/clock rate CPUtime[new]=(0.4a*1.5 + kb + tc)*IC/ (clock rate*1.5) 這個比值並不像Amadal's law的結果 那我們再來看Amadal's law告訴我們的是什麼?? 解答的意思是 CPUtime[ori.]/CPUtime[new] = 1/ ((0.4*1.5)/1.5+0.6/1.5) 我把0.6換成(y+z) 0.4換成x 另外 CPUtime[ori]=total cycles[ori]/clock rate CPUtime[new]=total cycles[new]/(clock rate*1.5) 這兩式有點長先記著 CPUtime[ori]/CPUtime[new] = 1/ ((x*1.5)/1.5+(y+z)/1.5) 先換好好後1.5往右邊乘 CPUtime[ori] ((x*1.5)/1.5+(y+z)/1.5) = CPUtime[new] CPUtime[ori] (x*1.5+(y+z)) = 1.5* CPUtime[new] (total cycles[ori]/clock rate) (x*1.5+(y+z)) = 1.5 * (total cycles[new]/(clock rate*1.5)) 抱歉等式有點長 這時候黃色的可以約掉 total cycles[ori] (x*1.5+(y+z)) = total cycles[new] x*tc[ori]*1.5 + tc[ori](y+z)) = total cycles[new] 所以再次證明了x,y,z代表的是"cycle數"的比例 那這樣這個答案代表的並不是單純的CPI[A]變成1.5倍 因為"cycle數"的比例x,y,z中CPI[A]的影響並不是單純的相乘 比較一開始所說的 total cycles = (wa + kb + tc)*IC 則 x = (wa*IC) / [(wa + kb + tc)*IC] 就可以很清楚地看出來x是如何被CPI[A]影響的 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.230.132.47

09/28 22:20, , 1F
我覺得題目其實有點瑕疵 就像前面人家說的一樣
09/28 22:20, 1F

09/28 22:20, , 2F
我之前也是跟你有一樣的疑惑
09/28 22:20, 2F
文章代碼(AID): #1CeCXPPj (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1CeCXPPj (Grad-ProbAsk)