Skip to content

[xla] Change the order of std::variant types in MaybeOwningDeviceMemory #28947

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

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

copybara-service[bot]
Copy link

[xla] Change the order of std::variant types in MaybeOwningDeviceMemory

Constructing and destroying trivially-destructible se::DeviceMemoryBase is about 2.5X faster that OwnedDeviceMemory. This code is on a hot path of invoking XLA from Tensorflow: we construct a vector of default-initialized ShapeTree.

Constructing and destroying trivially-destructible se::DeviceMemoryBase is about 2.5X faster that OwnedDeviceMemory. This code is on a hot path of invoking XLA from Tensorflow: we construct a vector of default-initialized ShapeTree<MaybeOwningDeviceMemory>.

PiperOrigin-RevId: 783553450
@copybara-service copybara-service bot merged commit da69949 into main Jul 16, 2025
@copybara-service copybara-service bot deleted the test_783503749 branch July 16, 2025 02:01
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