Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
goliaro committed Nov 9, 2024
1 parent fc626c6 commit ab5aa4b
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/runtime/model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3420,25 +3420,25 @@ bool FFModel::need_to_add_combine(int layer_idx) const {

bool FFModel::need_to_add_allreduce(int layer_idx) const {
auto const &l = layers[layer_idx];
if (config.computationMode == COMP_MODE_INFERENCE && config.tensor_parallelism_degree > 1 && l->op_type == OP_LINEAR &&
( /*llama/mpt attention*/
(std::string(l->name).find("attn.o_proj") != std::string::npos) ||
/*opt/starcoder attention*/
(std::string(l->name).find("self_attn.o_proj") != std::string::npos) ||
/*falcon attention*/
(std::string(l->name).find("self_attention.o_proj") != std::string::npos) ||
/*llama mlp*/
(std::string(l->name).find("mlp.down_proj") != std::string::npos) ||
/*opt mlp*/
(std::string(l->name).find("fc2") != std::string::npos) ||
/*falcon mlp*/
(std::string(l->name).find("mlp.dense_4h_to_h") != std::string::npos) ||
/*mpt mlp*/
(std::string(l->name).find("ffn.down_proj") != std::string::npos) ||
/*starcoder mlp*/
(std::string(l->name).find("mlp.c_proj") != std::string::npos)
)
) {
if (config.computationMode == COMP_MODE_INFERENCE &&
config.tensor_parallelism_degree > 1 && l->op_type == OP_LINEAR &&
(/*llama/mpt attention*/
(std::string(l->name).find("attn.o_proj") != std::string::npos) ||
/*opt/starcoder attention*/
(std::string(l->name).find("self_attn.o_proj") != std::string::npos) ||
/*falcon attention*/
(std::string(l->name).find("self_attention.o_proj") !=
std::string::npos) ||
/*llama mlp*/
(std::string(l->name).find("mlp.down_proj") != std::string::npos) ||
/*opt mlp*/
(std::string(l->name).find("fc2") != std::string::npos) ||
/*falcon mlp*/
(std::string(l->name).find("mlp.dense_4h_to_h") != std::string::npos) ||
/*mpt mlp*/
(std::string(l->name).find("ffn.down_proj") != std::string::npos) ||
/*starcoder mlp*/
(std::string(l->name).find("mlp.c_proj") != std::string::npos))) {
return true;
}
return false;
Expand Down

0 comments on commit ab5aa4b

Please sign in to comment.