Skip to content

Commit

Permalink
use memcpy for cpu emb inplace update (pytorch#2166)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#2166

Reviewed By: zyan0, sayitmemory

Differential Revision: D51539017
  • Loading branch information
842974287 authored and facebook-github-bot committed Nov 28, 2023
1 parent 035ed1f commit 4595093
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ void embedding_inplace_update_cpu_kernel(

const uint8_t* __restrict__ update_weight_row =
&update_weights[update_weight_offset];
for (const auto d : c10::irange(D_bytes)) {
weight_row[d] = update_weight_row[d];
}
memcpy(weight_row, update_weight_row, D_bytes);
}
}

Expand Down

0 comments on commit 4595093

Please sign in to comment.