nvdla / hw

RTL, Cmodel, and testbench for NVDLA
Other
1.67k stars 561 forks source link

How does the data and weight is handled in NVDLA? #358

Closed mtsanic closed 2 years ago

mtsanic commented 2 years ago

Hi,

I am working on nv_small with LeNet on VP (prototxt for it given in the attachment given as txt). I am trying to understand how the data and weight is accepted and convoluted.

The first layer should accept 28x28x1 image. It should be convoluted with 5x5x20 kernels. The total number of convolutions should be 24x24x20=11520.

Second convolution layer accepts 12x12x20 data. It should be convoluted with 5x5x50 kernels. The total number of convolutions should be 8x8x20x50=64000.

The total number of convolutions should be 75520.

When I check the results counters for individual convolution operations 476160 times.

When I check CSC logs, it seems data is called 59519 times. The input image is somehow divided into 4 channels. Kernel width for first convolution layer is decreased to 1 (which should be 5). csc.log is also given in the below.

All these information still doesn't help me understand how the data and weight is accepted and convoluted in NVDLA.

I appreciate any help I can get

lenet.txt csc.log

mtsanic commented 2 years ago

In-memory data formats section (http://nvdla.org/hw/format.html) in hardware manual shows most of the data input-output. If anyone wants to understand further, I suggest printing all data to output and reading them.