-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
【AutoParallelism】Add 'Eager1 F1B" pipeline strategy #57605
【AutoParallelism】Add 'Eager1 F1B" pipeline strategy #57605
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
for op in block.ops: | ||
if op.type == 'send_v2': | ||
op._set_attr("dynamic_shape", False) | ||
op._set_attr("use_calc_stream", True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use_calc_stream should be false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When use_calc_stream
is false, send_v2
will use the streams inphi::distributed::NCCLCommContext
* delete sync operation in pipeline strategy * add Eager1F1B pipeline strategy
* delete sync operation in pipeline strategy * add Eager1F1B pipeline strategy
* delete sync operation in pipeline strategy * add Eager1F1B pipeline strategy
PR types
Performance optimization
PR changes
Others
Description
PCard-71568
本PR主要是增加了一种在pp策略下的子图编排策略,用来 overlap pp不同stage之间forward-job的send/recv和计算,提升大模型推训端到端性能。主要工作如下:
_overlap_send_recv
函数,用于升级_insert_sync_for_fthenb_1f1b
,去除借助c_sync_calc_stream
和c_sync_comm_stream
来同步程序的逻辑,但是该函数可能会增加显存峰值,所以增加enable_send_recv_overlap
参数进行控制,并默认关闭。pipeline_scheduler_Eager1F1B
的pipeline pass,在enable_send_recv_overlap==True
的前提下,提升大模型执行速度,但是会增加显存峰值。综上:在显存不是瓶颈的情况下,开启
Eager1F1B
能够单机下可获得1%的性能提升,多机下可获得2%~6%的提升(提升的幅度跟send/recv的通信耗时有关),可以根据具体的模型使能该策略。相关论文On Optimizing the Communication of Model Parallelism