Skip to content

Rename XLA_SHOW_CPP_ERROR_CONTEXT to TORCH_SHOW_CPP_STACKTRACES #9482

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ysiraichi
Copy link
Collaborator

This PR renames the environment variable XLA_SHOW_CPP_ERROR_CONTEXT to TORCH_SHOW_CPP_STACKTRACES for consistency with existing PyTorch development practices.

Key Changes

  • Alongside with the environment variable name, kEnvShowCppErrorContext variable (in env_vars.h) was also renamed to kEnvShowCppStacktraces
  • Test files, enums, and functions were also renamed accordingly

Rename `XLA_SHOW_CPP_ERROR_CONTEXT` to `TORCH_SHOW_CPP_STACKTRACES`.
@ysiraichi ysiraichi requested review from zhanyong-wan and ghpvnist and removed request for zhanyong-wan July 15, 2025 18:44
Copy link
Collaborator

@ghpvnist ghpvnist left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -40,7 +40,7 @@ inline constexpr char kEnvDistSvcShutdownTimeoutInMin[] =

// When set to true, this enables showing C++ error context in backtraces,
// which can be helpful for debugging but may clutter logs when not needed
inline constexpr char kEnvShowCppErrorContext[] = "XLA_SHOW_CPP_ERROR_CONTEXT";
inline constexpr char kEnvShowCppStacktraces[] = "TORCH_SHOW_CPP_STACKTRACES";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's also link to the torch documentation page to remind users it's the same env variable.

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