Skip to content

[Tests][Frontend] Remove redundant PyTorch frontend tests#20021

Open
tlopex wants to merge 5 commits into
apache:mainfrom
tlopex:tests/pytorch-frontend-test-audit
Open

[Tests][Frontend] Remove redundant PyTorch frontend tests#20021
tlopex wants to merge 5 commits into
apache:mainfrom
tlopex:tests/pytorch-frontend-test-audit

Conversation

@tlopex

@tlopex tlopex commented Jul 16, 2026

Copy link
Copy Markdown
Member

This PR:

  • Removes duplicate module/functional, alias, positional-argument, and no-op cases from the PyTorch ExportedProgram tests.
  • Consolidates the four GRU configurations into a table-driven loop without removing any configurations.
  • Removes duplicated FX cases already covered through the same shared converters.
  • Restores FX scalar tensor constant coverage and TFLite constant-parameter Gather and static broadcast/MUL coverage.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors and simplifies frontend tests across test_frontend_from_exported_program.py and test_frontend_from_fx.py by removing redundant test cases, while also adding new test coverage for static broadcasts and constant gather operations in test_frontend_tflite.py. However, the feedback highlights that several deleted test cases should be retained to prevent a significant loss of test coverage. Specifically, the reviewer recommends preserving tests for torch.unbind, multi-dimensional IndexPut, functional bitwise_or, negative axis handling in torch.gather, and factory operators (arange, empty, eye, and linspace) in the FX frontend, as these exercise distinct code paths and operator behaviors.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

I am having trouble creating individual review comments. Click here to see my feedback.

tests/python/relax/test_frontend_from_exported_program.py (5797-5800)

high

Removing Unbind1 and Unbind2 completely eliminates test coverage for torch.unbind in the exported program frontend. Unlike torch.chunk or torch.split which retain the split dimension (e.g., returning size 1), torch.unbind squeezes the split dimension. This exercises a distinct lowering path involving R.squeeze that is not covered by Chunk. Please preserve the unbind test cases.

tests/python/relax/test_frontend_from_fx.py (5794-5806)

high

Removing multi-dimensional IndexPut tests (IndexPut2D, IndexPut3D, etc.) leaves only 1D indexing covered. Multi-dimensional advanced indexing (where the indices tuple contains multiple tensors) is significantly more complex than 1D indexing and exercises different code paths in the FX importer and Relax backend. Please retain at least one multi-dimensional IndexPut test case.

tests/python/relax/test_frontend_from_exported_program.py (1284-1289)

medium

Removing (torch.ops.aten.bitwise_or, R.bitwise_or) while keeping the in-place version bitwise_or_ is problematic. Functional bitwise_or (e.g., x | y) is far more common in user models than the in-place version. Removing it leaves the standard functional path completely untested in the exported program frontend. Please retain the functional bitwise_or test case.

tests/python/relax/test_frontend_from_fx.py (4404-4412)

medium

Removing test_arange and test_empty completely removes coverage for these factory operators in the FX frontend (from_fx). While they might be tested in the exported program frontend, the FX frontend is a separate importer with its own translation logic. Removing these tests leaves these common operators completely untested in the FX frontend.

tests/python/relax/test_frontend_from_fx.py (5699-5710)

medium

Removing Gather1, Gather2, and Gather3 leaves only Gather0 (axis 0). Negative axis handling (e.g., dim=-1, dim=-2) is a frequent source of bugs in deep learning compilers due to axis normalization requirements. Removing these cases eliminates coverage for negative axis normalization in torch.gather.

tests/python/relax/test_frontend_from_fx.py (6716-6721)

medium

Removing test_eye and test_linspace completely removes coverage for these factory operators in the FX frontend. Please retain these tests to prevent silent regressions in the FX importer.

@tlopex tlopex marked this pull request as ready for review July 16, 2026 22:52
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