@@ -61,6 +61,10 @@ void TabulateFusionSeAForward(const torch::Tensor& table_tensor,
61
61
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
62
62
deepmd::tabulate_fusion_se_a_gpu (descriptor, table, table_info, em_x, em,
63
63
two_embed, nloc, nnei, last_layer_size);
64
+ #else
65
+ throw std::runtime_error (
66
+ " The input tensor is on the GPU, but the GPU support for the "
67
+ " customized OP library is not enabled." );
64
68
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
65
69
} else if (device == " CPU" ) {
66
70
deepmd::tabulate_fusion_se_a_cpu (descriptor, table, table_info, em_x, em,
@@ -110,6 +114,10 @@ void TabulateFusionSeAGradForward(const torch::Tensor& table_tensor,
110
114
deepmd::tabulate_fusion_se_a_grad_gpu (dy_dem_x, dy_dem, dy_dtwo, table,
111
115
table_info, em_x, em, two_embed, dy,
112
116
nloc, nnei, last_layer_size);
117
+ #else
118
+ throw std::runtime_error (
119
+ " The input tensor is on the GPU, but the GPU support for the "
120
+ " customized OP library is not enabled." );
113
121
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
114
122
} else if (device == " CPU" ) {
115
123
deepmd::tabulate_fusion_se_a_grad_cpu (dy_dem_x, dy_dem, dy_dtwo, table,
@@ -166,6 +174,10 @@ void TabulateFusionSeAGradGradForward(const torch::Tensor& table_tensor,
166
174
deepmd::tabulate_fusion_se_a_grad_grad_gpu (
167
175
dz_dy, table, table_info, em_x, em, two_embed, dz_dy_dem_x, dz_dy_dem,
168
176
dz_dy_dtwo, nloc, nnei, last_layer_size, is_sorted);
177
+ #else
178
+ throw std::runtime_error (
179
+ " The input tensor is on the GPU, but the GPU support for the "
180
+ " customized OP library is not enabled." );
169
181
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
170
182
TORCH_CHECK (last_layer_size <= 1024 ,
171
183
" In the process of model compression, the size of the "
@@ -212,6 +224,10 @@ void TabulateFusionSeTForward(const torch::Tensor& table_tensor,
212
224
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
213
225
deepmd::tabulate_fusion_se_t_gpu (descriptor, table, table_info, em_x, em,
214
226
nloc, nnei_i, nnei_j, last_layer_size);
227
+ #else
228
+ throw std::runtime_error (
229
+ " The input tensor is on the GPU, but the GPU support for the "
230
+ " customized OP library is not enabled." );
215
231
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
216
232
} else if (device == " CPU" ) {
217
233
deepmd::tabulate_fusion_se_t_cpu (descriptor, table, table_info, em_x, em,
@@ -254,6 +270,10 @@ void TabulateFusionSeTGradForward(const torch::Tensor& table_tensor,
254
270
deepmd::tabulate_fusion_se_t_grad_gpu (dy_dem_x, dy_dem, table, table_info,
255
271
em_x, em, dy, nloc, nnei_i, nnei_j,
256
272
last_layer_size);
273
+ #else
274
+ throw std::runtime_error (
275
+ " The input tensor is on the GPU, but the GPU support for the "
276
+ " customized OP library is not enabled." );
257
277
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
258
278
} else if (device == " CPU" ) {
259
279
deepmd::tabulate_fusion_se_t_grad_cpu (dy_dem_x, dy_dem, table, table_info,
@@ -300,6 +320,10 @@ void TabulateFusionSeTGradGradForward(const torch::Tensor& table_tensor,
300
320
deepmd::tabulate_fusion_se_t_grad_grad_gpu (dz_dy, table, table_info, em_x,
301
321
em, dz_dy_dem_x, dz_dy_dem, nloc,
302
322
nnei_i, nnei_j, last_layer_size);
323
+ #else
324
+ throw std::runtime_error (
325
+ " The input tensor is on the GPU, but the GPU support for the "
326
+ " customized OP library is not enabled." );
303
327
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
304
328
TORCH_CHECK (last_layer_size <= 1024 ,
305
329
" In the process of model compression, the size of the "
@@ -340,6 +364,10 @@ void TabulateFusionSeRForward(const torch::Tensor& table_tensor,
340
364
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
341
365
deepmd::tabulate_fusion_se_r_gpu (descriptor, table, table_info, em, nloc,
342
366
nnei, last_layer_size);
367
+ #else
368
+ throw std::runtime_error (
369
+ " The input tensor is on the GPU, but the GPU support for the "
370
+ " customized OP library is not enabled." );
343
371
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
344
372
} else if (device == " CPU" ) {
345
373
deepmd::tabulate_fusion_se_r_cpu (descriptor, table, table_info, em, nloc,
@@ -376,6 +404,10 @@ void TabulateFusionSeRGradForward(const torch::Tensor& table_tensor,
376
404
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
377
405
deepmd::tabulate_fusion_se_r_grad_gpu (dy_dem, table, table_info, em, dy,
378
406
nloc, nnei, last_layer_size);
407
+ #else
408
+ throw std::runtime_error (
409
+ " The input tensor is on the GPU, but the GPU support for the "
410
+ " customized OP library is not enabled." );
379
411
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
380
412
} else if (device == " CPU" ) {
381
413
deepmd::tabulate_fusion_se_r_grad_cpu (dy_dem, table, table_info, em, dy,
@@ -412,6 +444,10 @@ void TabulateFusionSeRGradGradForward(const torch::Tensor& table_tensor,
412
444
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM
413
445
deepmd::tabulate_fusion_se_r_grad_grad_gpu (
414
446
dz_dy, table, table_info, em, dz_dy_dem, nloc, nnei, last_layer_size);
447
+ #else
448
+ throw std::runtime_error (
449
+ " The input tensor is on the GPU, but the GPU support for the "
450
+ " customized OP library is not enabled." );
415
451
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
416
452
TORCH_CHECK (last_layer_size <= 1024 ,
417
453
" In the process of model compression, the size of the "
0 commit comments