microsoft / microsoft/MInference

Shape of slash mismatch when input batchsize > 1

Open
#53 1 comment 0 reactions 1 assignee View on GitHub

@iofu728 is already working on this.

Since Jul 23, 2024.

bug
Dominant language
Python
Stars
1.2k
Forks
82
Avg merge
1d 18h
Merged PRs (30d)
1

Description

Describe the bug

When evaluating Llama3-8B with Minfer on lm-eval's zero-shot tasks, it went the following error:
图像2024-7-23 10 40
Then I tried to explore the shape inside vertical_and_slash_kernel(q, k, v, vertical_size, slash_size)
图像2024-7-23 10 42

Seems that the batch dim is always 1 in slash?

Steps to reproduce
import lm_eval
from lm_eval.models.huggingface import HFLM
from lm_eval.evaluator import request_caching_arg_to_dict
from lm_eval.tasks import TaskManager
from lm_eval.utils import make_table

from minference import MInference
minference_patch = MInference("minference", args.model)
model = minference_patch(model)

hflm = HFLM(pretrained=model, tokenizer=tokenizer, batch_size=args.zeroshot_bsz)

        manager = TaskManager()
        task_names = manager.match_tasks(args.tasks)
        logging.info(f"Selected Tasks: {task_names}")

        cache_args = request_caching_arg_to_dict(cache_requests=args.cache_processed_data)
        results = lm_eval.simple_evaluate(hflm, tasks=task_names, num_fewshot=0, batch_size=args.zeroshot_bsz, **cache_args)
        logging.info("\n"+make_table(results))
        if "groups" in results:
            logging.info(make_table(results, "groups"))

Above is my script, but I think circumstances with batch > 1 will work

Something about batch was mentioned in #https://github.com/microsoft/MInference/issues/46.

Expected Behavior
Logs

No response

Additional Information

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.