Skip to content

Conversation

@ivarusic-amd
Copy link

This change is needed when using MIGraphX environment variables inside scripts.
Previously, if we set:
os.environ["ORT_MIGRAPHX_INT8_CALIBRATION_TABLE_NAME"] = "calibration.flatbuffers"
the int8_calibration_cache_available_ flag was not set correctly. We only encoded values from provider_options because we used info.int8_calibration_table_name, so the env var was ignored.

@TedThemistokleous TedThemistokleous added Bugfix Fix to a bug or reported issue Upstream Changset that should be merged upstream to Microsoft/Onnxruntime Backport Cherry-pick to previous ROCm branch to support dot releases (eg ROCm X.Y.Z) labels Dec 2, 2025

if (int8_enable_ || fp8_enable_) {
int8_calibration_cache_available_ = !info.int8_calibration_table_name.empty();
int8_calibration_cache_available_ = !int8_calibration_table_name_.empty();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check both flags with an || since user can take both paths with python, cpp api, and ENV variables

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the !int8_calibration_table_name_ variable, since it takes both cases in count. I've tested with setting environment variable and using provider_options ; both works with priority of ENV. I do not see the approach for simplifying more than this. What's your opinion and suggestion? @TedThemistokleous I think if this works; we should add this PR and put in backlog ticket if there is better way to do approach this.

Copy link
Collaborator

@TedThemistokleous TedThemistokleous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to use both flags.

@TedThemistokleous TedThemistokleous merged commit a970a84 into rocm7.2_internal_testing Dec 5, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Cherry-pick to previous ROCm branch to support dot releases (eg ROCm X.Y.Z) Bugfix Fix to a bug or reported issue Upstream Changset that should be merged upstream to Microsoft/Onnxruntime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants