Skip to content

(WIP) [js/web] WebGL backend refactor - #8576

Closed
Yulong Wang (fs-eire) wants to merge 62 commits into
microsoft:masterfrom
fs-eire:fs-eire/ort-web-refactor
Closed

Yulong Wang (fs-eire) wants to merge 62 commits into
microsoft:masterfrom
fs-eire:fs-eire/ort-web-refactor

Conversation

@fs-eire

@fs-eire Yulong Wang (fs-eire) commented Aug 1, 2021 •

Copy link
Copy Markdown
Contributor

Description: This PR contains several changes to the WebGL backend framework code. The major changes are:

  • unify concepts ProgramInfo and RunData for operator implementations. Previously it's designed based on the assumption that each operator will be implemented by using exactly 1 WebGL shader program, which is proved to be false. The old operator interface is replaced by a function-based one, using WebGLInferenceHandler.run() to run a program, which can be called multiple times in one operator's implementation.
  • remove createProgramInfo and createRunData and use one implementation function.
  • operator resolves to the implementation function ( instead of the instance based Operator interface)
  • Hide TextureLayout and TextureData from operator implementation. Now they are WebGL backend internal data structures.
  • introduce ProgramInfoLoader for caching reusable program info. (WIP)

The behavior should not be changed before vs. after the refactoring.

Benefit of this change:

  • operators are much easier to develop (ie. implement new operator, or maintain existing ones), because of the simplification on interfaces and concepts.
  • artifacts cache will work as expected for all programs. (before this refactoring, the cache breaks when multiple shader programs are used in one operator implementation. )
  • cleaned up blockers for some future features (eg. texture based const-folding)

@fs-eire

Copy link
Copy Markdown
Contributor Author

wrong source branch. closed and replaced by #8586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants