Skip to content

add cross norm hadamard#35

Open
ForFishes wants to merge 1 commit intopaddleboxfrom
upstream_hutuxian1/paddlebox
Open

add cross norm hadamard#35
ForFishes wants to merge 1 commit intopaddleboxfrom
upstream_hutuxian1/paddlebox

Conversation

@ForFishes
Copy link
Copy Markdown
Collaborator

add norm cross hadamard op.


kernel_normbackwardsummary_x0<<<GET_BLOCKS(norm_cols * ins_num),
CUDA_NUM_THREADS, 0, stream>>>(
norm_cols * ins_num, ins_num, norm_output, sum_grad, mean, scale,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

norm_output: x


size_t temp_storage_bytes;
cub::DeviceSegmentedReduce::Sum(NULL, temp_storage_bytes, norm_output,
sum_grad_buf, norm_cols, sum_offset,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sum_grad_buf: sum_x


template <typename T>
void nncross_norm_bp(int N, int embed_dim, int ins_num, const T* inputs,
T* norm_output, const T* norm_grad, T* grads, T* sum_grad,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y

sum_grad_buf, norm_cols, sum_offset,
sum_offset + 1, stream);

kernel_normbackwardsummary_plus_mean<<<GET_BLOCKS(norm_cols * ins_num),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accum variance


kernel_normbackwardsummary_plus_mean<<<GET_BLOCKS(norm_cols * ins_num),
CUDA_NUM_THREADS, 0, stream>>>(
norm_cols * ins_num, ins_num, norm_output, sum_grad, mean, scale,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

norm_output: variance

qingshui referenced this pull request in jiaoxuewu/PaddleBox Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants