Efficient ReliK 2 Possible Parallelization Idea
Some ideas from Maximilian.
Recap Pseudo Code
Look at the Pseudo code again:
Input: KG , triple , embedding score function , sample size
Output: or
sample triples from ; sample triples from .
;
for do
If then
if then
if then
return for
or for
Ideas for Parallelization
Idea 1 Parallel Sampling
Sampling the negative sets and can be done in parallel for both head and tail entities. GPU-based libraries like PyTorch can handle large-scale sampling efficiently on GPUs.
I will think about it.
Idea 2 Rank Update
For each sampled triple , it can be parallelized across all samples in . For-parallel
GPUs are very efficient at handling this kind of parallel computation, especially with batched matrix operations.
✅I will be working on this.
Will there be some write-after-write or read-after-write issues? Should I add some write-lock?
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment
GiscusGitalk