[multi-lora] 1/n - 2, ci: verify import targets in the source-resolution harness step - #2725
Open
yushengsu-thu wants to merge 2 commits into
Open
[multi-lora] 1/n - 2, ci: verify import targets in the source-resolution harness step#2725yushengsu-thu wants to merge 2 commits into
yushengsu-thu wants to merge 2 commits into
Conversation
Statically resolves every miles-internal import site (including function-local ones) against the tree and imports all modules of optional namespaces when they are present, so moved or deleted modules fail fast in CPU CI instead of at runtime.
yushengsu-thu
marked this pull request as ready for review
August 23, 2026 23:59
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Move the import-integrity checks out of the fast suite and into tests/ci/verify_source_resolution.py, which every CPU and GPU CI job runs before pytest: statically resolve every miles-internal import site (including function-local ones) across miles/ and examples/, walk the optional namespaces in full when present, and import the update_weight lazy-import targets. Failures raise RuntimeError with the offending file:line and import target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends
tests/ci/verify_source_resolution.py— the pre-test step every CPU and GPU CI job already runs — with import-integrity checks: statically resolve every miles-internal import site (module-level, function-local, and relative) acrossmiles/andexamples/against the source tree, walk the optional multi-lora namespaces in full when present (absent packages skip cleanly on main), and import theupdate_weight/lazy-import targets. Failures raiseRuntimeErrorwith the offendingfile:lineand import target; missing non-miles optional deps stay tolerated.Running this in the harness step instead of a fast test covers every job (CPU and GPU) before pytest even starts, which is broader than the fast suite. Born from the
mixin.pydead lazy-import incident, where a moved module was only referenced from a function-local import and nothing failed until runtime.Extracted from #2273; the stack rebases after this merges.