Skip to content

Conversation

@psiddh
Copy link
Contributor

@psiddh psiddh commented Dec 23, 2025

Changed cortex_m_pass_manager.py to use relative imports (from .activation_fusion_pass) instead of absolute imports (from executorch.backends.cortex_m.passes) for intra-package references. This breaks the circular import chain: init.py → cortex_m_pass_manager.py → init.py

Resolves: ImportError: cannot import name 'ActivationFusionPass' from partially initialized module 'executorch.backends.cortex_m.passes'

Summary

[PLEASE REMOVE] See CONTRIBUTING.md's Pull Requests for ExecuTorch PR guidelines.

[PLEASE REMOVE] If this PR closes an issue, please add a Fixes #<issue-id> line.

[PLEASE REMOVE] If this PR introduces a fix or feature that should be the upcoming release notes, please add a "Release notes: " label. For a list of available release notes labels, check out CONTRIBUTING.md's Pull Requests.

Test plan

[PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.

@pytorch-bot
Copy link

pytorch-bot bot commented Dec 23, 2025

🔗 Helpful Links

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

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

❌ 2 New Failures, 4 Unrelated Failures

As of commit f776870 with merge base 39203cf (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

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 Dec 23, 2025
@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.

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 fixes a circular import error in the cortex_m passes module by converting absolute imports to relative imports in cortex_m_pass_manager.py. The circular dependency chain (__init__.pycortex_m_pass_manager.py__init__.py) is broken by having cortex_m_pass_manager.py import directly from individual pass modules rather than through the package's __init__.py.

Key Changes:

  • Replaced absolute imports (from executorch.backends.cortex_m.passes import ...) with relative imports (from .activation_fusion_pass import ...) for all six pass classes
  • Moved import statements to maintain proper ordering (after external imports, before usage)

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

Changed cortex_m_pass_manager.py to use relative imports (from .activation_fusion_pass)
instead of absolute imports (from executorch.backends.cortex_m.passes) for
intra-package references. This breaks the circular import chain:
__init__.py → cortex_m_pass_manager.py → __init__.py

Resolves: ImportError: cannot import name 'ActivationFusionPass' from
partially initialized module 'executorch.backends.cortex_m.passes'
@psiddh psiddh marked this pull request as ready for review December 23, 2025 21:41
@psiddh psiddh merged commit 1ce615e into pytorch:main Dec 23, 2025
288 of 294 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants