Merge branch 'main' into nightly

This commit is contained in:
Daniel Han 2025-07-10 17:12:59 -07:00
commit 82554bca7f
3 changed files with 14 additions and 10 deletions

View file

@ -37,11 +37,11 @@ triton = [
]
huggingface = [
"unsloth_zoo>=2025.7.2",
"unsloth_zoo>=2025.7.4",
"packaging",
"tyro",
"transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3",
"datasets>=3.4.1",
"transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3,!=4.53.0",
"datasets>=3.4.1,<4.0.0",
"sentencepiece>=0.2.0",
"tqdm",
"psutil",
@ -381,11 +381,11 @@ colab-ampere-torch220 = [
"flash-attn>=2.6.3",
]
colab-new = [
"unsloth_zoo>=2025.7.2",
"unsloth_zoo>=2025.7.4",
"packaging",
"tyro",
"transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3",
"datasets>=3.4.1",
"transformers>=4.51.3,!=4.47.0,!=4.52.0,!=4.52.1,!=4.52.2,!=4.52.3,!=4.53.0",
"datasets>=3.4.1,<4.0.0",
"sentencepiece>=0.2.0",
"tqdm",
"psutil",

View file

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "2025.7.2"
__version__ = "2025.7.3"
__all__ = [
"SUPPORTS_BFLOAT16",

View file

@ -176,7 +176,7 @@ def grpo_trainer__prepare_inputs(function_name, function):
import re
# This matches the function signature, decorators and any comments immediately following
pattern = r"(\s*@profiling_decorator\s*\n\s*def _prepare_inputs\s*\([^\)]*\)\s*(->\s*[^:]+)?\s*:\s*\n(?:[ ]*#[^\n]*\n)*)"
match = re.search(pattern, function)
insert = (
" if hasattr(self, 'llm'):\n"
@ -196,7 +196,7 @@ def grpo_trainer__prepare_inputs(function_name, function):
rest_of_function,
flags=re.DOTALL | re.MULTILINE
)
# We also need to remove the old wake up call from the beginning of the function
# since it's injected before the comments.
header_and_comments = re.sub(
@ -373,7 +373,11 @@ def grpo_trainer_compute_loss(function_name, function):
_input_ids = input_ids
_logits_to_keep = logits_to_keep
get_logps_func = lambda model, input_ids, attention_mask, logits_to_keep, batch_size=None, compute_entropy=False: self._get_per_token_logps(model, input_ids, attention_mask, logits_to_keep, batch_size) if hasattr(self, "_get_per_token_logps") else self._get_per_token_logps_and_entropies(model, input_ids, attention_mask, logits_to_keep, batch_size, compute_entropy)['logps']
get_logps_func = \
lambda model, input_ids, attention_mask, logits_to_keep, batch_size=None, compute_entropy=False: \
self._get_per_token_logps(model, input_ids, attention_mask, logits_to_keep) \
if hasattr(self, "_get_per_token_logps") else \
self._get_per_token_logps_and_entropies(model, input_ids, attention_mask, logits_to_keep, batch_size, compute_entropy)['logps']
per_token_logps = get_logps_func(model, input_ids, attention_mask, logits_to_keep)