[AMD/NPU] Pin transformers to stable 4.57.1#14722
[AMD/NPU] Pin transformers to stable 4.57.1#14722sunxxuns wants to merge 1 commit intosgl-project:mainfrom
Conversation
Summary of ChangesHello @sunxxuns, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the stability of logprob computations within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
8341fbe to
cb6c96a
Compare
There was a problem hiding this comment.
Code Review
This pull request addresses a ZeroDivisionError that occurs when recalculating normalized prompt log probabilities after removing a healed token. The fix correctly introduces a check to ensure the number of tokens is greater than one before division. Additionally, a new check is added to gracefully handle cases where logprobs may be empty, preventing potential IndexError exceptions. While the changes are good, I've identified a logic issue where the normalized log probability is not updated when the last remaining token is removed, which could lead to incorrect selections. I've provided a suggestion to address this.
b6556dc to
4cc4db3
Compare
50a2d82 to
f23d2a8
Compare
c43d687 to
58a6e9a
Compare
9683762 to
b612dc6
Compare
transformers 5.0.0rc0 has a regression on AMD where input_token_logprobs returns only 1 aggregated entry with None values instead of per-token logprobs. This breaks the select functionality (test_select and test_hellaswag_select). Change pyproject_other.toml (used by AMD and NPU) to use the stable 4.57.1 version instead of the release candidate 5.0.0rc0. Tested locally on MI300x: - transformers 4.57.1: works correctly (3 logprob entries per choice) - transformers 5.0.0rc0: broken (1 entry with None values)
b612dc6 to
b2dc76e
Compare
|
#14801 merged |
Summary
Fix
test_hellaswag_selectandtest_selectfailures on AMD/ROCm instage-a-test-1-amd.Root Cause
transformers==5.0.0rc0has a regression on AMD whereinput_token_logprobsreturns only 1 aggregated entry withNonevalues instead of per-token logprobs. This breaks the select functionality.Solution
Change
pyproject_other.toml(used by AMD and NPU) to use the stable4.57.1version instead of the release candidate5.0.0rc0.Testing
Tested locally on MI300x:
transformers 4.57.1: works correctly (3 logprob entries per choice)transformers 5.0.0rc0: broken (1 entry with None values)Test plan
stage-a-test-1-amdshould pass