NVIDIA-Merlin / HugeCTR

HugeCTR is a high efficiency GPU framework designed for Click-Through-Rate (CTR) estimating training
Apache License 2.0
905 stars 196 forks source link

[BUG] Slot calculation error in static_hash_table.cu #452

Open Jiaao-Bai opened 2 weeks ago

Jiaao-Bai commented 2 weeks ago

Describe the bug in gpu_cache/src/static_hash_table.cu, line 117, why slot accumulate again? it seems like slot already in next group before line 117 企业微信截图_89159d0f-506f-4a92-a122-33ecd72b4782

To Reproduce

Expected behavior

Screenshots

Environment (please complete the following information):

Additional context

Jiaao-Bai commented 2 weeks ago

if "& (capacity - 1)" clear the lower bits, then step 0 run twice

RayWang96 commented 1 day ago

I'm not the author of this code, but I can give some comments. In my understanding, this is a variant of the linear probing method for hash. Line 117 is used to probe different hash addresses. Since the author assumes that the capacity is a power of 2, "& (capacity - 1)" is equivalent to "% capacity". I don't think the step 0 will run twice, it should probe a different address when the loop continue.