fix(miles-pipeline): narrow startup-validation import guard to ModuleNotFoundError#32
Open
TianyeGGBond wants to merge 1 commit into
Open
Conversation
…NotFoundError The F10 topology validation import was wrapped in `except Exception`, which skipped all validation on any import error and defeated the fail-fast intent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Context
MilesPipeline._validate_topology()runs the F10 startup topology validation before any GPU allocation, so a misconfigured run fails fast with a clear message instead of OOM-ing mid-init.It imports the validator lazily and wraps the import in a guard so a machine without
milesinstalled (test/dev fixtures) can still construct the pipeline:Problem
except Exceptionis too broad. It catches any failure while importing the validator — not just "miles not installed" (ModuleNotFoundError), but alsoSyntaxError,AttributeError, or a broken transitive import insiderlix_validationitself (ImportError). In all those cases the code logs a warning and silently skips every C1–C23 check, which defeats the whole point of the fail-fast guard: a real bug in the validator would let a misconfigured topology through to a mid-init OOM.In production
milesis always importable, so the only legitimate skip reason isModuleNotFoundError(package genuinely absent). Anything else is a real bug and should propagate. This also matches the existing narrow pattern incoordinator.py(except ModuleNotFoundErroron dynamicpipeline_clsimport).Change
except Exceptiontoexcept ModuleNotFoundError.# noqa: BLE001(no longer a blind except).ImportError/SyntaxErrornow propagate and fail fast; themiles_args is Nonetest-fixture path (a few lines up) is unaffected.🤖 Generated with Claude Code