Skip to content

Commit a970a84

Browse files
authored
Fixing env variable for int8 calibration table (#199)
* Fixing env variable for int8 calibration table * Simplifying logic
1 parent caf417b commit a970a84

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

onnxruntime/core/providers/migraphx/migraphx_execution_provider.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ MIGraphXExecutionProvider::MIGraphXExecutionProvider(const MIGraphXExecutionProv
209209
int8_use_native_migraphx_calibration_table_env.empty() ? info.int8_use_native_calibration_table : std::stoi(int8_use_native_migraphx_calibration_table_env) != 0;
210210
}
211211

212-
if (int8_enable_ || fp8_enable_) {
213-
int8_calibration_cache_available_ = !info.int8_calibration_table_name.empty();
214-
}
212+
int8_calibration_cache_available_ =
213+
(int8_enable_ || fp8_enable_) && !int8_calibration_table_name_.empty();
214+
215215

216216
// Load INT8 calibration table
217-
if ((int8_enable_ || fp8_enable_) && int8_calibration_cache_available_) {
217+
if (int8_calibration_cache_available_) {
218218
std::unordered_map<std::string, float> dynamic_range_map;
219219
auto calibration_cache_path = GetCachePath(calibration_cache_path_, int8_calibration_table_name_);
220220
if (!ReadDynamicRange(calibration_cache_path, int8_use_native_calibration_table_, dynamic_range_map)) {

0 commit comments

Comments
 (0)