Commit 0b86a634 authored by Cautiousss's avatar Cautiousss Committed by binmakeswell
Browse files

[NFC] polish colossalai/kernel/cuda_native/csrc/kernels/cross_entropy.cu code style (#953)


Co-authored-by: default avatar何晓昕 <cautious@hexiaoxins-MacBook-Pro.local>
parent d8d07b0e
...@@ -16,7 +16,7 @@ __global__ void ls_cross_entropy_fw_kernel( ...@@ -16,7 +16,7 @@ __global__ void ls_cross_entropy_fw_kernel(
const int left_idx = block_start + threadIdx.x; const int left_idx = block_start + threadIdx.x;
const int right_idx = (blockIdx.x + 1) * vocab_size; const int right_idx = (blockIdx.x + 1) * vocab_size;
float max_input[1] = {REDUCE_FLOAT_INF_NEG}; float max_input[1] = {REDUCE_FLOAT_INF_NEG};
float sum_logits[2] = {0.f, 0.f}; // logit and logit exp float sum_logits[2] = {0.f, 0.f}; // logit and logit exp
int target_tid = targets[blockIdx.x]; int target_tid = targets[blockIdx.x];
if (target_tid == padding_idx) { if (target_tid == padding_idx) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment