Skip to content

PR #24744: Don't clone instructions in HloEvaluator. #24967

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
Apr 28, 2025

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Apr 10, 2025

PR #24744: Don't clone instructions in HloEvaluator.

Imported from GitHub PR #24744

There doesn't appear to be any good reason to do this, but it makes
HloEvaluator very dangerous to use - any use from a multi-threaded
context will eventually cause memory corruptions due to concurrent
modifications of the HloModule. With this PR, it should be possible to
use multiple HloEvaluators concurrently.

Copybara import of the project:

--
f2ffe79 by Johannes Reifferscheid [email protected]:

Don't clone instructions in HloEvaluator.

There doesn't appear to be any good reason to do this, but it makes
HloEvaluator very dangerous to use.

--
a4f23ed by Johannes Reifferscheid [email protected]:

Fix layout issues inside fusions.

Previously, there was a workaround in the fusion handler to set missing
layouts to the default layout. This is needed because layout assignment
will usually clear internal layouts in fusions. Since we no longer have
a copy of the module, we cannot override the layouts - instead, we
support missing layouts where necessary.

Also add a test for a layout-less 2d reduction.

--
fb89439 by Johannes Reifferscheid [email protected]:

Fix handling tuple shapes with layouts.

--
a966d27 by Johannes Reifferscheid [email protected]:

Run clang-format.

--
5bb338b by Johannes Reifferscheid [email protected]:

Fix multiply-accumulate handler crashes.

--
f9204d6 by Johannes Reifferscheid [email protected]:

Undo CreateLiteral change.

This is unnecessary after
#25135.

--
5459e26 by Johannes Reifferscheid [email protected]:

Minor fixes.

--
2200224 by Johannes Reifferscheid [email protected]:

Fix convolution handling.

Turns out lhs_shape/rhs_shape aren't the same thing in HandleConvolution and
HandleConvolutionWithLiterals. Oops.

--
fe45167 by Johannes Reifferscheid [email protected]:

Fix default layout check.

Merging this change closes #24744

FUTURE_COPYBARA_INTEGRATE_REVIEW=#24744 from jreiffers:noclone fe45167

@copybara-service copybara-service bot force-pushed the test_746018888 branch 30 times, most recently from fa40a48 to 6cfd3dd Compare April 17, 2025 08:22
@copybara-service copybara-service bot force-pushed the test_746018888 branch 19 times, most recently from 6355dac to 4d4ddfa Compare April 22, 2025 18:38
@copybara-service copybara-service bot force-pushed the test_746018888 branch 4 times, most recently from 4711bbb to a98bf6e Compare April 28, 2025 08:05
Imported from GitHub PR #24744

There doesn't appear to be any good reason to do this, but it makes
HloEvaluator very dangerous to use - any use from a multi-threaded
context will eventually cause memory corruptions due to concurrent
modifications of the HloModule. With this PR, it should be possible to
use multiple HloEvaluators concurrently.

Copybara import of the project:

--
f2ffe79 by Johannes Reifferscheid <[email protected]>:

Don't clone instructions in HloEvaluator.

There doesn't appear to be any good reason to do this, but it makes
HloEvaluator very dangerous to use.

--
a4f23ed by Johannes Reifferscheid <[email protected]>:

Fix layout issues inside fusions.

Previously, there was a workaround in the fusion handler to set missing
layouts to the default layout. This is needed because layout assignment
will usually clear internal layouts in fusions. Since we no longer have
a copy of the module, we cannot override the layouts - instead, we
support missing layouts where necessary.

Also add a test for a layout-less 2d reduction.

--
fb89439 by Johannes Reifferscheid <[email protected]>:

Fix handling tuple shapes with layouts.

--
a966d27 by Johannes Reifferscheid <[email protected]>:

Run clang-format.

--
5bb338b by Johannes Reifferscheid <[email protected]>:

Fix multiply-accumulate handler crashes.

--
f9204d6 by Johannes Reifferscheid <[email protected]>:

Undo CreateLiteral change.

This is unnecessary after
#25135.

--
5459e26 by Johannes Reifferscheid <[email protected]>:

Minor fixes.

--
2200224 by Johannes Reifferscheid <[email protected]>:

Fix convolution handling.

Turns out lhs_shape/rhs_shape aren't the same thing in HandleConvolution and
HandleConvolutionWithLiterals. Oops.

--
fe45167 by Johannes Reifferscheid <[email protected]>:

Fix default layout check.

Merging this change closes #24744

COPYBARA_INTEGRATE_REVIEW=#24744 from jreiffers:noclone fe45167
PiperOrigin-RevId: 752230580
@copybara-service copybara-service bot merged commit b77c3df into main Apr 28, 2025
1 check passed
@copybara-service copybara-service bot deleted the test_746018888 branch April 28, 2025 10:03
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