-
Notifications
You must be signed in to change notification settings - Fork 436
chore: Add evaluation pipeline #1876
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
Changes from 7 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
84c8c0e
chore: Add evaluation pipeline
ko3n1g ab8060c
refactor
ko3n1g 8e5256a
revert
ko3n1g 81e0a4b
refactor
ko3n1g 01883ec
upload to wandb
ko3n1g 74a02e5
write to wandb
ko3n1g 7696d43
docstrings
ko3n1g 9b40152
linting
ko3n1g b932ca4
copyright
ko3n1g d3251cc
add argument builder
ko3n1g c869b88
move scripts
ko3n1g 1228135
kuberay_executor
ko3n1g 9732ecd
KubeRayExecutor
ko3n1g cf93c86
KubeRayExecutor
ko3n1g bfcf4d5
tmp
ko3n1g 79d5cce
tmp
ko3n1g 0fd27e6
dont fail on missing dir
ko3n1g 1d5b07f
fixes
ko3n1g 33c0536
logging
ko3n1g 5745dfa
tmp
ko3n1g 67fa44d
update
ko3n1g 4aff1d3
update
ko3n1g a74faba
d(0GL9TJ2y{d6(w0/<(V
ko3n1g 4d8f1c8
fix
ko3n1g 34d14f6
/examples/evaluation
ko3n1g ea42d5a
fix
ko3n1g d07b929
fixes
ko3n1g 1e226ae
fix
ko3n1g 653f35e
cleanup
ko3n1g 69f22ae
fix
ko3n1g 39e435f
cleanup
ko3n1g 5b6b7a3
attach to existing run
ko3n1g d5aac3e
fix
ko3n1g ddaaf99
fix
ko3n1g c598a42
fix
ko3n1g 5c075ee
Merge remote-tracking branch 'origin/main' into ko3n1g/chore/evaluati…
ko3n1g 896ede1
status
ko3n1g c417081
fix
ko3n1g 75b9d61
fix
ko3n1g 3b78b5e
cleanup
ko3n1g b2f092a
copyright
ko3n1g 4308a35
Merge remote-tracking branch 'origin/main' into ko3n1g/chore/evaluati…
ko3n1g d86bbfe
desc
ko3n1g 7e335c1
fixes
ko3n1g 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,224 @@ | ||
| import argparse | ||
|
|
||
| from nemo_run.config import get_nemorun_home | ||
|
|
||
|
|
||
| def list_of_strings(arg): | ||
| """Split a comma-separated string into a list of substrings.""" | ||
| return arg.split(",") | ||
|
|
||
|
|
||
| def to_dict(arg): | ||
| """Split a comma-separated string into a dictionary of key-value pairs.""" | ||
| return dict(item.split("=") for item in arg.split(",")) | ||
|
|
||
|
|
||
| ENDPOINT_TYPES = {"chat": "chat/completions/", "completions": "completions/"} | ||
|
|
||
|
|
||
| def parse_cli_args(): | ||
| """Parse command line arguments for launching Megatron-Bridge Evaluation.""" | ||
| parser = argparse.ArgumentParser(description="Launch Megatron-Bridge Evaluation") | ||
| parser.add_argument( | ||
| "--dryrun", | ||
| action="store_true", | ||
| help="Dry run the experiment.", | ||
| default=False, | ||
| ) | ||
|
|
||
| # Deployment args | ||
| deployment_args = parser.add_argument_group("Deployment arguments") | ||
| deployment_args.add_argument("--megatron_checkpoint", type=str, help="Megatron checkpoint to evaluate") | ||
| deployment_args.add_argument( | ||
| "--host", | ||
| type=str, | ||
| help="Server address to use for evaluation", | ||
| default="0.0.0.0", | ||
| ) | ||
| deployment_args.add_argument("--port", type=int, help="Server port to use for evaluation", default=8000) | ||
| deployment_args.add_argument("--gpus_per_node", type=int, help="Number of GPUs per node", default=8) | ||
| deployment_args.add_argument("--num_gpus", type=int, help="Number of nodes to use for evaluation", default=8) | ||
| deployment_args.add_argument("--num_replicas", type=int, default=1, help="Num of replicas for Ray server") | ||
| deployment_args.add_argument( | ||
| "--tensor_model_parallel_size", | ||
| type=int, | ||
| help="Tensor model parallel size to use for evaluation", | ||
| default=1, | ||
| ) | ||
| deployment_args.add_argument( | ||
| "--pipeline_model_parallel_size", | ||
| type=int, | ||
| help="Pipeline model parallel size to use for evaluation", | ||
| default=1, | ||
| ) | ||
| deployment_args.add_argument( | ||
| "--context_model_parallel_size", | ||
| type=int, | ||
| help="Context model parallel size to use for evaluation", | ||
| default=1, | ||
| ) | ||
|
|
||
| # Evaluation args | ||
| evaluation_args = parser.add_argument_group("Evaluation arguments") | ||
| evaluation_args.add_argument( | ||
| "--endpoint_type", | ||
| type=str, | ||
| default="completions", | ||
| help="Whether to use completions or chat endpoint. Refer to the docs for details on tasks that are completions" | ||
| "v/s chat.", | ||
| choices=list(ENDPOINT_TYPES), | ||
| ) | ||
| evaluation_args.add_argument( | ||
| "--limit_samples", | ||
| type=float, | ||
| default=None, | ||
| help="Limit evaluation to `limit` samples. Default: use all samples.", | ||
| ) | ||
| evaluation_args.add_argument( | ||
| "--parallelism", | ||
| type=int, | ||
| default=8, | ||
| help="Number of parallel requests to send to server. Default: use default for the task.", | ||
| ) | ||
| evaluation_args.add_argument( | ||
| "--request_timeout", | ||
| type=int, | ||
| default=1000, | ||
| help="Time in seconds for the eval client. Default: 1000s", | ||
| ) | ||
| evaluation_args.add_argument( | ||
| "--temperature", | ||
| type=float, | ||
| default=None, | ||
| help="Sampling temperature for generation. Higher values = more random. Default: use task default.", | ||
| ) | ||
| evaluation_args.add_argument( | ||
| "--top_p", | ||
| type=float, | ||
| default=None, | ||
| help="Top-p (nucleus) sampling threshold. Default: use task default.", | ||
| ) | ||
| evaluation_args.add_argument( | ||
| "--top_k", | ||
| type=int, | ||
| default=None, | ||
| help="Top-k sampling threshold. Default: use task default.", | ||
| ) | ||
| evaluation_args.add_argument( | ||
| "--eval_task", | ||
| type=str, | ||
| default="mmlu", | ||
| help="Evaluation benchmark to run. Refer to the docs for more details on the tasks/benchmarks.", | ||
| ) | ||
|
|
||
| # Slurm args | ||
| slurm_args = parser.add_argument_group("Slurm arguments") | ||
| slurm_args.add_argument( | ||
| "--custom_mounts", type=list_of_strings, help="Comma separated string of mounts", default=[], required=False | ||
| ) | ||
| slurm_args.add_argument( | ||
| "--custom_env_vars", | ||
| type=to_dict, | ||
| help="Comma separated string of environment variables", | ||
| default={}, | ||
| required=False, | ||
| ) | ||
| slurm_args.add_argument("--account", type=str, help="Cluster account to run test") | ||
| slurm_args.add_argument("--partition", type=str, help="Cluster partition to run test") | ||
| slurm_args.add_argument("--time_limit", type=str, default="04:00:00", help="Time limit of run") | ||
| slurm_args.add_argument("--container_image", type=str, default="", help="Container image to run") | ||
|
|
||
| # Logging args | ||
| logging_args = parser.add_argument_group("Logging arguments") | ||
| logging_args.add_argument( | ||
| "--experiment_name", | ||
| type=str, | ||
| help="wandb job name", | ||
| required=False, | ||
| ) | ||
| logging_args.add_argument( | ||
| "--wandb_key", | ||
| type=str, | ||
| help="wandb key. Needed for wandb logger projection to server", | ||
| required=False, | ||
| ) | ||
| logging_args.add_argument( | ||
| "--wandb_project_name", | ||
| type=str, | ||
| help="wandb project name", | ||
| required=False, | ||
| ) | ||
| logging_args.add_argument( | ||
| "--wandb_entity_name", | ||
| type=str, | ||
| help="wandb project name", | ||
| required=False, | ||
| ) | ||
| logging_args.add_argument( | ||
| "--wandb_experiment_name", | ||
| type=str, | ||
| help="wandb job name", | ||
| required=False, | ||
| ) | ||
|
|
||
| # Tokenizer args | ||
| tokenizer_args = parser.add_argument_group("Tokenizer arguments") | ||
| tokenizer_args.add_argument( | ||
| "-hf", | ||
| "--hf_token", | ||
| type=str, | ||
| help="HuggingFace token. Defaults to None. Required for accessing tokenizers and checkpoints.", | ||
| ) | ||
|
|
||
| # DGXCloud | ||
| dgxc_args = parser.add_argument_group("DGXCloud arguments") | ||
| dgxc_args.add_argument( | ||
| "--dgxc_cluster", | ||
| type=str, | ||
| help="DGXCloud cluster to use for experiment", | ||
| required=False, | ||
| ) | ||
| dgxc_args.add_argument( | ||
| "--dgxc_base_url", | ||
| type=str, | ||
| help="DGXCloud base url", | ||
| required=False, | ||
| ) | ||
| dgxc_args.add_argument( | ||
| "--dgxc_kube_apiserver_url", | ||
| type=str, | ||
| help="DGXCloud kube apiserver url", | ||
| required=False, | ||
| ) | ||
| dgxc_args.add_argument( | ||
| "--dgxc_app_id", | ||
| type=str, | ||
| help="DGXCloud app id", | ||
| required=False, | ||
| ) | ||
| dgxc_args.add_argument( | ||
| "--dgxc_app_secret", | ||
| type=str, | ||
| help="DGXCloud app secret", | ||
| required=False, | ||
| ) | ||
| dgxc_args.add_argument( | ||
| "--dgxc_project_name", | ||
| type=str, | ||
| help="DGXCloud project name", | ||
| required=False, | ||
| ) | ||
| dgxc_args.add_argument( | ||
| "--dgxc_pvc_claim_name", | ||
| type=str, | ||
| help="DGXCloud pvc claim name", | ||
| required=False, | ||
| ) | ||
| dgxc_args.add_argument( | ||
| "--dgxc_pvc_mount_path", | ||
| type=str, | ||
| help="DGXCloud pvc mount path", | ||
| required=False, | ||
| ) | ||
|
|
||
| return parser | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-paste error in help text.
The help text for
--wandb_entity_namesays "wandb project name" but should describe the entity name.Proposed fix
logging_args.add_argument( "--wandb_entity_name", type=str, - help="wandb project name", + help="wandb entity name", required=False, )📝 Committable suggestion
🤖 Prompt for AI Agents