Tensor Cores fixed

This commit is contained in:
AlexeyAB
2020-04-18 03:25:16 +03:00
parent d4b2ed9d22
commit 5dc7d8074d

View File

@ -420,8 +420,8 @@ void forward_convolutional_layer_gpu(convolutional_layer l, network_state state)
//#ifdef CUDNN_HALF
//if (state.use_mixed_precision) {
int iteration_num = get_current_iteration(state.net); // (*state.net.seen) / (state.net.batch*state.net.subdivisions);
if (state.index != 0 && state.net.cudnn_half && !l.xnor && (!state.train || iteration_num > 3 * state.net.burn_in) &&
(l.c / l.groups) % 8 == 0 && l.n % 8 == 0 && state.net.loss_scale != 1 && l.groups <= 1 && l.size > 1)
if (state.index != 0 && state.net.cudnn_half && !l.xnor && (!state.train || (iteration_num > 3 * state.net.burn_in) && state.net.loss_scale != 1) &&
(l.c / l.groups) % 8 == 0 && l.n % 8 == 0 && l.groups <= 1 && l.size > 1)
{
//printf("\n CUDNN_HALF!!! state.index = %d \n", state.index);
@ -672,8 +672,8 @@ void backward_convolutional_layer_gpu(convolutional_layer l, network_state state
//#ifdef CUDNN_HALF
int iteration_num = get_current_iteration(state.net); //(*state.net.seen) / (state.net.batch*state.net.subdivisions);
if (state.index != 0 && state.net.cudnn_half && !l.xnor && (!state.train || iteration_num > 3 * state.net.burn_in) &&
(l.c / l.groups) % 8 == 0 && l.n % 8 == 0 && state.net.loss_scale != 1 && l.groups <= 1 && l.size > 1)
if (state.index != 0 && state.net.cudnn_half && !l.xnor && (!state.train || (iteration_num > 3 * state.net.burn_in) && state.net.loss_scale != 1) &&
(l.c / l.groups) % 8 == 0 && l.n % 8 == 0 && l.groups <= 1 && l.size > 1)
{
const size_t input16_size = l.batch*l.c*l.w*l.h;
const size_t delta16_size = l.batch*l.n*l.out_w*l.out_h;