nvdla study 記憶體資料格式

2021-10-04 11:55:18 字數 1986 閱讀 4426

理解nvdla設計,首先必須頭腦中對資料格式及其記憶體存放形式有個清晰的認識。

1 輸入格式

1)weightdata輸入格式:

weight for direct convolution

weight for image input

weight for winograd convolution

2)activation data輸入格式:

feature data format

pixel format (roi input)

2 輸出格式

feature data format

bias data

prelu data

batch-normalization data

element-wise data

3 精度型別

支援三種精度:int8,int16,fp16

影象在運算前被轉成一種型別。featuredata可以是任一一種型別。

引擎支援動態轉換型別,需要遵循以下規則:

1)nvdla convolution pipeline supports precision conversion for image

input mode only.

2)direct convolution (dc) mode and winograd convolution mode do not

support precision conversion

3)for image input mode (please see section 6.1.1.4), pipeline allows

conversion from integer to all 3 types. floating point images can

only be converted to fp16.

3)batch-normalization and element-wise layer (implemented in sdp)

support free conversion of int16 <-> fp16 and int8 <-> int16 for dc

mode only.

4)lrn layer (implemented in cdp) does not support any precision

conversion

5)pooling layer (implemented in pdp) does not support any precision

conversion.

4 feature data format

feature data是以3d cube(wxhxc)形式組織。進一步把這個大的cube,拆分成1x1x32byte的形式,這個小的cube被稱為atom cube。

記憶體存放以以下掃瞄順序:

c』 (32byte) -> w -> h -> c (su***ces)

5weight format

每個kernel也是以3d cube(wxhxc)形式組織。有多個kernel,用group來組織。每個cube進一步分成1x1x64-element small cube。根據精度型別,可以是1x1x128byte或者1x1x64byte。

記憶體存放以以下掃瞄順序:

按kernel group單位,掃瞄每個kernel group的順序:

c』->k->w->h->c

正常情況下, 乙個 atom 包含 1x1x32bytes data, 但是下面情況不再遵守

:bias data format;

prelu data format;

batch normalization data format;

element-wise data format

bytesperatom=elementperatom * componentsperelement * bytespercomponent

總結:注意cube的組織。每種硬體層有不同的資料組織格式。

資料互動xml json protobuf格式比較

資料互動xml json protobuf格式比較 1 json 一般的web專案中,最流行的主要還是json。因為瀏覽器對於json資料支援非常好,有很多內建的函式支援。2 xml 在webservice中應用最為廣泛,但是相比於json,它的資料更加冗餘,因為需要成對的閉合標籤。json使用了鍵...

單元格資料驗證

gridview中 的 cellvaluechanging 和 cellvaluechanged 事件搭配使用。cellvaluechanging 發生在事件改變之前,所以可以使用 它儲存之前的值 value1。cellvaluechanging 發生在事件改變之後,所以可以使用它進行驗證 改變後的...

讀取單元格資料

最近,我在用c 開發乙個excel add in的時候,發現了一些害人不淺的坑,特來總結列舉如下 這裡我讀寫excel引用的是using excel microsoft.office.interop.excel 問題一 如何判斷乙個單元格去除首尾空格後是不是空的 在獲取單元格內的文字內容進行判斷時,...