MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/kernels/embedding_variable_performance_test.cc:183–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183TEST(EmbeddingVariablePerformanceTest, TestLookupOrCreate) {
184 int num_of_batch = 100;
185 int batch_size = 1024 * 128;
186 int num_of_ids = 5000000;
187 std::vector<std::vector<int64>> input_batches(num_of_batch);
188 for (int i = 0; i < num_of_batch; i++) {
189 input_batches[i].resize(batch_size);
190 }
191 LOG(INFO)<<"[TestLookupOrCreate] Start generating skew input";
192 GenerateSkewInput(num_of_ids, 0.8, input_batches);
193 LOG(INFO)<<"[TestLookupOrCreate] Finish generating skew input";
194 std::vector<int> num_thread_vec({1, 2, 4, 8, 16});
195 for (auto num_thread: num_thread_vec) {
196 LOG(INFO)<<"[TestLookupOrCreate] Test LookupOrCreate With "
197 <<num_thread<<" threads.";
198 double exec_time = PerfLookupOrCreate(input_batches, num_thread);
199 if (exec_time == -1.0) {
200 LOG(INFO)<<"[TestLookupOrCreate] Test Failed";
201 } else {
202 LOG(INFO)<<"[TestLookupOrCreate] Performance of LookupOrCreate With "
203 <<num_thread<<" threads: "<<exec_time/1000000<<" ms";
204 }
205 }
206}
207
208void thread_lookup(
209 EmbeddingVar<int64, float>* ev,

Callers

nothing calls this directly

Calls 14

GenerateSkewInputFunction · 0.85
PerfLookupOrCreateFunction · 0.85
GenerateSkewIdsFunction · 0.85
CreateEmbeddingVarFunction · 0.85
InitSkewInputBatchFunction · 0.85
PerfLookupFunction · 0.85
PerfSaveFunction · 0.85
powClass · 0.70
TensorShapeClass · 0.50
resizeMethod · 0.45
sizeMethod · 0.45
LookupOrCreateKeyMethod · 0.45

Tested by

no test coverage detected