Skip to content

Conversation

@frreiss
Copy link
Collaborator

@frreiss frreiss commented Nov 11, 2025

This PR includes changes from @jakelorocco that implement intrinsics support, plus additional changes that I have made to enable the RAG intrinsics to work.

Jacob's changes:

  • Major rewrite of the guts of three different backends
  • GraniteCommonAdapter class and supporting classes
  • Replace code that calls aLoRA adapters directly with code that uses equivalent intrinsics
  • Some test cases
  • Documentation

My additional changes:

  • Modify intrinsics loading to support switching between Hugging Face Hub repositories (AKA "models")
  • Add Python functions to serve as entry points for existing RAG intrinsics
  • Add test cases of existing RAG intrinsics

@mergify
Copy link

mergify bot commented Nov 11, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@frreiss frreiss changed the title Manual merge of main Draft: Updates for intrinsics support Nov 11, 2025
@frreiss frreiss changed the title Draft: Updates for intrinsics support feat: Updates for intrinsics support Nov 11, 2025
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
@jakelorocco jakelorocco self-requested a review November 11, 2025 13:56
Copy link
Contributor

@jakelorocco jakelorocco left a comment

Choose a reason for hiding this comment

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

looks mostly good to me! I left a few comments and we should definitely let others review as well (I will bring this up in our team meeting Wednesday).

Also, it looks like the pre-commit checks are failing. I think it's an issue from my base branch, but could you please run pre-commit run --files mellea/backends/openai.py. Or you can just move from enum import Enum below from copy import deepcopy in that file.

Once that gets fixed, we can make sure the github runners can run the new tests (else we'll have to mark them as qualitative). Thank you!

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
@frreiss
Copy link
Collaborator Author

frreiss commented Nov 11, 2025

FYI @pronics2004

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Comment on lines 62 to 67
base_model_name = backend.model_id
if base_model_name is None:
raise ValueError("Backend has no model ID")
adapter = GraniteCommonAdapter(
repo_id, intrinsic_name, adapter_type, base_model_name=base_model_name
)
Copy link
Contributor

@jakelorocco jakelorocco Nov 11, 2025

Choose a reason for hiding this comment

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

After the discussion on other comments, I also realize a difference here. Because we are no longer creating the adapter config in the backend, the base_model_name must be known here (when the Backend could be any type of backend).

Let me investigate a solution, but backend.model_id can be of types str | ModelIdentifier. At the very least, we should handle some basic version of the ModelIdentifier case. I was splitting on the .hf_model_name but that might not be the best assumption at this point.

Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Copy link
Contributor

@jakelorocco jakelorocco left a comment

Choose a reason for hiding this comment

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

@frreiss, I also have a few changes related to my previous comments. How would you like to handle those? I can fork your fork and open up a PR, you can give me access to your repo, or I can send you the git diff.

@jakelorocco
Copy link
Contributor

@frreiss, I also have a few changes related to my previous comments. How would you like to handle those? I can fork your fork and open up a PR, you can give me access to your repo, or I can send you the git diff.

@frreiss, I opened up this fork and pull request with my changes: frreiss#3. Please let me know if you see any issues / would prefer I merge these changes differently. Otherwise, please merge if you are okay with them.

feat: small changes to intrinsics; along with fixes to docs / tests
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
Signed-off-by: Fred Reiss <frreiss@us.ibm.com>
@frreiss
Copy link
Collaborator Author

frreiss commented Nov 15, 2025

This PR should be ready to merge now, but the CI workflow keeps canceling itself after 7 minutes.

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