Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix model compression error #1043

Merged
merged 2 commits into from
Aug 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/lib/src/cuda/tabulate.cu
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ __global__ void tabulate_fusion_grad_fifth_order_polynomial(
bool unloop = false;
FPTYPE * iteratorA = (FPTYPE *)&_data[0]; // dy
for (int ii = 0; ii < MTILE; ii++) {
if (thread_idx < last_layer_size) {
iteratorA[ii * last_layer_size + thread_idx] = dy[block_idx * MTILE * last_layer_size + ii * last_layer_size + thread_idx];
for (int jj = thread_idx; jj < last_layer_size; jj += blockDim.x) {
iteratorA[ii * last_layer_size + jj] = dy[block_idx * MTILE * last_layer_size + ii * last_layer_size + jj];
}
}
__syncthreads();
Expand Down
5 changes: 2 additions & 3 deletions source/lib/src/rocm/tabulate.hip.cu
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define TPB 256
#define WARP_SIZE 64
#define FULL_MASK 0xffffffff
#include "gpu_rocm.h"

template <typename FPTYPE>
__forceinline__ __device__
Expand Down Expand Up @@ -140,8 +139,8 @@ __global__ void tabulate_fusion_grad_fifth_order_polynomial(
bool unloop = false;
FPTYPE * iteratorA = (FPTYPE *)&_data[0]; // dy
for (int ii = 0; ii < MTILE; ii++) {
if (thread_idx < last_layer_size) {
iteratorA[ii * last_layer_size + thread_idx] = dy[block_idx * MTILE * last_layer_size + ii * last_layer_size + thread_idx];
for (int jj = thread_idx; jj < last_layer_size; jj += blockDim.x) {
iteratorA[ii * last_layer_size + jj] = dy[block_idx * MTILE * last_layer_size + ii * last_layer_size + jj];
}
}
__syncthreads();
Expand Down
1 change: 1 addition & 0 deletions source/op/tabulate_multi_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ class TabulateFusionGradGradOp : public OpKernel {
dz_dy,
table, table_info, em_x, em, dz_dy_dem_x, dz_dy_dem, nloc, nnei, last_layer_size);
#endif // TENSORFLOW_USE_ROCM
OP_REQUIRES (context, (last_layer_size <= 1024), errors::InvalidArgument ("In the process of model compression, the size of the last layer of embedding net must be less than 1024!"));
}
else if (device == "CPU") {
deepmd::tabulate_fusion_grad_grad_cpu(
Expand Down