fix(formatters): pass input_ids to model.generate() so peft can compute aLoRA offsets - #1294
Closed
planetf1 wants to merge 1 commit into
Closed
fix(formatters): pass input_ids to model.generate() so peft can compute aLoRA offsets#1294planetf1 wants to merge 1 commit into
planetf1 wants to merge 1 commit into
Conversation
…te aLoRA offsets generate_with_transformers() used inputs= instead of input_ids= when calling model.generate(), causing pefts aLoRA hook to silently fall back to standard LoRA. This affected context_relevance and uncertainty intrinsics which produce wrong or truncated output without aLoRA. Closes generative-computing#1286 Assisted-by: opencode Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
This was referenced Jun 18, 2026
Contributor
Author
|
Just to be explicit on the broader impact: generate_with_transformers() is the core inference utility for the LocalHFBackend. This is not just a test failure—it means any user running these intrinsics via the HF backend silently gets degraded output (truncated JSON or wrong scores) because PEFT transparently disables aLoRA and falls back to standard LoRA. |
Contributor
Author
|
Closed, as it is easy to test/validate that the full set of adapter functions. |
8 tasks
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.
Problem
context_relevance_aloraanduncertainty_aloraintrinsic tests fail on CPU (and GPU) because PEFT cannot compute aLoRA prefix offsets. The warning confirms the root cause:When aLoRA fails, PEFT silently falls back to standard LoRA. Most intrinsics tolerate this, but
context_relevanceanduncertaintyproduce wrong or truncated JSON output.Root Cause
mellea/formatters/granite/base/util.py:396— the call tomodel.generate()usesinputs=instead of the canonicalinput_ids=:PEFTs aLoRA hook inspects the
input_idskwarg at runtime. Missing it → aLoRA disabled.Fix
One-line change:
inputs=→input_ids=ingenerate_with_transformers().Testing
context_relevance_alora,uncertainty_alora,answerability_answerable_alora,requirement_check_aloraquery_clarificationwhich was confirmed by reverting this change and re-running that test with the same result)317d5d9dCloses #1286