Repository navigation
Drive multi-task local lm-eval with completions - #98
Merged
Merged
Conversation
Crystal already sends comma-separated lm-eval task names, but the local wrapper kept EVAL_TASKS_DIR as a single YAML and skipped HumanEval's unsafe-code flag. Map the Magpie env into InferenceX and confirm code-execution tasks so multi-task accuracy runs actually execute.
amd-nithya
requested review from
a team,
haofrank and
sinarafati-amd
as code owners
September 17, 2026 19:42
haofrank
requested changes
Sep 17, 2026
haofrank
reviewed
Sep 17, 2026
haofrank
requested changes
Sep 17, 2026
…ferenceX. Magpie now invokes local-completions itself when MAGPIE_EVAL_TASKS is set so loglikelihood tasks and HumanEval flags survive server-watch, and HF_ALLOW_CODE_EVAL is set for code eval. Co-authored-by: Cursor <cursoragent@cursor.com>
lm-eval writes into a directory, so Magpie copies the newest result to results_concN.json and keeps conc 8 and 64 distinguishable for downstream gates. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover local-completions multiple-choice scoring, --confirm_run_unsafe_code, and HF_ALLOW_CODE_EVAL against a real lm-eval process. Skip when lm-eval is not installed so Magpie unit CI stays lightweight. Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
Author
|
The mocked argv tests still do not start lm-eval.
Those tests |
haofrank
reviewed
Sep 21, 2026
haofrank
left a comment
Member
There was a problem hiding this comment.
The update addresses the three earlier concerns. I found three remaining issues in the new execution path, noted inline. The 28 script tests passed locally; the runtime test module was skipped because lm-eval was not installed in my environment.
Install and patch eval deps, pass context and generation limits, and record completed vs failed concurrencies so RUN_EVAL works without a wrapper caller. Co-authored-by: Cursor <cursoragent@cursor.com>
haofrank
self-requested a review
September 21, 2026 21:10
haofrank
reviewed
Sep 21, 2026
magpie_run_eval_persisted cds into a temp results dir, so a relative MAGPIE_EVAL_INCLUDE_PATH such as custom-tasks would otherwise stop resolving. Co-authored-by: Cursor <cursoragent@cursor.com>
haofrank
self-requested a review
September 21, 2026 22:07
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
MAGPIE_EVAL_TASKSis set, Magpie driveslm_evalwith--model local-completionsagainst/v1/completionsso multiple-choice tasks that need loglikelihood (mmlu, hellaswag) work on the local eval path.--confirm_run_unsafe_codefor HumanEval, instead of wrapping InferenceXrun_evalwith a Bashpython3()intercept that server-watch bypasses.HF_ALLOW_CODE_EVAL=1when code evaluation is required, even if the caller did not set it._install_lm_eval_depsand_patch_lm_evalwhen they are sourced; otherwise installlm-eval[api]intoMAGPIE_EVAL_PYTHON.max_lengthand a generation budget (max_gen_toksplus--gen_kwargs max_tokens) so local-completions does not keep the 2048/256 defaults.results_concN.jsonper accuracy concurrency so batched concs stay distinguishable.run_evalin place whenMAGPIE_EVAL_TASKSis unset.RUN_EVAL: "true"on the SGLang MI355X example YAML.Test plan
PYTHONPATH=. pytest tests/test_eval_concurrency_scripts.py(35 passed)--confirm_run_unsafe_code,HF_ALLOW_CODE_EVAL=1, dep install,_patch_lm_eval,max_length/max_tokens, and completed vs failed concspip install 'lm-eval[api]' && PYTHONPATH=. pytest tests/test_eval_lm_eval_runtime.py(starts realpython -m lm_eval; skips if lm-eval is not installed)RUN_EVAL: "true"andMAGPIE_EVAL_TASKS=gsm8k,mmlu,hellaswag,gpqa_diamond_cot_n_shot,humaneval_instructand confirm the lm-eval results JSON contains all requested task keys