| 44 | |
| 45 | |
| 46 | def parse_args(): |
| 47 | parser = argparse.ArgumentParser(description="KVCOMM Experiments on HumanEval") |
| 48 | parser.add_argument("--dataset_json", type=str, default="datasets/humaneval/humaneval-py.jsonl") |
| 49 | parser.add_argument("--llm_name", type=str, default="meta-llama/Llama-3.1-8B-Instruct") |
| 50 | parser.add_argument( |
| 51 | "--mode", |
| 52 | type=str, |
| 53 | default="FullConnected", |
| 54 | choices=["DirectAnswer", "FullConnected", "Random", "Chain", "Debate", "Layered", "Star"], help="The communication topology among agents." |
| 55 | ) |
| 56 | parser.add_argument("--batch_size", type=int, default=1) |
| 57 | parser.add_argument("--domain", type=str, default="humaneval") |
| 58 | parser.add_argument( |
| 59 | "--agent_names", |
| 60 | nargs="+", |
| 61 | type=str, |
| 62 | default=["CodeWriting"], |
| 63 | help="List of agent names in the graph.", |
| 64 | ) |
| 65 | parser.add_argument( |
| 66 | "--agent_nums", |
| 67 | nargs="+", |
| 68 | type=int, |
| 69 | default=[5], |
| 70 | help="List of agent counts corresponding to agent names.", |
| 71 | ) |
| 72 | parser.add_argument("--decision_method", type=str, default="FinalRefer", help="Decision method for the graph.") |
| 73 | parser.add_argument( |
| 74 | "--execution_mode", |
| 75 | type=str, |
| 76 | default="default", |
| 77 | choices=["default", "allow_kv_reuse"], |
| 78 | help="Execution strategy for the graph.", |
| 79 | ) |
| 80 | parser.add_argument("--output_dir", type=str, default=str(PROJECT_ROOT / "result" / "humaneval"), help="Directory to save the output results.") |
| 81 | parser.add_argument("--prefix", type=str, default="The task is:\n\n", help="The prefix text for the input query, kept the same as the default dense prefill mode.") |
| 82 | parser.add_argument("--kv-threshold", type=float, default=None, help="Threshold for key-value memory usage.") |
| 83 | parser.add_argument("--kv-max-anchor-num", type=int, default=None, help="Maximum number of anchors for key-value memory.") |
| 84 | parser.add_argument("--kv-window-size", type=int, default=None, help="Window size for key-value memory update.") |
| 85 | parser.add_argument("--kv-thread-workers", type=int, default=None, help="Number of thread workers for key-value memory processing.") |
| 86 | parser.add_argument("--kv-worker-timeout", type=float, default=None, help="Timeout for key-value memory workers processing.") |
| 87 | |
| 88 | args = parser.parse_args() |
| 89 | if len(args.agent_names) != len(args.agent_nums): |
| 90 | parser.error("The number of agent names must match the number of agent counts.") |
| 91 | return args |
| 92 | |
| 93 | |
| 94 | async def main(): |