Skip to content

improve model load logging#143

Merged
ncfrey merged 3 commits intomainfrom
n/model-load-logging
Jul 11, 2025
Merged

improve model load logging#143
ncfrey merged 3 commits intomainfrom
n/model-load-logging

Conversation

@ncfrey
Copy link
Contributor

@ncfrey ncfrey commented Jul 10, 2025

Description

This pull request introduces enhancements to logging and model configuration validation in the UME model's codebase, along with updates to supported model variants. The changes aim to improve transparency during model loading, debugging, and validation processes. Additionally, a new task has been added to the evaluation script.

Logging Enhancements:

  • src/lobster/evaluation/dgeb_adapter.py: Added detailed logging for model configurations during loading and creation, including embedding dimensions, number of layers, and total parameters. This helps track model properties during runtime. [1] [2] [3] [4]
  • src/lobster/model/_ume.py: Introduced logging for model loading, checkpoint validation, and parameter count checks against expected ranges. This ensures proper model initialization and provides warnings for mismatches. [1] [2]
  • src/lobster/model/_utils_checkpoint.py: Enhanced logging for checkpoint loading and retry mechanisms, including detailed error handling for corrupted checkpoints.

Model Configuration Updates:

  • src/lobster/model/_ume.py: Added support for a new model variant, ume-small-base-90M, expanding the range of available pretrained models.

Evaluation Script Update:

  • slurm/scripts/eval_dgeb_ume.sh: Included the ec_dna_classification task in the evaluation script for DNA modality, broadening the scope of tasks being evaluated.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

  • Tests pass locally
  • Added new tests for new functionality
  • Updated existing tests if needed

Checklist

  • Code follows style guidelines
  • Self-review completed
  • Documentation updated if needed
  • No breaking changes (or clearly documented)

@ncfrey ncfrey requested a review from taylormjs July 10, 2025 15:32
@ncfrey ncfrey temporarily deployed to test.pypi.org July 10, 2025 15:38 — with GitHub Actions Inactive
Copy link
Collaborator

@taylormjs taylormjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to move the metadata method from the dgeb adapter to UME. Other than that, logging looks solid

uv run lobster_dgeb_eval \
ume-mini-base-12M \
--modality dna \
--tasks ec_dna_classification \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one task by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to loop through all tasks


# Validate the loaded model
logger.info("Validating loaded model configuration...")
total_params = sum(p.numel() for p in model.parameters())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about making a metadata property method within the UME class and calling that throughout UME & dgeb_adapter? That might remove some redundancies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata is just to satisfy what BioSeqTransformer expects when we wrap it; i think most of the actual properties are already contained in the model config

@ncfrey ncfrey temporarily deployed to test.pypi.org July 10, 2025 18:47 — with GitHub Actions Inactive
@ncfrey ncfrey merged commit e7d2b43 into main Jul 11, 2025
5 checks passed
@ncfrey ncfrey deleted the n/model-load-logging branch July 11, 2025 14:42
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.

2 participants