[英]Is there a way to limit Ray object storage max memory usage
我正在嘗試利用Ray的並行化模型來逐條記錄地處理文件記錄。 代碼工作得很漂亮,但是對象存儲增長很快,最終崩潰了。 我避免使用ray.get(function.remote()),因為它會降低性能,因為該任務由數百萬個子任務組成,而且還有等待任務完成的開銷。 有沒有辦法設置對象存儲的全局限制?
#code which constantly backpressusre the obejct storage, freeing space, but causes performance to be worse than serial execution
for record in infile:
ray.get(createNucleotideCount.remote(record, copy.copy(dinucDict), copy.copy(tetranucDict),dinucList,tetranucList, filename))
#code that maximizes throughput but makes the object storage grow constantly
for record in infile:
createNucleotideCount.remote(record, copy.copy(dinucDict), copy.copy(tetranucDict),dinucList,tetranucList, filename)
#the called function returns either 0 or 1.
您可以執行ray.init(object_store_memory=10**9)
將對象存儲限制為使用1GB。
在https://ray.readthedocs.io/en/latest/memory-management.html上有關內存管理的文檔中有更多信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.