Skip to content

Comments

[JAX] Bound tracebacks up to the enclosing jit.#38165

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
test_869795678
Open

[JAX] Bound tracebacks up to the enclosing jit.#38165
copybara-service[bot] wants to merge 1 commit intomainfrom
test_869795678

Conversation

@copybara-service
Copy link

[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 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.

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
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.

1 participant