Skip to content

Commit 9daeb63

Browse files
committed
refine vdcore text&plot, fix font color source bench
1 parent 0610db2 commit 9daeb63

File tree

11 files changed

+65
-28
lines changed

11 files changed

+65
-28
lines changed

content/posts/vdcores.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ VDCores do not get this edge by hand-tunning better kernels, but instead through
6161

6262
### Example 1: **Free** "Prefetch" Non-Dependent Memory Buffers
6363

64-
Consider an attention kernel followed by a linear projection with residual addition. In VDCores, we connect them by dependencies rather than manually fusing/staging: (Also note that in VDCores we do not have the notion of kernel boundary; we mark the original kernel boundary in the example for easy to understand.)
64+
Consider an attention kernel followed by a linear projection with residual addition. In VDCores, we connect them by dependencies rather than manually fusing/staging: (Also note that in VDCores we do not have the notion of kernel boundary; we mark the original kernel boundary in the example for ease of understanding.)
6565

6666
{{< vdcores/example1 >}}
6767

@@ -71,7 +71,7 @@ This is the key shift: {{< highlight-text >}} Overlap **emerges automatically**{
7171

7272
Another secret sause of VDCores is the **composbility** of it's components. Same set of computation instructions could be composed with different memory instructions, different memory dependencies, thus allowing programmer to quick experimenting with different plans without manual kernel rewrite and fusion.
7373

74-
Consider a MLP block: GEMV (Up + Gate) followed by SiLU activation and GEMV (Down). Input is shape [1, 4096], Up and Gate outputs are [1, 12288], and Down output is [1, 4096]. We can tile Gate and Up along the N dimension and Down along the K dimension.
74+
Consider an MLP block: GEMV (Up + Gate) followed by SiLU activation and GEMV (Down). Input is shape [1, 4096], Up and Gate outputs are [1, 12288], and Down output is [1, 4096]. We can tile Gate and Up along the N dimension and Down along the K dimension.
7575

7676
<img src="../../images/vdcores/example2.jpg" alt="flexible core composition: two schedules" style="width: 100%;" />
7777

layouts/shortcodes/sourcebench/deepseek.html

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,22 @@
77

88
<script>
99
window.addEventListener('DOMContentLoaded', function() {
10-
const deepSeekData = [
10+
11+
function sbGetThemeColors2() {
12+
var ls = localStorage.getItem('theme');
13+
var hugo = document.body.classList.contains('dark-theme') ? 'dark' : 'light';
14+
var dark = (ls || hugo) === 'dark';
15+
return { font: dark ? '#cbd5e1' : '#475569', grid: dark ? '#334155' : '#f1f5f9' };
16+
}
17+
18+
var tc = sbGetThemeColors2();
19+
var deepSeekData = [
1120
{ name: 'Chat + Low Search', score: 70.1, color: '#cbd5e1' },
1221
{ name: 'Reason + Low Search', score: 75.8, color: '#94a3b8' },
1322
{ name: 'Chat + High Search', score: 75.9, color: '#8b5cf6' },
1423
];
1524

16-
new Chart(document.getElementById('deepseekChart'), {
25+
var deepseekChart = new Chart(document.getElementById('deepseekChart'), {
1726
type: 'bar',
1827
data: {
1928
labels: deepSeekData.map(d => d.name),
@@ -29,12 +38,26 @@
2938
indexAxis: 'y',
3039
responsive: true,
3140
maintainAspectRatio: false,
41+
color: tc.font,
3242
plugins: { legend: { display: false } },
3343
scales: {
34-
x: { min: 65, max: 80, grid: { color: '#f1f5f9' } },
35-
y: { grid: { display: false } }
44+
x: { min: 65, max: 80, grid: { color: tc.grid }, ticks: { color: tc.font } },
45+
y: { grid: { display: false }, ticks: { color: tc.font } }
3646
}
3747
}
3848
});
49+
50+
function sbUpdateDeepseekColors() {
51+
var c = sbGetThemeColors2();
52+
deepseekChart.options.color = c.font;
53+
deepseekChart.options.scales.x.ticks.color = c.font;
54+
deepseekChart.options.scales.x.grid.color = c.grid;
55+
deepseekChart.options.scales.y.ticks.color = c.font;
56+
deepseekChart.update();
57+
}
58+
59+
var toggleBtn = document.querySelector('.btn-light-dark');
60+
if (toggleBtn) toggleBtn.addEventListener('click', function() { setTimeout(sbUpdateDeepseekColors, 50); });
61+
3962
});
4063
</script>

layouts/shortcodes/sourcebench/inverse.html

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,59 @@
77

88
<script>
99
window.addEventListener('DOMContentLoaded', function() {
10-
const inverseData = {
10+
11+
function sbGetThemeColors() {
12+
var ls = localStorage.getItem('theme');
13+
var hugo = document.body.classList.contains('dark-theme') ? 'dark' : 'light';
14+
var dark = (ls || hugo) === 'dark';
15+
return { font: dark ? '#cbd5e1' : '#475569', grid: dark ? '#334155' : '#f1f5f9' };
16+
}
17+
18+
var tc = sbGetThemeColors();
19+
var inverseData = {
1120
labels: ['GPT-5', 'Grok-4.1', 'GPT-4o', 'Perplexity', 'Tavily'],
1221
score: [89.1, 83.4, 81.5, 78.5, 78.3],
1322
overlap: [16.0, 29.7, 27.5, 40.0, 55.5]
1423
};
1524

16-
new Chart(document.getElementById('inverseChart'), {
25+
var inverseChart = new Chart(document.getElementById('inverseChart'), {
1726
type: 'bar',
1827
data: {
1928
labels: inverseData.labels,
2029
datasets: [
21-
{
22-
label: 'SourceBench Score',
23-
data: inverseData.score,
24-
backgroundColor: '#10b981',
25-
yAxisID: 'y',
26-
borderRadius: 4,
27-
barPercentage: 0.6
28-
},
29-
{
30-
label: 'Google Overlap %',
31-
data: inverseData.overlap,
32-
backgroundColor: '#94a3b8',
33-
yAxisID: 'y1',
34-
borderRadius: 4,
35-
barPercentage: 0.6
36-
}
30+
{ label: 'SourceBench Score', data: inverseData.score, backgroundColor: '#10b981', yAxisID: 'y', borderRadius: 4, barPercentage: 0.6 },
31+
{ label: 'Google Overlap %', data: inverseData.overlap, backgroundColor: '#94a3b8', yAxisID: 'y1', borderRadius: 4, barPercentage: 0.6 }
3732
]
3833
},
3934
options: {
4035
responsive: true,
4136
maintainAspectRatio: false,
4237
interaction: { mode: 'index', intersect: false },
43-
plugins: { legend: { position: 'top', labels: { usePointStyle: true } } },
38+
color: tc.font,
39+
plugins: { legend: { position: 'top', labels: { usePointStyle: true, color: tc.font } } },
4440
scales: {
45-
x: { grid: { display: false } },
46-
y: { type: 'linear', display: true, position: 'left', min: 70, max: 95, title: { display: true, text: 'Weighted Score' } },
47-
y1: { type: 'linear', display: true, position: 'right', min: 0, max: 60, grid: { drawOnChartArea: false }, title: { display: true, text: 'Overlap %' } }
41+
x: { grid: { display: false }, ticks: { color: tc.font } },
42+
y: { type: 'linear', display: true, position: 'left', min: 70, max: 95, grid: { color: tc.grid }, ticks: { color: tc.font }, title: { display: true, text: 'Weighted Score', color: tc.font } },
43+
y1: { type: 'linear', display: true, position: 'right', min: 0, max: 60, grid: { drawOnChartArea: false }, ticks: { color: tc.font }, title: { display: true, text: 'Overlap %', color: tc.font } }
4844
}
4945
}
5046
});
47+
48+
function sbUpdateInverseColors() {
49+
var c = sbGetThemeColors();
50+
inverseChart.options.color = c.font;
51+
inverseChart.options.plugins.legend.labels.color = c.font;
52+
inverseChart.options.scales.x.ticks.color = c.font;
53+
inverseChart.options.scales.y.ticks.color = c.font;
54+
inverseChart.options.scales.y.grid.color = c.grid;
55+
inverseChart.options.scales.y.title.color = c.font;
56+
inverseChart.options.scales.y1.ticks.color = c.font;
57+
inverseChart.options.scales.y1.title.color = c.font;
58+
inverseChart.update();
59+
}
60+
61+
var toggleBtn = document.querySelector('.btn-light-dark');
62+
if (toggleBtn) toggleBtn.addEventListener('click', function() { setTimeout(sbUpdateInverseColors, 50); });
63+
5164
});
5265
</script>

layouts/shortcodes/sourcebench/metric.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
.dark-theme .sb .chart-wrapper {
160160
background: #1e293b;
161161
border-color: #334155;
162+
color: #e2e8f0;
162163
}
163164
.dark-theme .sb table {
164165
border-color: #334155;
-327 Bytes
Loading
-304 Bytes
Loading
-304 Bytes
Loading
-346 Bytes
Loading
-321 Bytes
Loading
-19.8 KB
Loading

0 commit comments

Comments
 (0)