Skip to content

models: guard legacy imports against NumPy >=2.3 / numba conflict#328

Open
jsschreck wants to merge 1 commit intomainfrom
fix/legacy-model-imports
Open

models: guard legacy imports against NumPy >=2.3 / numba conflict#328
jsschreck wants to merge 1 commit intomainfrom
fix/legacy-model-imports

Conversation

@jsschreck
Copy link
Copy Markdown
Collaborator

@jsschreck jsschreck commented Apr 8, 2026

Summary

bridgescaler pulls in numba, which breaks on NumPy >=2.3 in CI — import credit.models hard-fails and no tests run.

This wraps the legacy model imports in a try/except and exposes _LEGACY_MODELS_AVAILABLE so test suites can skip gracefully rather than error out.

This is a CI compatibility fix, not a gen2 architectural change. Splitting it out of the [1/4] trainer PR so it can merge independently.

@djgagnebridgescaler is yours. Ideally this guard lives upstream (bridgescaler pins or drops the numba dependency for NumPy >=2.3) so CREDIT does not need to own it. Flagging here so it is on your radar.

@charlie-becker — tagging you as well since this touches model loading.

Files

  • credit/models/__init__.py — try/except around legacy imports, _LEGACY_MODELS_AVAILABLE flag
  • tests/test_models.py — skip guards using the flag
  • tests/test_model_loading.py — new tests for load_model / load_fsdp_or_checkpoint_policy error paths

Test plan

  • CI passes on Python 3.11/3.12/3.13
  • python -m pytest tests/test_models.py tests/test_model_loading.py

bridgescaler pulls in numba, which breaks on NumPy >=2.3 in CI.
Wrap all legacy model imports in a try/except and expose
_LEGACY_MODELS_AVAILABLE so tests can skip gracefully.

This is a CI compatibility fix unrelated to gen2 trainer work.
/cc @djgagne — bridgescaler is yours; ideally this guard lives
upstream so CREDIT does not need to own it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jsschreck added a commit that referenced this pull request Apr 8, 2026
- credit/models/__init__.py: reverted to main; guard moved to PR #328
- tests/test_model_loading.py: moved to PR #328
- tests/test_models.py: reverted to main; moved to PR #328
- credit/models/wxformer/README.md: moved to [3/4] config-docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant