Skip to content

Commit 08d6322

Browse files
Zheng Yanfacebook-github-bot
authored andcommitted
create cumem_utils_cpu and add to all_deps_cpu (#2215)
Summary: Fix Could not find any similar ops to fbgemm::new_unified_tensor.: P876042425 At model loading using IntNBitTableBatchedEmbeddingBagsCodegen, we got Could not find any similar ops to fbgemm::new_unified_tensor. P876042425 The error line https://fburl.com/code/j41vcjg1 means we lack dependency of new_unified_tensor in full cpu predictor build. This diff adds the dep. Reviewed By: jiayisuse Differential Revision: D52176309
1 parent e6a246d commit 08d6322

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

fbgemm_gpu/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ if(NOT FBGEMM_CPU_ONLY)
601601
codegen/embedding_bounds_check_host.cpp
602602
src/memory_utils/memory_utils.cpp
603603
src/memory_utils/memory_utils_ops.cpp
604+
src/memory_utils/memory_utils_ops_cpu.cpp
604605
src/layout_transform_ops/layout_transform_ops_gpu.cpp
605606
src/permute_pooled_embedding_ops/permute_pooled_embedding_ops_gpu.cpp
606607
src/permute_pooled_embedding_ops/permute_pooled_embedding_ops_split_gpu.cpp

fbgemm_gpu/src/memory_utils/memory_utils_ops.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ TORCH_LIBRARY_FRAGMENT(fbgemm, m) {
2323
m.def("uvm_to_cpu(Tensor t) -> Tensor");
2424
m.def("new_managed_tensor(Tensor self, int[] sizes) -> Tensor");
2525
m.def("new_host_mapped_tensor(Tensor self, int[] sizes) -> Tensor");
26-
m.def(
27-
"new_unified_tensor(Tensor self, int[] sizes, bool is_host_mapped) -> Tensor");
2826
m.def("new_vanilla_managed_tensor(Tensor self, int[] sizes) -> Tensor");
2927
m.def(
3028
"cuda_mem_advise(Tensor t, int advice) -> ()",
@@ -41,7 +39,6 @@ TORCH_LIBRARY_FRAGMENT(fbgemm, m) {
4139
}
4240

4341
TORCH_LIBRARY_FRAGMENT(fbgemm, m) {
44-
DISPATCH_TO_CPU("new_unified_tensor", new_unified_tensor_cpu);
4542
DISPATCH_TO_META("new_managed_tensor", new_managed_tensor_meta);
4643
}
4744

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
8+
9+
#include <torch/library.h>
10+
#include "common.h"
11+
#include "fbgemm_gpu/sparse_ops_utils.h"
12+
13+
using Tensor = at::Tensor;
14+
15+
namespace fbgemm_gpu {
16+
17+
TORCH_LIBRARY_FRAGMENT(fbgemm, m) {
18+
m.def(
19+
"new_unified_tensor(Tensor self, int[] sizes, bool is_host_mapped) -> Tensor");
20+
}
21+
22+
TORCH_LIBRARY_FRAGMENT(fbgemm, m) {
23+
DISPATCH_TO_CPU("new_unified_tensor", new_unified_tensor_cpu);
24+
}
25+
26+
} // namespace fbgemm_gpu

0 commit comments

Comments
 (0)