Skip to content

Commit

Permalink
5th update
Browse files Browse the repository at this point in the history
  • Loading branch information
MinLiAmoy committed Aug 15, 2017
1 parent af0ddf4 commit 6147680
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cpp/accel/Accel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,10 @@ void top(
assert(n_inputs*WT_SIZE <= WT_WORDS*WORD_SIZE);
}

static Word dmem[2][CONVOLVERS][C_DMEM_WORDS];
static Word kh_mem[KH_WORDS];
static Word wt_mem[CONVOLVERS][C_WT_WORDS];
static Address kh_index = 0;
static Word dmem[2][5][HIDDEN_SIZE/DATA_PER_WORD];
//static Word kh_mem[KH_WORDS];
//static Word wt_mem[CONVOLVERS][C_WT_WORDS];
//static Address kh_index = 0;
static Address o_index = 0;

if (layer_mode[0]) {
Expand Down
2 changes: 1 addition & 1 deletion cpp/accel/Accel.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//-------------------------------------------------------------------

// ML: define
const unsigned Hid_SIZE = 256;
const unsigned Hid_SIZE = 128;
//

const unsigned CONVOLVERS = 2;
Expand Down
4 changes: 2 additions & 2 deletions cpp/accel/AccelTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ void set_weight_array_rnn(Word* w, const float* wts, unsigned layer_idx, unsigne
const unsigned M = M_tab[layer_idx-1];
const unsigned N = N_tab[layer_idx-1];

if ((weight_idx / 4) == 0) {
if ((weight_idx / 2) == 0) {
idx = M * N * weight_idx / WORD_SIZE; // ML: assume N = 128, than it's power of 2
//off = M*N*weight_idx%WORD_SIZE;
set_dense_weight_array(w[idx], wts, M, N);
} else {
idx = M * N * 4 / WORD_SIZE + N * N * (weight_idx-4) / WORD_SIZE;
idx = M * N * 4 / WORD_SIZE + N * N * weight_idx / 2 / WORD_SIZE;
set_dense_weight_array(w[idx], wts, N, N);
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/accel/AccelTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const unsigned N_tab[] = {128, 128, 256, 256, 512, 512, 1024, 1024, 10};
const unsigned T_tab[] = { 0, 1, 1, 1, 1, 1, 2, 2, 3}; // ML: the idx of LayerTypeEnum to the sequential layers
*/
const unsigned S_tab[] = { 1, 1, 1, 1};
const unsigned M_tab[] = { 65, 256, 256};
const unsigned N_tab[] = {256, 256, 65};
const unsigned M_tab[] = { 64, 128, 128};
const unsigned N_tab[] = {128, 128, 64};
const unsigned T_tab[] = { 0, 1, 2};
const unsigned widx_tab[] = { 0, 1, 2, 3, 4, 5, 6, 7, 18, 19, 20, 21, 22, 23, 24, 25, 36}//ML: need to be modifed. the dim should be N_W_LAYERS*N_LAYERS

Expand Down

0 comments on commit 6147680

Please sign in to comment.