Skip to content
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

[Custom Device]enable custom device to use silu_fuse_pass #60595

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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