microsoft / microsoft/onnxruntime

onnxruntime-web bug : 'return f4' is fast as normal, but 'return f1,f2,f3,f4' is very slow in webgl mode

Open
#12,609 13 comments 0 reactions 1 assignee View on GitHub

@shalvamist is already working on this.

Since Aug 17, 2022.

platform:web
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

(1)slow when return f1,f2,f3,f4
def forward(self, x):
f1 = self.b1(x)
f2 = self.b2(f1)
f3 = self.b3(f2)
f4 = self.b4(f3)
return f1,f2,f3,f4
when I return f1,f2,f3,f4 , the onnx used in chrome is very slow. (ort.min.js using webgl)

(2) fast when return f4
def forward(self, x):
f1 = self.b1(x)
f2 = self.b2(f1)
f3 = self.b3(f2)
f4 = self.b4(f3)
return f4
when I only return f4 , the onnx used in chrome is very fast. (ort.min.js using webgl)
but in normal , the two way should be the same time
I also find that
def forward(self, x):
f1 = self.b1(x)
f2 = self.b2(f1)
return f2
is faster than
def forward(self, x):
f1 = self.b1(x)
return f1
So anyone can tell me why?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.