Skip to content

Commit

Permalink
Adding explicit instantiation to all parameter server and embedding c…
Browse files Browse the repository at this point in the history
…ache class, adding src files to CMakeList
  • Loading branch information
Fan Yu committed Jan 5, 2021
1 parent eac1274 commit f10565a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 3 deletions.
3 changes: 0 additions & 3 deletions HugeCTR/include/inference/embedding_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#include <inference/embedding_interface.hpp>
#include <inference/gpu_cache/nv_gpu_cache.hpp>

#define SET_ASSOCIATIVITY 2
#define SLAB_SIZE 32

namespace HugeCTR {

template <typename TypeHashKey>
Expand Down
3 changes: 3 additions & 0 deletions HugeCTR/include/inference/gpu_cache/nv_gpu_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <cuda/std/semaphore>
#endif

#define SET_ASSOCIATIVITY 2
#define SLAB_SIZE 32

namespace cg = cooperative_groups;

namespace HugeCTR {
Expand Down
5 changes: 5 additions & 0 deletions HugeCTR/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ file(GLOB huge_ctr_src
inference/inference_utils.cpp
inference/embedding_cache.cpp
inference/session_inference.cpp
inference/embedding_cache.cu
inference/embedding_interface.cpp
inference/parameter_server.cpp
inference/inference_utilis.cpp
inference/gpu_cache/nv_gpu_cache.cu
data_readers/metadata.cpp
metrics.cu
optimizers/adam_optimizer.cu
Expand Down
2 changes: 2 additions & 0 deletions HugeCTR/src/inference/embedding_cache.cu
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,6 @@ void embedding_cache<TypeHashKey>::destroy_workspace(embedding_cache_workspace&
}
}

template class embedding_cache<unsigned int>;
template class embedding_cache<long long>;
} // namespace HugeCTR
12 changes: 12 additions & 0 deletions HugeCTR/src/inference/embedding_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,16 @@ embedding_interface* embedding_interface::Create_Embedding_Cache(HugectrUtility<
return embedding_cache;
}

template embedding_interface* embedding_interface::Create_Embedding_Cache<unsigned int>(HugectrUtility<unsigned int>*
int,
bool,
float,
const std::string&,
const std::string&);
template embedding_interface* embedding_interface::Create_Embedding_Cache<long long>(HugectrUtility<long long>*
int,
bool,
float,
const std::string&,
const std::string&);
} // namespace HugeCTR
2 changes: 2 additions & 0 deletions HugeCTR/src/inference/gpu_cache/nv_gpu_cache.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1231,5 +1231,7 @@ Replace(const key_type* d_keys,
}
#endif

template class gpu_cache<unsigned int, uint64_t, std::numeric_limits<unsigned int>::max(), SET_ASSOCIATIVITY, SLAB_SIZE>;
template class gpu_cache<long long, uint64_t, std::numeric_limits<long long>::max(), SET_ASSOCIATIVITY, SLAB_SIZE>;
} // namespace gpu_cache
} // namespace HugeCTR
2 changes: 2 additions & 0 deletions HugeCTR/src/inference/inference_utilis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ HugectrUtility<TypeHashKey>* HugectrUtility<TypeHashKey>::Create_Parameter_Serve
return parameter_server;
}

template class HugectrUtility<unsigned int>;
template class HugectrUtility<long long>;
} // namespace HugeCTR
2 changes: 2 additions & 0 deletions HugeCTR/src/inference/parameter_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,6 @@ void parameter_server<TypeHashKey>::look_up(const TypeHashKey* h_embeddingcolumn
}
}

template class parameter_server<unsigned int>;
template class parameter_server<long long>;
} // namespace HugeCTR

0 comments on commit f10565a

Please sign in to comment.