Skip to content

feat: Make scaffolding Controller more generic #3408 #3416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2025

Conversation

WeiHaocheng
Copy link
Collaborator

@WeiHaocheng WeiHaocheng commented Apr 9, 2025

We need to do some optimizations to make the Controller more generic, which will help with better modularity.
These changes will not affect the existing API.

  • We hope the Controller such as MajorityVoteController can be constructed by any Generation Controller. For a example, the Generation Controller may be a dynasor cot Controller which will yield for different and uncertainly turns between different sample. To resolve that, we support yield "ParallelProcess" to "ScaffoldingLlm". The code of majority vote controller looks like:

`

controllers = [self.generation_controller.clone() for _ in range(sample_num)]

tasks_list = [[copy.deepcopy(tasks[0])] for _ in range(sample_num)]

kwargs_list = [kwargs for _ in range(sample_num)]

yield ParallelProcess(generation_controllers, tasks_list,
                          generation_kwargs_list)`

Then the "ScaffoldingLlm" will run the "process" of each controller with tasks and kwargs parallel. And the generation controller here can be someone which customized by user. In other words, users can pass any class of generation controller into majority vote controller without changing the code of majority vote controller.

  • We make the reward method in BestOfNController more generic as we observe that reward methods become various in recently paper and works.

  • We remove most of type check for Task as users may override them.

@WeiHaocheng WeiHaocheng requested review from dc3671 and dongxuy04 April 9, 2025 10:53
@WeiHaocheng WeiHaocheng self-assigned this Apr 9, 2025
@WeiHaocheng
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #1604 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #1604 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #1201 completed with status: 'FAILURE'

@WeiHaocheng WeiHaocheng force-pushed the feat/itc_parallel_helpper branch from 424f777 to aa2ad63 Compare April 10, 2025 01:51
@WeiHaocheng
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #1674 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #1674 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #1252 completed with status: 'FAILURE'

@WeiHaocheng WeiHaocheng force-pushed the feat/itc_parallel_helpper branch from aa2ad63 to a6ba972 Compare April 10, 2025 02:59
@WeiHaocheng
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #1686 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #1686 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #1260 completed with status: 'SUCCESS'

@WeiHaocheng WeiHaocheng force-pushed the feat/itc_parallel_helpper branch from a6ba972 to fc07da9 Compare April 11, 2025 13:43
@WeiHaocheng
Copy link
Collaborator Author

bot run

@WeiHaocheng
Copy link
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Collaborator

PR_Github #1939 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #1939 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #1428 completed with status: 'SUCCESS'

Signed-off-by: fredw (generated by with_the_same_user script) <[email protected]>
@WeiHaocheng WeiHaocheng force-pushed the feat/itc_parallel_helpper branch from fc07da9 to ac41845 Compare April 12, 2025 13:22
@WeiHaocheng WeiHaocheng enabled auto-merge (squash) April 12, 2025 13:22
@WeiHaocheng
Copy link
Collaborator Author

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Collaborator

PR_Github #2020 [ reuse-pipeline ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #2020 [ reuse-pipeline ] completed with state SUCCESS
Reusing PR_Github #1939 for commit ac41845

@WeiHaocheng WeiHaocheng merged commit c6081ab into NVIDIA:main Apr 12, 2025
3 checks passed
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.

3 participants