mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-27 20:46:00 +00:00
[shardformer] vit/llama/t5 ignore the sequence parallelism flag and some fix. (#4498)
* [shardformer] chatglm support sequence parallel [shardformer] chatglm support sequence parallel [shardformer] chatglm support sequence parallel [shardformer] chatglm support sequence parallel [shardformer] chatglm support sequence parallel [shardformer] chatglm support sequence parallel * fix fix fix fix * [shardformer] jit fused fix * [shardformer] jit fused fix * [shardformer] jit fused fix * [shardformer] jit fused fix * [shardformer] jit fused fix * [shardformer] jit fused fix * [shardformer] jit fused fix * activate checks
This commit is contained in:
@@ -104,16 +104,20 @@ class OPTPolicy(Policy):
|
||||
|
||||
# use flash attention
|
||||
if self.shard_config.enable_flash_attention:
|
||||
policy[OPTAttention] = ModulePolicyDescription(method_replacement={
|
||||
self.append_or_create_method_replacement(description={
|
||||
'forward': get_opt_flash_attention_forward(),
|
||||
})
|
||||
},
|
||||
policy=policy,
|
||||
target_key=OPTAttention)
|
||||
|
||||
# use jit fused operator
|
||||
if self.shard_config.enable_jit_fused:
|
||||
policy[OPTDecoderLayer] = ModulePolicyDescription(method_replacement={
|
||||
self.append_or_create_method_replacement(description={
|
||||
'forward': get_jit_fused_opt_decoder_layer_forward(),
|
||||
'dropout_add': get_jit_fused_dropout_add_func(),
|
||||
})
|
||||
},
|
||||
policy=policy,
|
||||
target_key=OPTDecoderLayer)
|
||||
|
||||
return policy
|
||||
|
||||
|
Reference in New Issue
Block a user