Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nahso committed Oct 4, 2023
1 parent b489322 commit 786fb14
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 85 deletions.
6 changes: 3 additions & 3 deletions source/lib/src/gpu/tabulate.cu
Original file line number Diff line number Diff line change
Expand Up @@ -792,9 +792,9 @@ void tabulate_fusion_se_a_grad_grad_gpu(FPTYPE* dz_dy,
DPErrcheck(gpuMemset(dz_dy, 0, sizeof(FPTYPE) * nloc * 4 * last_layer_size));
tabulate_fusion_se_a_grad_grad_fifth_order_polynomial<FPTYPE, MM, KK>
<<<nloc, last_layer_size, sizeof(FPTYPE) * MM * last_layer_size>>>(
dz_dy, table, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem, table_info[0],
table_info[1], table_info[2], table_info[3], table_info[4], nnei,
last_layer_size, is_sorted);
dz_dy, table, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem,
table_info[0], table_info[1], table_info[2], table_info[3],
table_info[4], nnei, last_layer_size, is_sorted);
DPErrcheck(gpuGetLastError());
DPErrcheck(gpuDeviceSynchronize());
}
Expand Down
164 changes: 82 additions & 82 deletions source/op/tabulate_multi_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,17 @@ class TabulateFusionSeAGradGradOp : public OpKernel {
if (device == "GPU") {
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
deepmd::tabulate_fusion_se_a_grad_grad_gpu(
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem, nloc,
nnei, last_layer_size, is_sorted);
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem,
nloc, nnei, last_layer_size, is_sorted);

Check warning on line 339 in source/op/tabulate_multi_device.cc

View check run for this annotation

Codecov / codecov/patch

source/op/tabulate_multi_device.cc#L339

Added line #L339 was not covered by tests
#endif // GOOGLE_CUDA || 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_se_a_grad_grad_cpu(
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem, nloc,
nnei, last_layer_size, is_sorted);
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem,
nloc, nnei, last_layer_size, is_sorted);

Check warning on line 348 in source/op/tabulate_multi_device.cc

View check run for this annotation

Codecov / codecov/patch

source/op/tabulate_multi_device.cc#L348

Added line #L348 was not covered by tests
}
}

Expand Down Expand Up @@ -549,17 +549,17 @@ class TabulateFusionSeAttenGradGradOp : public OpKernel {
if (device == "GPU") {
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
deepmd::tabulate_fusion_se_a_grad_grad_gpu(

Check warning on line 551 in source/op/tabulate_multi_device.cc

View check run for this annotation

Codecov / codecov/patch

source/op/tabulate_multi_device.cc#L551

Added line #L551 was not covered by tests
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem, nloc,
nnei, last_layer_size, is_sorted);
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem,
nloc, nnei, last_layer_size, is_sorted);

Check warning on line 553 in source/op/tabulate_multi_device.cc

View check run for this annotation

Codecov / codecov/patch

source/op/tabulate_multi_device.cc#L553

Added line #L553 was not covered by tests
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
OP_REQUIRES(context, (last_layer_size <= 1024),

Check warning on line 555 in source/op/tabulate_multi_device.cc

View check run for this annotation

Codecov / codecov/patch

source/op/tabulate_multi_device.cc#L555

Added line #L555 was not covered by tests
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_se_a_grad_grad_cpu(

Check warning on line 560 in source/op/tabulate_multi_device.cc

View check run for this annotation

Codecov / codecov/patch

source/op/tabulate_multi_device.cc#L560

Added line #L560 was not covered by tests
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem, nloc,
nnei, last_layer_size, is_sorted);
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem,
nloc, nnei, last_layer_size, is_sorted);

Check warning on line 562 in source/op/tabulate_multi_device.cc

View check run for this annotation

Codecov / codecov/patch

source/op/tabulate_multi_device.cc#L562

Added line #L562 was not covered by tests
}
}

Expand Down Expand Up @@ -975,81 +975,81 @@ REGISTER_CPU(float);
REGISTER_CPU(double);

#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
#define REGISTER_GPU(T) \
REGISTER_KERNEL_BUILDER(Name("TabulateFusion") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAGradGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeA") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAGradGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAtten") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAttenOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAttenGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAttenGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAttenGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
#define REGISTER_GPU(T) \
REGISTER_KERNEL_BUILDER(Name("TabulateFusion") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAGradGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeA") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAGradGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAtten") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAttenOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAttenGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAttenGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeAttenGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeAttenGradGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeT") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeTOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeTGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeTGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeTGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeTGradGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeR") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeROp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeRGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeRGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeRGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeT") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeTOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeTGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeTGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeTGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeTGradGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeR") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeROp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeRGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeRGradOp<GPUDevice, T>); \
REGISTER_KERNEL_BUILDER(Name("TabulateFusionSeRGradGrad") \
.Device(DEVICE_GPU) \
.TypeConstraint<T>("T") \
.HostMemory("table_info"), \
TabulateFusionSeRGradGradOp<GPUDevice, T>);
REGISTER_GPU(float);
REGISTER_GPU(double);
Expand Down

0 comments on commit 786fb14

Please sign in to comment.