Skip to content

ML Model format #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dontcallmedom opened this issue Aug 20, 2020 · 3 comments
Open

ML Model format #74

dontcallmedom opened this issue Aug 20, 2020 · 3 comments
Labels
Discussion topic Topic discussed at the workshop Opportunities and Challenges Opportunities and Challenges of Browser-Based Machine Learning Web Platform Foundations Web Platform Foundations for Machine Learning

Comments

@dontcallmedom
Copy link
Member

@cynthia in his talk points out the lack of consensus on a particular format for ML models:

One of the complications in defining a mechanism to run pre-trained neural network models in the browser is to agree on the standard format for packaging and shipping these neural network models. Machine learning academia and the ecosystem of frameworks have still not agreed on a common format which makes this challenging for us as a platform, as we must choose from one of the multiple competing proposals.

The Model Loader API explainer (presented by @jbingham) offers some of the characteristics of what a good format would be in this context, with MLIR as a potential candidate.

This raises the following questions to me:

  • does this discussion need consensus beyond the Web browsers community? beyond the JS community (cf Applicability to non-browser JS environments #62)? Can the Web lead the way (or at least, one way) or would it be doomed to fail without broader take up in other popular ML environments?
  • is there an existing venue or a logical one for building or verifying consensus on the direction to follow for such a format?
@bhack
Copy link

bhack commented Aug 20, 2020

There Is also this interesting thread at iree-org/iree#2863

@jbingham
Copy link
Collaborator

jbingham commented Aug 21, 2020 via email

@wchao1115
Copy link

wchao1115 commented Sep 2, 2020

With regards to the format issue, the people working on WebNN including myself have spent considerable amount of time researching and comparing ML operation semantics across many popular frameworks and de-facto standards. An interesting observation from this exercise is that they are much more in common than most people think. This is probably due to the domain's historical root and the openness of the research community in the evolution of the domain knowledge. It is evident in the fact that most models can be converted to a different format reasonably well at the semantic level. Most problems people are facing today are tactical operational gaps such as redundancy and tool chain inefficiency.

As a case study, when we started the development of the DirectML project a few years ago, we initially modeled its semantic operations on the earlier versions of ONNX, the format backing the WinML API. To our pleasant surprise, we found that more than 90% of DirectML functionality already built was readily transferable to our work on TensorFlow. If one would look at key building block functions such as gemm or matmul, or even some reusable layers such as convolution or recurrent networks across the many formats we have, one would find that these operations are in fact already semantically compatible, down to the parameter semantics in many cases.

In my view, the difference among these formats are more tactical and less semantic. They differ in breadth of variety and reusability, which are perhaps due to uncontrolled growth from rapid development. They in fact do share a very big overlap. In this sense, ML operations are not that different from regular API -- they are defined with the purpose of reuse. When Cho et al. introduced in their 2014 paper a novel recurrent network, there was no ML operation gru defined anywhere. It was only later when people want to reuse them in their work that a new operation was defined for it in their respective frameworks, in almost identical forms, and not just for a part of it but for the entire network. So, reuse drives adoption of new operations to an extent that, over time, some even make its way into dedicated silicon.

@anssiko anssiko added Opportunities and Challenges Opportunities and Challenges of Browser-Based Machine Learning Web Platform Foundations Web Platform Foundations for Machine Learning labels Sep 3, 2020
@anssiko anssiko added this to the 2020-09-22 Live Session #2 milestone Sep 21, 2020
@dontcallmedom dontcallmedom added the Discussion topic Topic discussed at the workshop label Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion topic Topic discussed at the workshop Opportunities and Challenges Opportunities and Challenges of Browser-Based Machine Learning Web Platform Foundations Web Platform Foundations for Machine Learning
Projects
None yet
Development

No branches or pull requests

5 participants