Skip to content

Fix affected-model scoping for concrete model file changes - #528

Merged
justinchuby merged 4 commits into
mainfrom
copilot/fix-lint-and-windows-ci
Aug 21, 2026
Merged

justinchuby merged 4 commits into
mainfrom
copilot/fix-lint-and-windows-ci

Conversation

Copilot AI commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

The CI model-impact detection was over-scoping file changes, so a diff in one concrete model implementation could incorrectly trigger sibling models in the same import graph. That widened the test matrix and made the PR- and Windows-targeted CI behavior less precise than intended.

  • Scope

    • Model files are now treated as direct registrations first.
    • Only shared/base modules without a direct registry mapping continue through reverse-dependency tracing.
    • This keeps broad import-graph impact analysis for infra changes without cascading unrelated model types when a single model implementation changes.
  • Fix

    • In scripts/detect_affected_models.py, the model-file path handling now stops after adding the directly registered model types for that module.
    • Reverse-dependency expansion remains available for non-directly-registered modules such as shared base classes, preserving the existing dependency-based behavior where it is actually useful.
  • Why this matters

    • A change to src/mobius/models/lfm2.py no longer incorrectly includes lfm2_vl just because both share common imports or a base implementation.
    • The affected-model list stays aligned with the actual registry ownership of the file being changed, which is the right scope for CI targeting.
if module_name in registry_map:
    affected.update(registry_map[module_name])
    continue

This narrows the detection to the actual model registration boundary while preserving import-graph tracing for shared infrastructure files.

@CLAassistant

CLAassistant commented Aug 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ justinchuby
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI linked an issue Aug 21, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix lint issues and improve Windows CI Fix affected-model scoping for concrete model file changes Aug 21, 2026
Copilot AI requested a review from justinchuby August 21, 2026 04:39
@justinchuby
justinchuby marked this pull request as ready for review August 21, 2026 05:09
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 21, 2026 05:09
@github-actions

github-actions Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 79b48bc → 5542f51

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 60 60 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 66 66 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 105 105 +0.0% ⚪
gpt2 model_size_bytes 388 KB 388 KB +0.0% ⚪
gpt2 num_nodes 54 54 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 60 60 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 56 56 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 94 94 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 58 58 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 54 54 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 60 60 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 264 264 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 126 126 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 428 428 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 166 166 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

Copilot AI 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.

Pull request overview

This pull request tightens CI “affected model” detection so that changes to a concrete model implementation map to the model_types that module directly registers, instead of expanding through the broader import graph and inflating the test matrix.

Changes:

  • Adds an early-exit for model modules that have a direct registry mapping, limiting impact to the module’s registered model_types.
  • Clarifies intent via inline comments, preserving reverse-dependency scanning for non-directly-registered/shared modules.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/detect_affected_models.py Resolved
@justinchuby

Copy link
Copy Markdown
Member

@copilot also fix lint and windows ci errors

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby merged commit 4097572 into main Aug 21, 2026
12 of 13 checks passed
@justinchuby
justinchuby deleted the copilot/fix-lint-and-windows-ci branch August 21, 2026 14:55
Copilot stopped work on behalf of justinchuby due to an error August 21, 2026 14:56
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.

Fix lint and windows CI

4 participants