Skip to content

Commit

Permalink
enable custom device to use silu_fuse_pass (#60595)
Browse files Browse the repository at this point in the history
move SetUseCustomDevice to all platform
  • Loading branch information
engineer1109 authored Jan 10, 2024
1 parent 452fe18 commit 8140e6b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion paddle/fluid/framework/ir/silu_fuse_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ namespace ir {
void SiluFusePass::ApplyImpl(ir::Graph* graph) const {
// This pass is used for cutlass, because cutlass can fuse conv + bias + silu
bool cutlass_enable = Get<bool>("use_cutlass");
if (!cutlass_enable) {
bool use_custom_device = Get<bool>("use_custom_device");
if (!cutlass_enable && !use_custom_device) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions paddle/fluid/inference/analysis/ir_pass_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void IRPassManager::CreatePasses(Argument *argument,
"mixed_white_list",
new std::unordered_set<std::string>(argument->mixed_white_list()));
pass->Set("enable_gpu_mixed", new bool(argument->enable_gpu_mixed()));
pass->Set("use_custom_device", new bool(argument->use_custom_device()));
pass->Set("enable_custom_device_mixed",
new bool(argument->enable_custom_device_mixed()));
pass->Set("mixed_precision_mode",
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/inference/api/analysis_predictor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1678,8 +1678,8 @@ void AnalysisPredictor::PrepareArgument() {
}
#endif

#ifdef PADDLE_WITH_CUSTOM_DEVICE
argument_->SetUseCustomDevice(config_.use_custom_device());
#ifdef PADDLE_WITH_CUSTOM_DEVICE
if (config_.use_custom_device()) {
LOG(INFO) << "CustomDevice is enabled";
argument_->SetCustomDeviceType(config_.custom_device_type());
Expand Down

0 comments on commit 8140e6b

Please sign in to comment.