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 #21598

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix compilation for v1.19+
apwojcik authored and Ted Themistokleous committed Aug 2, 2024
commit 54362d7286685750350762d0d9cfbd8361e965c4
Original file line number Diff line number Diff line change
@@ -991,7 +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());
model_path_ = graph_viewer.ModelPath();

// dump onnx file if environment var is set
if (dump_model_ops_) {
@@ -1170,7 +1170,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
auto param_shapes = prog.get_parameter_shapes();

// Add all calibration data read in from int8 table
for (auto& [cal_key, cal_val] : dynamic_range_map) {
for (auto& [cal_key, cal_val] : dynamic_range_map_) {
auto cal_val_shape = migraphx::shape(migraphx_shape_float_type);
quant_params.add(cal_key.c_str(), migraphx::argument(cal_val_shape, static_cast<void*>(std::move(&cal_val))));
}
@@ -1219,7 +1219,7 @@ Status MIGraphXExecutionProvider::Compile(const std::vector<FusedNodeAndGraph>&
*p = {context->allocate_func, context->release_func, context->allocator_handle, map_progs_[context->node_name],
map_onnx_string_[context->node_name], options, t_, map_input_index_[context->node_name], &mgx_mu_,
map_no_input_shape_[context->node_name], fp16_enable_, int8_enable_,
int8_calibration_cache_available_, dynamic_range_map,
int8_calibration_cache_available_, dynamic_range_map_,
save_compiled_model_, save_compiled_path_,
load_compiled_model_, load_compiled_path_, dump_model_ops_};
*state = p.release();
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@

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

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

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 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 {

@@ -92,7 +92,7 @@
bool int8_calibration_cache_available_ = false;
bool int8_use_native_migraphx_calibration_table_ = false;
std::string calibration_cache_path_;
std::unordered_map<std::string, float> dynamic_range_map;
std::unordered_map<std::string, float> dynamic_range_map_;
bool save_compiled_model_ = false;
std::string save_compiled_path_;
bool load_compiled_model_ = false;