Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Cambrian integration #557

Merged
merged 53 commits into from
Oct 9, 2024
Merged

Initial Cambrian integration #557

merged 53 commits into from
Oct 9, 2024

Conversation

nikg4
Copy link
Collaborator

@nikg4 nikg4 commented Sep 26, 2024

  • Update pyproject and pre-commit rules to ignore many ruff/lint errors
  • Excludes Cambrian train and serve for now.
  • To facilitate future merges, all changes in Cambrian codebase are of these types:
    • Deletions (files or lines) of unused or not-needed functionality. Also, deleted extra visual Encoders and text LLMs not used in the currently published Cambrian models to keep PR size under control.
    • Edit Imports to use oumi package hierarchy
  • Updated Cambrian files to use oumi logger

Based on https://github.com/cambrian-mllm/cambrian/tree/78b97086cd96d84e62f45c7cee1b87386615a9a4

This is an initial import. It allows loading of pre-trained Cambrian models (including vision towers) with weights published on HF :

  • nyu-visionx/cambrian-phi3-3b
  • nyu-visionx/cambrian-8b
  • nyu-visionx/cambrian-13b
  • nyu-visionx/cambrian-34b

More work is needed to enable tuning, and inference.

Towards OPE-374, OPE-377

@nikg4 nikg4 changed the title [DRAFT] Initial Cambrian integration Initial Cambrian integration Sep 27, 2024
@nikg4 nikg4 requested review from oelachqar and optas September 27, 2024 00:46
@nikg4 nikg4 marked this pull request as ready for review September 27, 2024 00:47
@@ -19,6 +20,19 @@
except ImportError:
liger_kernel = None

_IS_CAMBRIAN_AVAILABLE = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my information -- in what cases would the model not be available?

Copy link
Collaborator Author

@nikg4 nikg4 Oct 9, 2024

Choose a reason for hiding this comment

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

These imports may fail if one of their transitive imports isn't available. Moved to build_cambrian()

@@ -19,6 +20,19 @@
except ImportError:
liger_kernel = None

_IS_CAMBRIAN_AVAILABLE = False
try:
from oumi.models.experimental.cambrian.mm_utils import (
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid importing those paths unless they are needed, we could:
a. Use importlib.findspec to test if available
b. Do the imports inside the build_cambrian_function.
Otherwise there is a risk that by importing these in the general case we might get errors because of missing dependencies used only by Cambrian

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved to build_cambrian() with find_spec()

@nikg4 nikg4 merged commit aa2bfc2 into main Oct 9, 2024
1 check passed
@nikg4 nikg4 deleted the xrdaukar/cambrian01 branch October 9, 2024 20:04
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