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

Warn when using persistent cache with debug env vars #7175

Merged
merged 3 commits into from
Jun 4, 2024
Merged

Conversation

jonb377
Copy link
Collaborator

@jonb377 jonb377 commented Jun 3, 2024

See also #7169

When using the persistent compilation cache, modifications to the HLO metadata will not impact the graph hash, and the persistent cache will load executables compiled with potentially outdated metadata.

This change:

  • Modifies the graph hash when XLA_HLO_DEBUG or XLA_IR_DEBUG is set
  • Prints a warning when initializing the persistent cache with XLA_HLO_DEBUG or XLA_IR_DEBUG set.

@jonb377 jonb377 requested a review from JackCaoG June 3, 2024 22:51
@@ -93,7 +93,7 @@ torch::lazy::hash_t HashXlaEnvVars() {
// Both XLA_FLAGS and LIBTPU_INIT_ARGS contain XLA flags which impact
// the compilation result.
static std::vector<std::string> flag_vars = {"XLA_FLAGS", "LIBTPU_INIT_ARGS"};
static std::vector<std::string> raw_vars = {"TPU_MEGACORE"};
static std::vector<std::string> raw_vars = {"TPU_MEGACORE", "XLA_HLO_DEBUG"};
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we also include XLA_IR_DEBUG? This flag will add additional meta data to the HLO.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah I see, I didn't think XLA_IR_DEBUG would touch the HLO, I'll include both env vars here.

@jonb377 jonb377 changed the title Warn when using persistent cache with XLA_HLO_DEBUG Warn when using persistent cache with debug env vars Jun 3, 2024
@jonb377 jonb377 merged commit bcf46c7 into master Jun 4, 2024
22 checks passed
@jonb377 jonb377 deleted the jonbolin/pcw branch June 4, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants