New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于复现ESRF模型转为torch的问题 #200
Comments
基于batch的优化可以缓解这个问题。之前我们实验的时候也使用了一些trick才完成。我们后续会尽快重构原来实验用的代码版本,争取几天内上线。可以稍待几天,目前这个版本的代码在2080上运行douban和lastfm是可以的,在更多用户的数据集上运行,需要将完整数据拆分卷积。 |
好的,谢谢于老师 |
Hi, |
好的 |
@happylee Hi, ESRF的114行代码我做了一些变动,每次只为100个用户生成alternative neighborhood,空间会节约很多。这个数字还可以变动以适应更大的数据集。感觉这个trick比之前我用的更方便,performance方面变化也不大。你可以在你的implementation里面用类似的方法。 |
好的,非常感谢于老师 |
于老师,您好!我最近在将ESRF的代码转为torch的版本,但是在计算可替代邻居的部分占用了太大的内存消耗,self.alternativeNeighborhood = tf.vectorized_map(fn=lambda em:getAlternativeNeighborhood(em),elems=user_features),这句我转换为了循环函数,for elems in user_features: alternativeNeighborhood.append(getAlternativeNeighborhood(elems)),但是在用稍微大一点的数据集如Ciao时,都会内存溢出(如Ciao,7375个user,在为第700多个用户计算可替代邻居时内存就满了,8G的显存)。在打印GPU的使用情况发现,就是这句代码为每个用户计算时,占用了特别大内存消耗。然后我在这部分仅仅计算每个batch的users的可替代邻居,但是最后计算损失函数,又没有可替代邻居的embedding时,因此想请教老师,有什么能解决这句代码内存消耗的方法吗?
The text was updated successfully, but these errors were encountered: