Skip to content

[Fix] revert "Optimize tuple unpacking in skyrl_gym_generator.generate() "#150

Merged
SumanthRH merged 2 commits intoNovaSky-AI:mainfrom
SumanthRH:fix-main
Aug 15, 2025
Merged

[Fix] revert "Optimize tuple unpacking in skyrl_gym_generator.generate() "#150
SumanthRH merged 2 commits intoNovaSky-AI:mainfrom
SumanthRH:fix-main

Conversation

@SumanthRH
Copy link
Member

What does this PR do?

Reverts #138 since it's incorrect after #145 - rollout_logprobs is also returned now and it's dtype is Optional[List[float]].

Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
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.

Summary of Changes

Hello @SumanthRH, 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 reverts a previous optimization in the skyrl_gym_generator.py file. The original optimization, which used a more concise method for unpacking tuples, became incorrect and incompatible after a recent change introduced an optional return value. The revert restores the previous, more robust unpacking mechanism to ensure correct functionality.

Highlights

  • Revert of Optimization: The previous optimization in the generate method of skyrl_gym_generator.py that used map(list, zip(*all_outputs)) for tuple unpacking has been reverted.
  • Compatibility Fix: This revert is necessary to maintain compatibility with the changes introduced in PR #145, which added rollout_logprobs as an Optional[List[float]] return value. The zip approach would fail when dealing with tuples of varying lengths due to this optional field.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 reverts a previous optimization for tuple unpacking that became incorrect after a function's return signature changed. The revert correctly fixes the resulting bug. My review includes a suggestion to replace the reverted code, which uses an inefficient sum(..., []) pattern, with a more performant and idiomatic list comprehension approach.

Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
@SumanthRH SumanthRH merged commit c9827b3 into NovaSky-AI:main Aug 15, 2025
3 checks passed
dzorlu referenced this pull request in fleet-ai/SkyRL Feb 4, 2026
…e() " (#150)

# What does this PR do?


Reverts #138 since it's incorrect after #145 - `rollout_logprobs` is
also returned now and it's dtype is `Optional[List[float]]`.

Also simplifies original approach a bit

---------

Signed-off-by: SumanthRH <sumanthrh99@gmail.com>
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