已开启
feat: 接入 RotaryPositionEmbedding 算子分布式调度支持 #155
hedongdong创建于 5月19日
Hhedongdong
5月19日 关联了pull request:feat: add distributed op RotaryPositionEmbedding with UT and MindSpore ST
5月19日 关联了pull request:feat: add distributed op RotaryPositionEmbedding with UT and MindSpore ST
Hhedongdong
5月19日 关联了pull request:feat: add distributed op RotaryPositionEmbedding with UT and MindSpore ST
5月19日 关联了pull request:feat: add distributed op RotaryPositionEmbedding with UT and MindSpore ST
5月19日 修改了issue 的描述
背景
在 Tensor Parallelism(TP)/ 数据并行等分布式训练场景中,
RotaryPositionEmbedding(RPE)是 Transformer 模型中广泛使用的位置编码算子(公式:y = x * cos + x_rotate * sin)。HyperParallel 当前缺少 RPE 的分布式算子调度实现:使用 DTensor 对象调用时无法推断输出 DTensor 的分布状态,下游算子无法正确组合分布式计算图。目标
为
RotaryPositionEmbedding提供分布式调度支持:preprocess()的to_local()提取本地 tensor 传给 CANN 内核infer_layout()基于输入分片方式推断输出 layout:支持的分片场景
约束
UT:
test_parallel_rotary_position_embedding.py(22 cases)ST:
rotary_position_embedding_shard_in_python.py(8 cases,4 组,覆盖 2/4/8 卡)相关 PR
#661