-
Notifications
You must be signed in to change notification settings - Fork 53
feat: majority voting sampling strategy #142
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
jakelorocco
merged 16 commits into
generative-computing:main
from
yelkurdi:majority_voting
Oct 3, 2025
+447
−2
Merged
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1cfb516
initial commit for majority voting
a7f3a7d
adds .gitignore to test dir
19e36e5
removed naive exact-match and replaced it with Math-Verify
dbdb518
adjusted string comparison ref vs pred relation - fixed some type che…
18c609d
adds MBRD rougeL similarity - refactors MBRD base class
cff6f7b
Merge branch 'main' into majority_voting
yelkurdi 2577546
fixes tests removes dependency on vLLM and uses default ollama
0b6c4b0
merge main with async sampling calls, majority voting now fully suppo…
yelkurdi 5840447
minor fix to pyproject.toml
yelkurdi 35de685
allow self-voting, and default symmetry, removed redundant variables …
yelkurdi 17f05f4
Merge branch 'main' into majority_voting
yelkurdi 7829865
Merge branch 'main' into majority_voting
yelkurdi 7709b12
Added special ficture for tests to run on github action runners
yelkurdi 11f3cc5
Merge branch 'main' into majority_voting
yelkurdi 59a9398
fix: minor tweaks to get automation to pass, remove redundant mellea …
jakelorocco 2f4ed52
Merge branch 'main' into majority_voting
jakelorocco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| vllm.err | ||
| vllm.log |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Test for OpenAI API served by VLLM | ||
|
|
||
| ## Requirement | ||
|
|
||
| anaconda / miniconda / miniforge. | ||
|
|
||
| Make sure to run the test with multiple cores available (e.g. in a cloud instance / cluster job). | ||
| Although you may think 1 core is enough, | ||
| vllm could get stuck due to deadlock if so. | ||
|
|
||
| ## Installation | ||
|
|
||
| Run the `install.sh` script, which needs to be done only once. | ||
| The script creates a new conda environment named "mellea_tbf" only for the purposes of testing or contributing to the think budget-forcing feature. | ||
|
|
||
| Run `./install.sh` | ||
|
|
||
| ## Testing | ||
|
|
||
| ``` shell | ||
| ./run_test.sh | ||
| ``` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
|
|
||
| name: mellea_mv | ||
| channels: | ||
| - conda-forge | ||
| dependencies: | ||
| - python=3.12 # note: at the time of writing, xformer (< vllm) has a broken wheel for 3.13. https://github.com/facebookresearch/xformers/issues/740#issuecomment-2753869337 | ||
| - uv |
10 changes: 10 additions & 0 deletions
10
test/stdlib_basics/test_majority_voting/exec_sampling_test.sh
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #!/bin/bash | ||
|
|
||
| source set_variables.sh | ||
|
|
||
| eval "$(conda shell.bash hook)" | ||
| conda activate $ENV_NAME | ||
|
|
||
| export LOCAL_TEST_MODEL | ||
|
|
||
| python test_majority_voting.py |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/bash -xe | ||
|
|
||
| source set_variables.sh | ||
|
|
||
| conda env remove -y -n $ENV_NAME || true | ||
| conda env create -f $(readlink -f $(dirname $0))/environment.yml | ||
|
|
||
| in-conda (){ | ||
| conda run -n $ENV_NAME $@ | ||
| } | ||
|
|
||
|
|
||
| cd ../../../ | ||
| in-conda uv pip install -e . | ||
| cd - | ||
| in-conda uv pip install pre-commit | ||
| in-conda uv pip install pytest | ||
| in-conda uv pip install vllm==0.10.0 | ||
| in-conda uv pip install outlines | ||
| # in-conda uv pip install unsloth | ||
| in-conda uv pip install ipdb | ||
| in-conda uv pip install math-verify[antlr4_13_2] | ||
| in-conda uv pip install rouge-score | ||
|
|
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/bin/bash | ||
|
|
||
| source set_variables.sh | ||
|
|
||
| eval "$(conda shell.bash hook)" | ||
| conda activate $ENV_NAME | ||
|
|
||
| rm $VLLM_LOG $VLLM_ERR | ||
|
|
||
| bash ./serve.sh & | ||
| VLLM_PID=$! | ||
|
|
||
| trap "kill -SIGINT $VLLM_PID ; wait" EXIT | ||
|
|
||
| while sleep 1 ; do | ||
| if grep -q "Application startup complete." $VLLM_ERR | ||
| then | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| bash exec_sampling_test.sh | ||
|
|
||
|
|
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.