Skip to content

Commit c2d6a52

Browse files
committed
Quartz sync: Jun 10, 2026, 11:16 AM
1 parent 3a56639 commit c2d6a52

8 files changed

Lines changed: 705 additions & 283 deletions

content/Inference/vllm/src_code/4. vllm v1 调度逻辑 和 distributed 分布式原理.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ vllm 构建了一套双进程多线程异步的在线推理框架,PD 分离场
2222
> 假设模型为 30B moe,1P1D,80GB 显存,tp8。num_hidden_layers=48,num_key_value_heads=4,head_dim=128,8k 输入 1k 输出,325 条请求,rps=65,最大一个 batch 里面放 64k。
2323
>
2424
> per token / rank = 2(KV) x 1(KV head) x 128(head_dim) x 2(bf16) x 48 (num_hidden_layers) = 24KB
25-
> one kv cache block = 24KB x 16 = 384KB
26-
> 9k 输入输出需要的 block 数量 = 24KB x 9216 / 384KB = 216MB / 384KB = 576 个 block
25+
> one kv cache block = 24KB x 16 =384
26+
> 9k 输入输出需要的 block 数量 = 24KB x 9216 / 384KB = 576 个 block
2727
> decode 的一个 gpu 有 54GB 给 kv cache(log日志看到的),那么最多就可以同时有 54 * 1024 * 1024 / 384 / 576 = 256 个(8k)请求。理论值与实际打印值接近。
2828
2929
传统引擎把"处理 prompt(prefill)"和"逐字生成(decode)"当成两种不同的阶段分开调度,代码很割裂。V1 把它们统一成一件事:不管你是 prefill 还是 decode,都只是"进度条还差 N 个 token没算"。调度器只干一件事——给你分配这一步算几个 token。
@@ -59,6 +59,8 @@ generator = await handler.****create_chat_completion****(request, raw_request)
5959
####
6060

6161
## 问题
62-
1. decode 侧每次好了多少 kv cache之后怎么告诉 decode 现在好了哪些的,以及满的时候还会收新的 batch 的 kv cache 过来吗?
63-
2. decode 计算的时候,调度逻辑在干嘛,在准备搬运新的 kv cache 过来?
64-
3.
62+
63+
1. 如果 kv cache 不够大,那么很容易被 prefill 以一个很慢的带宽打满,那么 decode 侧每次的 forward 和 空出来新的 block给 prefill 传kv cache 进来 就会完全串行。(新的 block 空出来收到一部分就可以被nixl batch 起来一起计算)
64+
2. 如果 kv cache 够大,那么每次 prefill 传进来的正好 decode 侧吃满计算的请求 cache 进来之后,每次 decode forward 计算和prefill 传 kv cache 进来就可以完全 overlap,完全并行。
65+
66+
此时问题就是我怎么在各类固定 kv cache 大小后,在不同 workload / 不同的 decode 消费能力下能通过某种建模得出最低的 kv cache 传输速度 以至于 pd 分离性能没有影响。

content/Inference/vllm/src_code/excalidraw/4. vllm v1 调度逻辑 和 distributed 分布式原理 2026-06-04 21.25.13.excalidraw.md

Lines changed: 320 additions & 276 deletions
Large diffs are not rendered by default.

content/Inference/vllm/src_code/excalidraw/4. vllm v1 调度逻辑 和 distributed 分布式原理 2026-06-04 21.25.13.excalidraw.svg

Lines changed: 3 additions & 2 deletions
Loading
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
1. **Use Headings and Subheadings**: Clearly define sections with headings (e.g.,
2+
```
3+
#
4+
```
5+
,
6+
```
7+
##
8+
```
9+
,
10+
```
11+
###
12+
```
13+
) to organize content hierarchically.
14+
15+
2. **Bullet Points and Lists**: Use bullet points or numbered lists to break down information into digestible parts.
16+
17+
3. **Consistent Spacing**: Ensure consistent spacing between sections and paragraphs for better readability.
18+
19+
4. **Highlight Key Points**: Use bold or italics to emphasize important information or key terms.
20+
21+
5. **Tables for Structured Data**: Use tables to organize data that fits into rows and columns for clarity.
22+
23+
6. **Quotes and References**: Use blockquotes for quotes and reference links for sources.
24+
25+
7. **Code Blocks**: Use code blocks for any code snippets or technical instructions.
26+
27+
8. **Images and Diagrams**: Include images or diagrams where applicable to visually represent information.
28+
29+
9. **Linking and Cross-referencing**: Use internal links to connect related notes or sections within your vault.
30+
31+
10. do not use ``` markdown
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
Please create an Obsidian note with interactive flashcards using native Obsidian HTML features. The note must include:
2+
3+
1. Frontmatter (at the top) with the following properties:
4+
5+
---
6+
7+
total: {{number of flashcards created}}
8+
9+
topics: ["{{topic 1}}", "{{topic 2}}", "{{topic 3}}"]
10+
11+
created: "{{current date in YYYY-MM-DD format}}"
12+
13+
---
14+
15+
2. Interactive flashcards using HTML details/summary tags (below the frontmatter).
16+
17+
**Instructions:**
18+
19+
- Extract key concepts, facts, definitions, relationships, and important information from the content
20+
- Identify all testable knowledge points: definitions, concepts, facts, formulas, relationships, processes, dates, names, theories, principles, etc.
21+
- Extract 3-7 main topics or themes from the content for the topics array in frontmatter
22+
- **CRITICAL: Randomize the order of flashcards - mix different topics, difficulty levels, and question types together. Do NOT follow the original content order or group by topic. Create a varied, shuffled study experience.**
23+
- Create 10-30 flashcards depending on content length and density
24+
- Prioritize information that is:
25+
- Fundamental to understanding the topic
26+
- Frequently referenced or important
27+
- Easy to forget (dates, numbers, specific details)
28+
- Part of a sequence or process
29+
- A definition or key concept
30+
31+
- Maintain the exact markdown syntax for the frontmatter block (`---` at the top and bottom).
32+
- Each property in frontmatter must be on its own line with proper YAML indentation
33+
- Topics should be an array: topics: ["Topic 1", "Topic 2", "Topic 3"]
34+
- Total should be a number without quotes
35+
- Created should be a string in quotes with format "YYYY-MM-DD"
36+
37+
- Format each flashcard using HTML details/summary tags:
38+
- Each flashcard must be a separate <details> block with class="flashcard"
39+
- The <summary> tag must have class="flashcard-question" and contain the question
40+
- The answer must be wrapped in <div class="flashcard-answer">
41+
- Leave a blank line after </summary> and before </details> for proper spacing
42+
- Answers can include markdown formatting (bold, italic, lists, links, etc.)
43+
- Answers can span multiple paragraphs
44+
45+
- Questions should test understanding, not just recall
46+
- Answers should be complete but concise (typically 1-4 sentences, but can be longer if needed)
47+
- Include context and examples when helpful
48+
- Use clear, specific language
49+
- Make questions specific and focused (avoid overly broad questions)
50+
- Include [[internal links]] to related notes or concepts when relevant
51+
- Use **bold** for key terms in answers
52+
- Group related information in answers using lists or structured formatting
53+
54+
- Do not use ``` code blocks or markdown code formatting in the output
55+
- Focus on accuracy and completeness based on the actual content provided
56+
57+
**Example Output Format:**
58+
59+
---
60+
61+
total: 3
62+
63+
topics: ["Cell Biology", "Energy Production", "Molecular Biology"]
64+
65+
created: "2025-01-09"
66+
67+
---
68+
69+
<details class="flashcard">
70+
<summary class="flashcard-question">What is the primary function of mitochondria?</summary>
71+
72+
<div class="flashcard-answer">
73+
74+
Mitochondria are organelles that produce ATP (adenosine triphosphate) through cellular respiration. They are often called the "powerhouse of the cell" because they generate most of the cell's energy supply.
75+
76+
Related: See also [[Chloroplasts]] for plant cell energy production.
77+
78+
</div>
79+
80+
</details>
81+
82+
<details class="flashcard">
83+
<summary class="flashcard-question">What is the difference between DNA and RNA?</summary>
84+
85+
<div class="flashcard-answer">
86+
87+
- **DNA**: Double-stranded, contains thymine, stores genetic information
88+
- **RNA**: Single-stranded, contains uracil, involved in protein synthesis
89+
90+
</div>
91+
92+
</details>
93+
94+
<details class="flashcard">
95+
<summary class="flashcard-question">How does photosynthesis work?</summary>
96+
97+
<div class="flashcard-answer">
98+
99+
Photosynthesis occurs in two stages:
100+
101+
1. **Light-dependent reactions**: Chlorophyll absorbs light energy, splits water molecules, and produces ATP and NADPH
102+
2. **Calvin cycle**: Uses ATP and NADPH to convert carbon dioxide into glucose
103+
104+
</div>
105+
106+
</details>
107+
108+
Important Notes:
109+
- ALWAYS include frontmatter with total, topics, and created date
110+
- Each property in frontmatter must be on its own line (no nesting, flat structure like the YouTube template)
111+
- Topics should be an array: topics: ["Topic 1", "Topic 2", "Topic 3"]
112+
- Created should be a string in quotes: created: "2025-01-09"
113+
- Total should be a number without quotes: total: 15
114+
- Use proper HTML syntax - ensure all tags are properly closed
115+
- Output the actual HTML tags directly (NOT inside markdown code blocks)
116+
- Each flashcard should be separated by a blank line for readability
117+
- **RANDOMIZE THE ORDER: Mix topics, difficulty levels, and question types - do not follow source material order**
118+
- Include [[internal links]] to related concepts when relevant
119+
- Answers can include markdown formatting like **bold**, *italic*, lists, and [[internal links]]
120+
- If content is very long, focus on the most important concepts
121+
- If content is technical, ensure definitions are clear
122+
- Maintain the original meaning and accuracy of the source material
123+
- All flashcards will be in one note - users can click to reveal answers
124+
- This format works natively in Obsidian without requiring any plugins
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Contextual Extraction of Discussion Points and Action Items
2+
3+
Instruction:
4+
Analyze the provided content, which includes:
5+
• Transcript 1: The first transcript of the discussion.
6+
• Transcript 2: The second transcript of the discussion.
7+
• Written Notes: Notes taken by a participant summarizing the discussion.
8+
9+
Task:
10+
Extract the following while prioritizing the notes written by the participant to infer emphasis and key takeaways:
11+
1. Discussion Points: Summarize the key topics, ideas, or issues discussed. Prioritize points that appear in the written notes and cross-reference with the transcripts for completeness.
12+
2. Action Items: Identify specific tasks, responsibilities, or decisions agreed upon. For each action item, include:
13+
• A brief description of the task.
14+
• The person(s) responsible, if mentioned.
15+
• Any deadlines, if stated.
16+
17+
Output Format:
18+
19+
**Discussion Points:**
20+
1. [Point 1]
21+
2. [Point 2]
22+
...
23+
24+
**Action Items:**
25+
1. [Task description] - [Responsible person(s)] - [Deadline]
26+
2. [Task description] - [Responsible person(s)] - [Deadline]
27+
...
28+
29+
**Supporting Context:**
30+
- Key excerpts from Transcript 1: [Relevant excerpts related to discussion points and action items].
31+
- Key excerpts from Transcript 2: [Relevant excerpts related to discussion points and action items].
32+
- Key highlights from Written Notes: [Direct quotes or summaries from notes].
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
3+
title: "[Full paper title]"
4+
5+
authors: ["Author 1", "Author 2", "etc"]
6+
7+
year: [Publication year]
8+
9+
journal: "[Journal name]"
10+
11+
volume: "[Vol. number]"
12+
13+
issue: "[Issue number]"
14+
15+
pages: "[Page range]"
16+
17+
doi: "[DOI number]"
18+
19+
url: "[Direct URL to access paper]"
20+
21+
tags: ["academic", "paper", "[field]", "[specific subtopic]"]
22+
23+
research_question: "[Exact question/objective as stated by authors]"
24+
25+
significance: "[Why this research matters in 1-2 specific sentences]"
26+
27+
keywords: ["Keyword 1", "Keyword 2", "etc"]
28+
29+
citation: "[Complete citation in APA/MLA format]"
30+
31+
---
32+
33+
## 1. Key Arguments & Evidence
34+
35+
- **Argument 1**: [Specific claim made by authors] ([p.X])
36+
- Evidence: [Concrete data, statistics, or examples supporting this claim] ([p.X])
37+
- Methodology used: [Specific methods used to gather this evidence] ([p.X])
38+
- Theoretical basis: [Named theory or framework] ([Author Year, p.X])
39+
- **Argument 2**: [Continue with same detailed format]
40+
- **Argument 3**: [Add as many as needed with same detailed format]
41+
42+
## 2. Methodology Details
43+
44+
- **Research design**: [Exact type - e.g., "longitudinal cohort study" not just "quantitative"] ([p.X])
45+
- **Data collection methods**: [Specific techniques used - e.g., "semi-structured interviews using protocol X"] ([p.X])
46+
- **Sample characteristics**: [Exact details - e.g., "128 participants: 64 female, 64 male, ages 18-35, from University X"] ([p.X])
47+
- **Key variables**: [Named variables with operational definitions] ([p.X])
48+
- **Analytical techniques**: [Specific statistical tests or qualitative approaches with software used] ([p.X])
49+
- **Ethical considerations**: [Any ethics committee approvals or considerations mentioned] ([p.X])
50+
51+
## 3. Substantive Findings
52+
53+
- **Primary finding**: [Most significant result with exact statistics/p-values/effect sizes] ([p.X])
54+
- **Secondary findings**: [Additional results with specific data points] ([p.X])
55+
- **Unexpected results**: [Any surprising outcomes with authors' explanations] ([p.X])
56+
- **Null findings**: [What didn't work or wasn't supported] ([p.X])
57+
- **Limitations acknowledged**: [Specific constraints identified by authors] ([p.X])
58+
59+
## 4. Scholarly Context
60+
61+
- **Builds on**: [[Author Year]] - [Named works this paper extends] ([p.X])
62+
- **Contradicts**: [[Author Year]] - [Specific research this challenges] ([p.X])
63+
- **Resolves**: [Specific debates this settles] ([p.X])
64+
- **Theoretical framework**: [Named theory/framework the paper operates within] ([p.X])
65+
- **Research gap addressed**: [Explicit gap identified by authors] ([p.X])
66+
67+
## 5. Key Quotes
68+
69+
- **Central argument**: "[Direct quote]" ([p.X])
70+
- **Methodology**: "[Direct quote]" ([p.X])
71+
- **Main finding**: "[Direct quote]" ([p.X])
72+
- **Implications**: "[Direct quote]" ([p.X])
73+
- **Future research**: "[Direct quote]" ([p.X])
74+
75+
## 6. Explicit Recommendations & Applications
76+
77+
- **Direct recommendations**: [List all specific recommendations made by authors] ([p.X])
78+
- **Policy implications**: [Any policy changes suggested] ([p.X])
79+
- **Practice implications**: [How practitioners should change behavior] ([p.X])
80+
- **Industry applications**: [Business or commercial applications] ([p.X])
81+
- **Educational implications**: [Teaching or learning applications] ([p.X])
82+
- **Future research directions**: [Specific suggestions for further study] ([p.X])
83+
84+
## 7. Critical Reference Mapping
85+
86+
- [[Author Year]] - [Title] ([p.X in reviewed paper]) - [Precise role in paper's argument]
87+
- [[Author Year]] - [Title] ([p.X in reviewed paper]) - [Precise role in paper's argument]
88+
- [[Author Year]] - [Title] ([p.X in reviewed paper]) - [Precise role in paper's argument]
89+
90+
## 8. Personal Research Notes
91+
92+
- **Relevance to my work**: [Specific ways this connects to your research]
93+
- **Methods I could adapt**: [Specific techniques that could be applied]
94+
- **Gaps I could address**: [How your work might extend this research]
95+
- **Potential citations**: [Where in your own writing you might cite this]
96+
- **Related papers in vault**: [[Paper 1]], [[Paper 2]]
97+
- **Related concepts**: [[Concept 1]], [[Concept 2]]

0 commit comments

Comments
 (0)