Skip to content
← All reviews
ggml-org/llama.cpp #25847 · m1el · 4mo ago

webgpu : add CONV_2D_DW (depthwise conv2d) kernel

Needs attention1 finding · openOpen the pull request on GitHub ↗
Panel verdict

The panel surfaced issues that deserve attention before merge.

1
raised by reviewers
1
kept by the panel

Findings

HighCorrectnessconfidence 0.95

Incorrect weight indexing in CWHN shader variant

In the CWHN (contiguous-channels input) branch, the weight is indexed as params.offset_w + ky * knl_row + kx * params.channels + c. This assumes the weight is stored with channels innermost, but the weight tensor (src0) has shape [KW, KH, 1, C] and is stored in the standard contiguous (channel-major) layout: for each channel, all kernel elements are contiguous. The correct index should be params.offset_w + c * params.knl_h * params.knl_w + ky * params.knl_w + kx. The current indexing causes all reads to use wrong weight values, producing incorrect output for any CWHN input (i.e., when src1 is not contiguous but is contiguous-channels).

Suggested fix ·
let k = load_weight(params.offset_w + c * params.knl_h * params.knl_w + ky * params.knl_w + kx);
3 reviewers · deepseek/deepseek-v4-flash · reviewed in 1m 41s · 3 files, +279 −0

Ship the PR.
Skip the noise.

Free on 2 repositories · No credit card · Advisory only—never blocks a merge