Skip to content

Conversation

@mergennachin
Copy link
Contributor

Summary:
These tests were skipped with "Emitter is not ready yet" but the issue was
that they were using the deprecated exir.CaptureConfig API. Rewrote both tests
to use the modern torch.export.export() -> to_edge() -> to_executorch() pipeline.

Note: The higher-order map operation specializes on the iteration dimension at
export time, so varying batch sizes are not supported. The tests now verify that
map-based models can be correctly exported and executed through the ExecuTorch
pipeline.

Authored with Claude Code.

Differential Revision: D90890790

Copilot AI review requested due to automatic review settings January 16, 2026 21:55
@pytorch-bot
Copy link

pytorch-bot bot commented Jan 16, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/16666

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 Cancelled Jobs, 6 Unrelated Failures

As of commit dd7785c with merge base 9cdc558 (image):

CANCELLED JOBS - The following jobs were cancelled. Please retry:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 16, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Jan 16, 2026

@mergennachin has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90890790.

@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@mergennachin mergennachin requested a review from rascani January 16, 2026 21:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables two previously skipped tests for higher-order map operations by migrating them from the deprecated exir.CaptureConfig API to the modern torch.export.export() pipeline. The tests were previously disabled with "Emitter is not ready yet" but the actual issue was that they used deprecated APIs.

Changes:

  • Removed @skipUnless decorators from test_ft_map_basic and test_ft_map_dynshape
  • Migrated both tests from maketest() helper to manual torch.export.export() -> to_edge() -> to_executorch() pipeline
  • Added comprehensive docstrings explaining map operation behavior and limitations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

),
)(self)
"""Test FTMapBasic model through the modern torch.export API."""
from executorch.exir import EdgeCompileConfig, to_edge
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The import statement from executorch.exir import EdgeCompileConfig, to_edge is redundant since EdgeCompileConfig is already imported at the module level (line 26). Consider using the existing module-level import and only importing to_edge locally, or move both imports to the top of the file for consistency with other imports in this test file.

Suggested change
from executorch.exir import EdgeCompileConfig, to_edge
from executorch.exir import to_edge

Copilot uses AI. Check for mistakes.
),
)(self)
"""Test FTMapBasic model through the modern torch.export API."""
from executorch.exir import EdgeCompileConfig, to_edge
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The import statement from executorch.exir import EdgeCompileConfig, to_edge is redundant since EdgeCompileConfig is already imported at the module level (line 26). Consider using the existing module-level import and only importing to_edge locally, or move both imports to the top of the file for consistency with other imports in this test file.

Suggested change
from executorch.exir import EdgeCompileConfig, to_edge
from executorch.exir import to_edge

Copilot uses AI. Check for mistakes.
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Jan 16, 2026

@mergennachin has imported this pull request. If you are a Meta employee, you can view this in D90890790.

Summary:
These tests were skipped with "Emitter is not ready yet" but the issue was
that they were using the deprecated exir.CaptureConfig API. Rewrote both tests
to use the modern torch.export.export() -> to_edge() -> to_executorch() pipeline.

Note: The higher-order map operation specializes on the iteration dimension at
export time, so varying batch sizes are not supported. The tests now verify that
map-based models can be correctly exported and executed through the ExecuTorch
pipeline.

Authored with Claude Code.


Reviewed By: rascani

Differential Revision: D90890790

Pulled By: mergennachin
Copilot AI review requested due to automatic review settings January 17, 2026 00:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

),
)(self)
"""Test FTMapBasic model through the modern torch.export API."""
from executorch.exir import EdgeCompileConfig, to_edge
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

EdgeCompileConfig is already imported at the module level (line 26). Only to_edge needs to be imported here since it's not available at the module level.

Suggested change
from executorch.exir import EdgeCompileConfig, to_edge
from executorch.exir import to_edge

Copilot uses AI. Check for mistakes.
Comment on lines +732 to +743
# Test execution matches eager mode
eager_output = model(*inputs)
et_output = executorch_module.forward(list(inputs))[0]

# Compare outputs
torch.testing.assert_close(
et_output,
eager_output,
rtol=1e-5,
atol=1e-8,
msg="ExecuTorch output doesn't match eager output",
)
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

This test only validates a single execution with one set of inputs. The previous maketest approach ran 10 iterations with different random inputs (niter=10) to catch edge cases and ensure consistent behavior. Consider adding a loop to test multiple random input sets for more robust validation.

Copilot uses AI. Check for mistakes.
that the map-based model can be exported and executed correctly through the
ExecuTorch pipeline using the modern torch.export.export() API.
"""
from executorch.exir import EdgeCompileConfig, to_edge
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

EdgeCompileConfig is already imported at the module level (line 26). Only to_edge needs to be imported here since it's not available at the module level.

Copilot uses AI. Check for mistakes.
Comment on lines +788 to +799
# Test execution matches eager mode
eager_output = model(*inputs)
et_output = executorch_module.forward(list(inputs))[0]

# Compare outputs
torch.testing.assert_close(
et_output,
eager_output,
rtol=1e-5,
atol=1e-8,
msg="ExecuTorch output doesn't match eager output",
)
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

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

This test only validates a single execution with one set of inputs. The previous maketest approach ran 10 iterations with different random inputs (niter=10) to catch edge cases and ensure consistent behavior. Consider adding a loop to test multiple random input sets for more robust validation.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants