Missing files or bugs in evaluation code?
Closed this issue ยท 6 comments
ch-shin commented
Hi team, I have two questions regarding datacomp evaluation.
- Which evaluation config should we use for datacomp competition evaluation? (heavy.yaml?) I got some results with medium.yaml, but I was unable to find "Core" and "Extended" scores.
- Running evaluation heavy.yaml (light.yaml or medium.yaml worked) gave the below error --- can we get some help?
Thank you ๐
โญโโโโโโโโโโโโโโโโโโโโโ Traceback (most recent call last) โโโโโโโโโโโโโโโโโโโโโโโฎ
โ /home/ubuntu/research_nfs/dclm/eval/eval_openlm_ckpt.py:549 in <module> โ
โ โ
โ 546 โ
โ 547 โ
โ 548 if __name__ == "__main__": โ
โ โฑ 549 โ main() โ
โ 550 โ
โ โ
โ /home/ubuntu/research_nfs/dclm/eval/eval_openlm_ckpt.py:512 in main โ
โ โ
โ 509 โ โ โ data_name = result["val_data"][0].split("/")[-2] โ
โ 510 โ โ โ eval_metrics["downstream_perpexity"][data_name] = result[" โ
โ 511 โ โ
โ โฑ 512 โ icl_results = evaluate(eval_model, tokenizer, eval_cfg) โ
โ 513 โ eval_metrics["icl"] = icl_results โ
โ 514 โ โ
โ 515 โ date_format = "%Y_%m_%d-%H_%M_%S" โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/torch/utils/_ โ
โ contextlib.py:115 in decorate_context โ
โ โ
โ 112 โ @functools.wraps(func) โ
โ 113 โ def decorate_context(*args, **kwargs): โ
โ 114 โ โ with ctx_factory(): โ
โ โฑ 115 โ โ โ return func(*args, **kwargs) โ
โ 116 โ โ
โ 117 โ return decorate_context โ
โ 118 โ
โ โ
โ /home/ubuntu/research_nfs/dclm/eval/eval_openlm_ckpt.py:148 in evaluate โ
โ โ
โ 145 โ ) โ
โ 146 โ icl_tasks_w_categories = list(map(lambda x: x["label"], icl_tasks_ โ
โ 147 โ โ
โ โฑ 148 โ evaluators, logger_keys = build_icl_evaluators( โ
โ 149 โ โ cfg.icl_tasks, tokenizer, cfg.max_seq_len, cfg.device_eval_bat โ
โ 150 โ ) โ
โ 151 โ in_memory_logger = InMemoryLogger() # track metrics in the in_mem โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/llmfoundry/ut โ
โ ils/builders.py:219 in build_icl_evaluators โ
โ โ
โ 216 โ โ โ โ os.remove(destination_path) โ
โ 217 โ โ โ dist.barrier() โ
โ 218 โ โ โ โ
โ โฑ 219 โ โ โ dataloaders = get_icl_task_dataloader( โ
โ 220 โ โ โ โ icl_cfg.icl_task_type, โ
โ 221 โ โ โ โ icl_cfg.dataset_uri, โ
โ 222 โ โ โ โ tokenizer, โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/composer/data โ
โ sets/in_context_learning_evaluation.py:1323 in get_icl_task_dataloader โ
โ โ
โ 1320 โ โ โ ) โ
โ 1321 โ โ return result_dls โ
โ 1322 โ else: โ
โ โฑ 1323 โ โ return build_icl_dataloader( โ
โ 1324 โ โ โ icl_task_type, โ
โ 1325 โ โ โ dataset_uri, โ
โ 1326 โ โ โ tokenizer, โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/composer/data โ
โ sets/in_context_learning_evaluation.py:1145 in build_icl_dataloader โ
โ โ
โ 1142 โ โ โ โ โ โ โ โ โ โ โ โ fewshot_random_seed= โ
โ 1143 โ โ effective_batchsize = batch_size โ
โ 1144 โ elif icl_task_type == 'question_answering': โ
โ โฑ 1145 โ โ dataset = InContextLearningQATaskDataset(dataset_uri, โ
โ 1146 โ โ โ โ โ โ โ โ โ โ โ โ tokenizer, โ
โ 1147 โ โ โ โ โ โ โ โ โ โ โ โ max_seq_len, โ
โ 1148 โ โ โ โ โ โ โ โ โ โ โ โ pad_tok_id, โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/composer/data โ
โ sets/in_context_learning_evaluation.py:153 in __init__ โ
โ โ
โ 150 โ โ โ โ get_file(dataset_uri, destination_path, overwrite=Tru โ
โ 151 โ โ dataset = load_dataset('json', data_files=destination_path, s โ
โ 152 โ โ self.samples = list( โ
โ โฑ 153 โ โ โ dataset.map(lambda examples: { โ
โ 154 โ โ โ โ 'context': examples['context'], โ
โ 155 โ โ โ โ 'answer': examples['answer'], โ
โ 156 โ โ โ โ 'aliases': examples['aliases'] โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/datasets/arro โ
โ w_dataset.py:563 in wrapper โ
โ โ
โ 560 โ โ else: โ
โ 561 โ โ โ self: "Dataset" = kwargs.pop("self") โ
โ 562 โ โ # apply actual function โ
โ โฑ 563 โ โ out: Union["Dataset", "DatasetDict"] = func(self, *args, **kw โ
โ 564 โ โ datasets: List["Dataset"] = list(out.values()) if isinstance( โ
โ 565 โ โ for dataset in datasets: โ
โ 566 โ โ โ # Remove task templates if a column mapping of the templa โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/datasets/arro โ
โ w_dataset.py:528 in wrapper โ
โ โ
โ 525 โ โ โ "output_all_columns": self._output_all_columns, โ
โ 526 โ โ } โ
โ 527 โ โ # apply actual function โ
โ โฑ 528 โ โ out: Union["Dataset", "DatasetDict"] = func(self, *args, **kw โ
โ 529 โ โ datasets: List["Dataset"] = list(out.values()) if isinstance( โ
โ 530 โ โ # re-apply format to the output โ
โ 531 โ โ for dataset in datasets: โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/datasets/arro โ
โ w_dataset.py:2953 in map โ
โ โ
โ 2950 โ โ โ โ โ leave=False, โ
โ 2951 โ โ โ โ โ desc=desc or "Map", โ
โ 2952 โ โ โ โ ) as pbar: โ
โ โฑ 2953 โ โ โ โ โ for rank, done, content in Dataset._map_single(** โ
โ 2954 โ โ โ โ โ โ if done: โ
โ 2955 โ โ โ โ โ โ โ shards_done += 1 โ
โ 2956 โ โ โ โ โ โ โ logger.debug(f"Finished processing shard โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/datasets/arro โ
โ w_dataset.py:3307 in _map_single โ
โ โ
โ 3304 โ โ โ โ if not batched: โ
โ 3305 โ โ โ โ โ _time = time.time() โ
โ 3306 โ โ โ โ โ for i, example in shard_iterable: โ
โ โฑ 3307 โ โ โ โ โ โ example = apply_function_on_filtered_inputs(e โ
โ 3308 โ โ โ โ โ โ if update_data: โ
โ 3309 โ โ โ โ โ โ โ if i == 0: โ
โ 3310 โ โ โ โ โ โ โ โ buf_writer, writer, tmp_file = init_b โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/datasets/arro โ
โ w_dataset.py:3210 in apply_function_on_filtered_inputs โ
โ โ
โ 3207 โ โ โ โ additional_args += (effective_indices,) โ
โ 3208 โ โ โ if with_rank: โ
โ 3209 โ โ โ โ additional_args += (rank,) โ
โ โฑ 3210 โ โ โ processed_inputs = function(*fn_args, *additional_args, * โ
โ 3211 โ โ โ if isinstance(processed_inputs, LazyDict): โ
โ 3212 โ โ โ โ processed_inputs = { โ
โ 3213 โ โ โ โ โ k: v for k, v in processed_inputs.data.items() if โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/composer/data โ
โ sets/in_context_learning_evaluation.py:156 in <lambda> โ
โ โ
โ 153 โ โ โ dataset.map(lambda examples: { โ
โ 154 โ โ โ โ 'context': examples['context'], โ
โ 155 โ โ โ โ 'answer': examples['answer'], โ
โ โฑ 156 โ โ โ โ 'aliases': examples['aliases'] โ
โ 157 โ โ โ })) โ
โ 158 โ โ self.samples = strip_data(self.samples) โ
โ 159 โ โ self.tokenizer = tokenizer โ
โ โ
โ /home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/datasets/form โ
โ atting/formatting.py:280 in __getitem__ โ
โ โ
โ 277 โ โ return len(self.data) โ
โ 278 โ โ
โ 279 โ def __getitem__(self, key): โ
โ โฑ 280 โ โ value = self.data[key] โ
โ 281 โ โ if key in self.keys_to_format: โ
โ 282 โ โ โ value = self.format(key) โ
โ 283 โ โ โ self.data[key] = value โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
KeyError: 'aliases'
Muennighoff commented
I think heavy.yml
is missing HumanEval, which is part of extended no? cc @Vaishaal
afang-story commented
- heavy.yaml is the correct one to run.
- Can you provide more information on which task it failed on? You can also try using a specific llm-foundry version (one of 0.7.0 or 0.8.0 should work)
Muennighoff commented
heavy.yaml is the correct one to run.
But isn't it missing HumanEval @afang-story ?
afang-story commented
@Muennighoff HumanEval can be found in heavy_code.yaml which includes heavy.yaml as well as additional code evaluations.
ch-shin commented
The error is resolved by updating llm-foundry (0.2.0 --> 0.7.0). But got another error after then.
Map: 0%| | 0/373 [00:00<?, ? examples/s]
Map: 17%|โโ | 65/373 [00:00<00:00, 636.73 examples/s]
Map: 35%|โโโโ | 131/373 [00:00<00:00, 642.71 examples/s]
Map: 53%|โโโโโโ | 197/373 [00:00<00:00, 642.93 examples/s]
Map: 79%|โโโโโโโโ | 293/373 [00:00<00:00, 640.25 examples/s]
Map: 96%|โโโโโโโโโโ| 358/373 [00:00<00:00, 640.76 examples/s]
Map: 100%|โโโโโโโโโโ| 373/373 [00:00<00:00, 608.93 examples/s]
[rank0]: Traceback (most recent call last):
[rank0]: File "/home/ubuntu/research_nfs/dclm/eval/eval_openlm_ckpt.py", line 551, in <module>
[rank0]: main()
[rank0]: File "/home/ubuntu/research_nfs/dclm/eval/eval_openlm_ckpt.py", line 514, in main
[rank0]: icl_results = evaluate(eval_model, tokenizer, eval_cfg)
[rank0]: File "/home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
[rank0]: return func(*args, **kwargs)
[rank0]: File "/home/ubuntu/research_nfs/dclm/eval/eval_openlm_ckpt.py", line 148, in evaluate
[rank0]: evaluators, logger_keys = build_icl_evaluators(
[rank0]: File "/home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/llmfoundry/utils/builders.py", line 576, in build_icl_evaluators
[rank0]: _validate_cfg(icl_cfg)
[rank0]: File "/home/ubuntu/miniconda3/envs/dclm/lib/python3.10/site-packages/llmfoundry/utils/builders.py", line 544, in _validate_cfg
[rank0]: raise ValueError(
[rank0]: ValueError: No metric_names defined, unable to build default metrics for icl_task_type=question_answering.
It was fixed by changing icl_task_type=question_answering
--> icl_task_type=generation_task_with_answers
in heavy.yml.
afang-story commented
It may also be possible that updating to 0.8.0 will fix this. Anyways, glad that things seem to work now. Marking as closed.