microsoft / microsoft/MInference

[Question]: Some questions on the code

Open
#17 4 comments 0 reactions 1 assignee View on GitHub

@iofu728 is already working on this.

Since Jul 5, 2024.

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

Description

Describe the issue

Hi, thanks for your great work!

I have some questions about your code:

  1. In search_pattern, the search space is different from Table.6 in the paper? And the search space is generated base on the fixed FLOPs?

  2. In the following code snippets of search_pattern, every best_ty is reassigned to "vertical_and_slash", so only vertical_slash_sparse_attention will be called? Besides, for best_ty == "block_sparse", where does the magic number 1000 and 6096 come from?

if best_ty == "stream_llm":
    best_ty = "vertical_and_slash"
if best_ty == "block_sparse":
    best_ty, best_v, best_s = "vertical_and_slash", 1000, 6096
  1. In the paper, you mentioned one sample is enough to capture the pattern for different prompts with different lengths, any support for that?

we use only one sample as our validation set from KV retrieval synthetic data with 30k token inputs, which exhibits strong generalization and stability across different lengths and domains.

Besides, I think I might find a bug when I run examples/run_hf_streaming.sh with Qwen2-7B-Instruct. In apply_rotary_embed_single, you need to enable position_ids since q_len == 1 during decoding stage. I change the code into cos = cos[position_ids] sin = sin[position_ids] and it's fine now.

A bit wordy... Looking forward to your reply!

### Tasks

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.