Skip to content

Conversation

@jeejeelee
Copy link
Collaborator

@jeejeelee jeejeelee commented Nov 12, 2025

Purpose

Part of #23474

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: Jee Jee Li <[email protected]>
@jeejeelee jeejeelee marked this pull request as draft November 12, 2025 10:39
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is part of an effort to remove the LoRA extra vocabulary feature. The changes to the model implementations in granite.py and teleflm.py are consistent with this goal, and tests related to the extra vocabulary feature have been correctly removed. However, I've found a critical issue in tests/lora/test_lora_manager.py where a change breaks a test, which will need to be addressed.

new_embeddings = load_file(
os.path.join(sql_lora_files, "new_embeddings.safetensors")
)
new_embeddings = load_file(os.path.join(sql_lora_files, ""))
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

load_file(os.path.join(sql_lora_files, "")) will attempt to load from a directory path, which will raise an IsADirectoryError and cause the test to fail.

Since new embeddings are being removed, new_embeddings should likely be an empty dictionary.

Please note that changing this line to new_embeddings = {} will reveal another issue in this test: a KeyError will be raised on line 83. The test logic from line 77 onwards needs to be updated to reflect that lora.embeddings_tensor is now always None. The if/else block can be simplified to assert lora.embeddings_tensor is None.

Suggested change
new_embeddings = load_file(os.path.join(sql_lora_files, ""))
new_embeddings = {}

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 48 to 52
@pytest.mark.parametrize("device", DEVICES)
def test_from_lora_tensors(sql_lora_files, device):
tensors = load_file(os.path.join(sql_lora_files, "adapter_model.safetensors"))
new_embeddings = load_file(
os.path.join(sql_lora_files, "new_embeddings.safetensors")
)
new_embeddings = load_file(os.path.join(sql_lora_files, ""))

Choose a reason for hiding this comment

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

P1 Badge Avoid loading deleted new_embeddings file

The updated test still calls load_file(os.path.join(sql_lora_files, "")), which resolves to the LoRA directory itself. safetensors.torch.load_file only accepts paths to .safetensors files and will raise IsADirectoryError, so test_from_lora_tensors now crashes before exercising any behaviour. If extra vocab embeddings are no longer used, this load should be dropped or replaced with a stub so the test can run.

Useful? React with 👍 / 👎.

@mergify mergify bot added llama Related to Llama models tpu Related to Google TPUs labels Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llama Related to Llama models tpu Related to Google TPUs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant