models: guard legacy imports against NumPy >=2.3 / numba conflict#328
Open
models: guard legacy imports against NumPy >=2.3 / numba conflict#328
Conversation
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>
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.
Summary
bridgescalerpulls innumba, which breaks on NumPy >=2.3 in CI —import credit.modelshard-fails and no tests run.This wraps the legacy model imports in a try/except and exposes
_LEGACY_MODELS_AVAILABLEso 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.
@djgagne —
bridgescaleris 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_AVAILABLEflagtests/test_models.py— skip guards using the flagtests/test_model_loading.py— new tests forload_model/load_fsdp_or_checkpoint_policyerror pathsTest plan
python -m pytest tests/test_models.py tests/test_model_loading.py