Skip to content

Commit

Permalink
Merge pull request ApolloAuto#118 from amd/ashukshov/migraphx_fix
Browse files Browse the repository at this point in the history
[AMD][ApolloAuto#84][MIGraphX] MIGraphx inference update
  • Loading branch information
emankov committed Jul 15, 2022
2 parents 39fd69c + bda3b23 commit c19d94d
Show file tree
Hide file tree
Showing 11 changed files with 565 additions and 440 deletions.
20 changes: 10 additions & 10 deletions modules/perception/inference/inference_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#elif GPU_PLATFORM == AMD
#include "modules/perception/inference/migraphx/mi_net.h"
#endif

namespace apollo {
namespace perception {
namespace inference {
Expand All @@ -35,26 +34,27 @@ Inference *CreateInferenceByName(const std::string &name,
const std::vector<std::string> &outputs,
const std::vector<std::string> &inputs,
const std::string &model_root) {
#if GPU_PLATFORM == NVIDIA
if (name == "RTNet") {
#if GPU_PLATFORM == NVIDIA
return new RTNet(proto_file, weight_file, outputs, inputs);
#elif GPU_PLATFORM == AMD
return new MINet(proto_file, weight_file, outputs, inputs);
#endif
} else if (name == "RTNetInt8") {
#if GPU_PLATFORM == NVIDIA
return new RTNet(proto_file, weight_file, outputs, inputs, model_root);
#elif GPU_PLATFORM == AMD
// TODO(B1tway) Add quantization int8 support for RTNetInt8.
// RTNetInt8 on MIGraphX currently works with fp32.
return new MINet(proto_file, weight_file, outputs, inputs);
#endif
} else if (name == "TorchDet") {
return new TorchDet(proto_file, weight_file, outputs, inputs);
} else if (name == "TorchNet") {
return new TorchNet(proto_file, weight_file, outputs, inputs);
} else if (name == "Obstacle") {
return new ObstacleDetector(proto_file, weight_file, outputs, inputs);
}
#elif GPU_PLATFORM == AMD
if (name == "RTNet") {
return new MINet(proto_file, weight_file, outputs, inputs);
} else if (name == "RTNetInt8") {
// int8 calibration not supported yet
return new MINet(proto_file, weight_file, outputs, inputs);
}
#endif
return nullptr;
}

Expand Down
Loading

0 comments on commit c19d94d

Please sign in to comment.