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

[MIGraphX EP] Set external data path option #44

Merged
merged 3 commits into from
Jul 1, 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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <iterator>
#include <unordered_map>
#include <set>
#include <filesystem>

#include "core/providers/shared_library/provider_api.h"
#define ORT_API_MANUAL_INIT
Expand Down Expand Up @@ -990,6 +991,7 @@ MIGraphXExecutionProvider::GetCapability(const onnxruntime::GraphViewer& graph_v
model_proto->set_ir_version(ONNX_NAMESPACE::Version::IR_VERSION);
std::string onnx_string_buffer;
model_proto->SerializeToString(onnx_string_buffer);
model_path_ = ToUTF8String(graph_viewer.ModelPath().ToPathString());

// dump onnx file if environment var is set
if (dump_model_ops_) {
Expand Down Expand Up @@ -1297,6 +1299,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
if (!input_shape_match) {
if (!load_precompiled_model(prog, load_compiled_model_, std::string{load_compiled_path_})) {
LOGS_DEFAULT(VERBOSE) << "No Input shapes mismatch detected. Recompiling" << std::endl;
cmp_options.set_external_data_path(model_path_.parent_path().string());
prog = migraphx::parse_onnx_buffer(onnx_string, cmp_options);

// Read in the calibration data and map it to an migraphx paramater map for the calibration ops
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <map>
#include <unordered_map>
#include <filesystem>

Check warning on line 14 in onnxruntime/core/providers/migraphx/migraphx_execution_provider.h

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] onnxruntime/core/providers/migraphx/migraphx_execution_provider.h#L14

Found C++ system header after other header. Should be: migraphx_execution_provider.h, c system, c++ system, other. [build/include_order] [4]
Raw output
onnxruntime/core/providers/migraphx/migraphx_execution_provider.h:14:  Found C++ system header after other header. Should be: migraphx_execution_provider.h, c system, c++ system, other.  [build/include_order] [4]

namespace onnxruntime {

Expand Down Expand Up @@ -100,6 +101,7 @@
migraphx::target t_;
OrtMutex mgx_mu_;
hipStream_t stream_ = nullptr;
mutable std::filesystem::path model_path_;

std::unordered_map<std::string, migraphx::program> map_progs_;
std::unordered_map<std::string, std::string> map_onnx_string_;
Expand Down
Loading