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

Parameterize elemental_ir_emitter_test.cc float tests #17383

Closed

Conversation

apivovarov
Copy link
Contributor

elemental_ir_emitter_test.cc contains multiple similar tests for bf16, f8e4m3fnuz and , f8e5m2fnuz.

Changes:

  • Parameterize the float tests in elemental_ir_emitter_test.cc.
  • Add additional types to the list of tested types - f8e5m2, f8e4m3fn, f8e4m3b11fnuz.

Some tests failed for newly added types. Temporary use GTEST_SKIP for such cases:

Related issues:

tsl::float8_e4m3b11fnuz, tsl::float8_e5m2,
tsl::float8_e5m2fnuz>;

TYPED_TEST_SUITE(ElementalIrEmitterExecutionTypedTest, FloatTypes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we only use the type name, not the actual C++ type, this can be a value-parameterized test (with TEST_P) instead of a type-parameterized test (with TYPED_TEST)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially attempted that approach, but I realized the CompareFloat test requires TypeParam (used in LiteralUtil::CreateR1<TypeParam>) to execute RunTest with a Span of Literals of the specified type. Therefore, I refactored the original implementation using TYPED_TEST_SUITE.

copybara-service bot pushed a commit that referenced this pull request Sep 20, 2024
Imported from GitHub PR #17383

`elemental_ir_emitter_test.cc` contains multiple similar tests for  `bf16`, `f8e4m3fnuz` and , `f8e5m2fnuz`.

Changes:
- Parameterize the float tests in elemental_ir_emitter_test.cc.
- Add additional types to the list of tested types - `f8e5m2`, `f8e4m3fn`, `f8e4m3b11fnuz`.

Some tests failed for newly added types. Temporary use `GTEST_SKIP` for such cases:

Related issues:
- #17323
- #17324

Copybara import of the project:

--
47dcfcf by Alexander Pivovarov <[email protected]>:

Parameterize elemental_ir_emitter_test.cc float tests

Merging this change closes #17383

FUTURE_COPYBARA_INTEGRATE_REVIEW=#17383 from apivovarov:param_elemental_ir_emitter_test 47dcfcf
PiperOrigin-RevId: 676627549
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Sep 20, 2024
Imported from GitHub PR openxla/xla#17383

`elemental_ir_emitter_test.cc` contains multiple similar tests for  `bf16`, `f8e4m3fnuz` and , `f8e5m2fnuz`.

Changes:
- Parameterize the float tests in elemental_ir_emitter_test.cc.
- Add additional types to the list of tested types - `f8e5m2`, `f8e4m3fn`, `f8e4m3b11fnuz`.

Some tests failed for newly added types. Temporary use `GTEST_SKIP` for such cases:

Related issues:
- openxla/xla#17323
- openxla/xla#17324

Copybara import of the project:

--
47dcfcf43908584d453f63008c9d68b5e7dae9c3 by Alexander Pivovarov <[email protected]>:

Parameterize elemental_ir_emitter_test.cc float tests

Merging this change closes #17383

FUTURE_COPYBARA_INTEGRATE_REVIEW=openxla/xla#17383 from apivovarov:param_elemental_ir_emitter_test 47dcfcf43908584d453f63008c9d68b5e7dae9c3
PiperOrigin-RevId: 676627549
copybara-service bot pushed a commit that referenced this pull request Sep 20, 2024
Imported from GitHub PR #17383

`elemental_ir_emitter_test.cc` contains multiple similar tests for  `bf16`, `f8e4m3fnuz` and , `f8e5m2fnuz`.

Changes:
- Parameterize the float tests in elemental_ir_emitter_test.cc.
- Add additional types to the list of tested types - `f8e5m2`, `f8e4m3fn`, `f8e4m3b11fnuz`.

Some tests failed for newly added types. Temporary use `GTEST_SKIP` for such cases:

Related issues:
- #17323
- #17324

Copybara import of the project:

--
47dcfcf by Alexander Pivovarov <[email protected]>:

Parameterize elemental_ir_emitter_test.cc float tests

Merging this change closes #17383

FUTURE_COPYBARA_INTEGRATE_REVIEW=#17383 from apivovarov:param_elemental_ir_emitter_test 47dcfcf
PiperOrigin-RevId: 676627549
copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Sep 20, 2024
Imported from GitHub PR openxla/xla#17383

`elemental_ir_emitter_test.cc` contains multiple similar tests for  `bf16`, `f8e4m3fnuz` and , `f8e5m2fnuz`.

Changes:
- Parameterize the float tests in elemental_ir_emitter_test.cc.
- Add additional types to the list of tested types - `f8e5m2`, `f8e4m3fn`, `f8e4m3b11fnuz`.

Some tests failed for newly added types. Temporary use `GTEST_SKIP` for such cases:

Related issues:
- openxla/xla#17323
- openxla/xla#17324

Copybara import of the project:

--
47dcfcf43908584d453f63008c9d68b5e7dae9c3 by Alexander Pivovarov <[email protected]>:

Parameterize elemental_ir_emitter_test.cc float tests

Merging this change closes #17383

PiperOrigin-RevId: 676739814
@apivovarov apivovarov deleted the param_elemental_ir_emitter_test branch September 20, 2024 18:35
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.

2 participants