[JAX] Bound tracebacks up to the enclosing jit.#38165
Open
copybara-service[bot] wants to merge 1 commit intomainfrom
Open
[JAX] Bound tracebacks up to the enclosing jit.#38165copybara-service[bot] wants to merge 1 commit intomainfrom
jit.#38165copybara-service[bot] wants to merge 1 commit intomainfrom
Conversation
We currently attach the entire Python traceback to every operation we emit, but this behavior is incompatible with getting correct tracebacks if the same function is called from two call sites. By including the traceback of the caller in the callee and we "contaminate" any future cache hits with context from the first cache miss. This leads to, amongst other things, nondeterminism if we are tracing multiple computations in parallel. Instead, bound the traceback at the enclosing `jit` boundary, just as we do for name scopes. Each function's code source information is then scoped to the enclosing `jit`. [XLA] Change the call inliner to concatenate tracebacks when inlining. In effect this changes the interpretation of tracebacks in HLO to have different semantics, which is a breaking change. As a mitigation to avoid the sizes of tracebacks blowing up for existing HLOs, do not concatenate if the old traceback is a prefix of the new traceback. PiperOrigin-RevId: 869795678
be19c71 to
3763fbc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[JAX] Bound tracebacks up to the enclosing
jit.We currently attach the entire Python traceback to every operation we emit, but this behavior is incompatible with getting correct tracebacks if the same function is called from two call sites. By including the traceback of the caller in the callee and we "contaminate" any future cache hits with context from the first cache miss. This leads to, amongst other things, nondeterminism if we are tracing multiple computations in parallel.
Instead, bound the traceback at the enclosing
jitboundary, just as we do for name scopes. Each function's code source information is then scoped to the enclosingjit.[XLA] Change the call inliner to concatenate tracebacks when inlining. In effect this changes the interpretation of tracebacks in HLO to have different semantics, which is a breaking change. As a mitigation to avoid the sizes of tracebacks blowing up for existing HLOs, do not concatenate if the old traceback is a prefix of the new traceback.