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

Optimize XLA Compiler. #64357

Merged
merged 1 commit into from
Mar 23, 2024
Merged

Optimize XLA Compiler. #64357

merged 1 commit into from
Mar 23, 2024

Conversation

copybara-service[bot]
Copy link

Optimize XLA Compiler.

This results in 2% improvement on some representative large model compilation benchmarks.

  1. MayUseOperandValue(position.index, user), (user->IsRoot() && root_positions.contains(user) is computed once per <position, user> instead of once per <position, user, operand>. We don't need to pass i to MayUseOperandValue. We can instead bring the CHECK out at the call site.
  2. Use emplace_back instead of push_back and std::move. Why: https://godbolt.org/z/sT54Ef88h

This results in 2% improvement on some representative large model compilation benchmarks.

1. `MayUseOperandValue(position.index, user)`, `(user->IsRoot() && root_positions.contains(user)` is computed once per <position, user> instead of once per <position, user, operand>. We don't need to pass `i` to `MayUseOperandValue`. We can instead bring the `CHECK` out at the call site.
2. Use `emplace_back` instead of `push_back` and `std::move`. Why: https://godbolt.org/z/sT54Ef88h

PiperOrigin-RevId: 618429256
@copybara-service copybara-service bot merged commit b20bcd3 into master Mar 23, 2024
@copybara-service copybara-service bot deleted the exported_pr_617286277 branch March 23, 2024 11:59
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.

None yet

1 participant