Skip to content

[XLA] Fix dynamic expression edge cases and batch bucketing - #54

Open
stevenvar wants to merge 12 commits into
steven.for-serving-2.20-clean-historyfrom
steven.fix-clean-history-review-findings
Open

[XLA] Fix dynamic expression edge cases and batch bucketing#54
stevenvar wants to merge 12 commits into
steven.for-serving-2.20-clean-historyfrom
steven.fix-clean-history-review-findings

Conversation

@stevenvar

Copy link
Copy Markdown
Owner

Summary

  • treat unknown dynamic expressions as neither constants nor valid dynamic expressions, and avoid emitting them as the integer value -1
  • preserve division expressions with a zero divisor instead of simplifying {0 / 0} to {1}
  • keep configured XLA batch buckets immutable so batch selection is deterministic and safe for concurrent compilation requests
  • remove stale debug-only output and clarify the StridedSlice expression fallback

Tests

  • //tensorflow/compiler/jit:xla_batch_matcher_test checks request-order independence and immutable configured buckets
  • @local_xla//xla:shape_test checks unknown-expression classification and zero-divisor simplification
  • @local_xla//xla/service/llvm_ir:llvm_util_test checks that unknown expressions are not emitted as constants
  • related XLA compiler, runtime, shape-inference, GraphProperties, and constant-folding tests pass without cached test results

@stevenvar
stevenvar force-pushed the steven.fix-clean-history-review-findings branch from 18b123b to 9ad0149 Compare August 18, 2026 08:21
@stevenvar
stevenvar force-pushed the steven.for-serving-2.20-clean-history branch from 4b41aa2 to 51b14f8 Compare August 18, 2026 09:52
@stevenvar
stevenvar force-pushed the steven.fix-clean-history-review-findings branch from 9ad0149 to 749308d Compare August 18, 2026 09:52
@stevenvar
stevenvar force-pushed the steven.for-serving-2.20-clean-history branch from 51b14f8 to 4f36467 Compare August 18, 2026 09:55
@stevenvar
stevenvar force-pushed the steven.fix-clean-history-review-findings branch from 749308d to 575bc44 Compare August 18, 2026 09:55
@stevenvar
stevenvar force-pushed the steven.for-serving-2.20-clean-history branch from 4f36467 to 1edf990 Compare August 18, 2026 11:45
@stevenvar
stevenvar force-pushed the steven.fix-clean-history-review-findings branch from 575bc44 to 3d05104 Compare August 18, 2026 11:45
@stevenvar
stevenvar force-pushed the steven.for-serving-2.20-clean-history branch from 1edf990 to 54a0c74 Compare August 18, 2026 12:49
@stevenvar
stevenvar force-pushed the steven.fix-clean-history-review-findings branch from 3d05104 to 41e8ef0 Compare August 18, 2026 12:52
Update tf2xla kernels to derive and forward symbolic shape and value expressions. Gate symbolic content propagation behind its dedicated configuration flag.
Derive binary-op output expressions from the operand XLA shapes during broadcasting. Preserve the non-singleton expression when an operand expands from a singleton dimension.
Retain symbolic contents when shape-derived operations are rewritten or folded to constants. Add a dedicated rewrite path so optimization does not erase runtime shape dependencies.
Normalize compatible dynamic expressions around their smallest shared variable-covering subexpression before clustering. Reject cluster merges whose dynamic inputs and outputs cannot use one consistent symbolic core.
Map runtime arguments to symbolic cluster inputs, solve their dynamic values, and build padded compilation arguments for cache lookup. Add batch bucketing and runtime boundary tests for dynamic cluster compilation.
Prevent MLIR XLA kernels from silently consuming dynamic expressions they cannot preserve. Keep the existing MLIR path for operations without dynamic expression metadata.
Store the solved dynamic batch value in executable run options and expose it to CPU execution paths. Keep thunk and non-thunk execution consistent at the cluster boundary.
Generate LLVM loop bounds from the runtime batch dimension when an HLO dimension carries a dynamic expression. Add focused coverage for runtime-dependent bounds.
Teach CPU emitters to use runtime dynamic dimensions for affected operations instead of fixed padded extents. Preserve the padded allocation while limiting computation to the real shape.
Make CPU HLO profiling tolerate dynamic execution metadata and missing profile counters. Avoid invalid accesses while retaining profiling for supported instructions.
Add end-to-end coverage for symbolic shape propagation, clustering, compilation, and CPU execution. Exercise representative dynamic models across the complete TensorFlow-to-XLA path.
@stevenvar
stevenvar force-pushed the steven.for-serving-2.20-clean-history branch from 54a0c74 to c3d2540 Compare August 18, 2026 14:37
@stevenvar
stevenvar force-pushed the steven.fix-clean-history-review-findings branch from 41e8ef0 to 85612da Compare August 18, 2026 14:38
@stevenvar
stevenvar force-pushed the steven.for-serving-2.20-clean-history branch 2 times, most recently from edd2ef7 to e8b6182 Compare August 20, 2026 09:26
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