Tencent / Tencent/ncnn

benchmark测试,开启vulkan出现越界访问的错误

Open
#4,191 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
23.8k
Forks
4.5k
Avg merge
2d 20h
Merged PRs (30d)
37

Description

编译环境: win10 vs2019 gtx1660s
复现步骤:
1.下载20220910最新代码,编译
2.执行benchmark.exe 1 16 0 0 1

错误定位:当执行squeezenet_int8模型时,convolution_vulkan.cpp第216-222行出错
此时的weight_data的elemsize为1,但直接用float*进行访问

解决参考:
在Net::load_param函数中(load_param_bin同理),应在
int lr = layer->load_param(pd);
之后执行
if (layer->support_int8_storage)
{
// no int8 gpu support yet
opt.use_vulkan_compute = false;
}
以及
#if NCNN_VULKAN
if (opt.use_vulkan_compute)
layer->vkdev = d->vkdev;
#endif // NCNN_VULKAN

Contributor guide

Open the contributing guide

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.

Research direction

Reproduce the issue on the stated Windows/VS2019 GTX1660S setup with benchmark.exe 1 16 0 0 1, then inspect convolution_vulkan.cpp lines 216-222 and the Net::load_param and load_param_bin entry points. Verify the squeezenet_int8 path and Vulkan handling around int8 storage. Done means the benchmark no longer performs the reported out-of-bounds access.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.