liuneng1994 opened a new pull request, #6558:
URL: https://github.com/apache/incubator-gluten/pull/6558

   ## What changes were proposed in this pull request?
   
   将现有的通过spark管理内存并触发spill的机制改为由ClickHouse托管。shuffle spill触发由当前内存使用量和固定阈值决定。
   
   修改原因:
   1. 统计不准确,代码运行过程中如果存在异步线程,容易出现内存使用量统计失真
   2. 无法统一管理各个算子的spill,目前已有sort ,aggregate,join,shuffle支持spill,spark task 
memory manager无法管理众多算子的spill触发
   3. 
shuffle通过spark触发spill容易出错,因为内存分配会出现在任何时候,但不是任何时机都可以触发spill,容易导致运行错误。难以根本解决。
   
   ### 删除多余的配置项
   1. spark.gluten.sql.columnar.backend.ch.shuffle.preferSpill
   不再需要选择不同的模式,保留preferSpill=false的模式,对celeborn没有影响
   4. spark.gluten.sql.columnar.backend.ch.throwIfMemoryExceed
   offheap内存管理切换至clickhouse MemoryTracker,不在需要该配置
   5. spark.gluten.sql.columnar.backend.ch.flushBlockBufferBeforeEvict
   保留flushBlockBufferBeforeEvict=true的行为,移除配置项
   6. spark.gluten.sql.columnar.backend.ch.spillFirstlyBeforeStop
   7. spark.gluten.sql.columnar.backend.ch.forceExternalSortShuffle
   移除冗余的external sort shuffle 及配置
   
   ### 新增配置
   1. spark.gluten.sql.columnar.backend.ch.runtime_config.spill_mem_ratio=0.9
   shuffle spill触发控制,默认当前task内存使用量超过90%时触发
   2. 
spark.gluten.sql.columnar.backend.ch.runtime_config.extra_memory_hard_limit=0
   为task内存增加额外的hard 
limit限制,单位为byte,当task内存使用超过hardlimit时会产生异常。如果希望task能适度超过offheap配置可增大该配置项
   内存的hard_limit = soft_limit + extra_memory_hard_limit, 
soft_limit为spark配置的offheap size。
   
   新增performance counter 日志输出,方便对task进行性能分析。
   
![image](https://github.com/user-attachments/assets/1b6d9bab-cd75-4b7a-9bea-2abbfdd997ad)
   
   
   ## How was this patch tested?
   
   unit tests
   
   
   (If this patch involves UI changes, please attach a screenshot; otherwise, 
remove this)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to