Skip to content
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

How should EntryPoint consumers register ML.NET assemblies? #2063

Closed
montebhoover opened this issue Jan 7, 2019 · 2 comments
Closed

How should EntryPoint consumers register ML.NET assemblies? #2063

montebhoover opened this issue Jan 7, 2019 · 2 comments

Comments

@montebhoover
Copy link
Contributor

@eerhardt, when we made HostEnvironmentBase and ComponentCatalog internal you mentioned that EntryPoint consumers like NimbusML or the GUI should be responsible for registering their ML.NET assemblies:

2. ...
3. Other subsystems (like the GUI, command-line, Entry Points, and model loading) will be responsible for registering the components they require in the manner they require.
4. ...

Could you give me some pointers on how to best go about that? Currently NimbusML registers assemblies using the ComponentCatalog from when it was public and we need to update this to ML.NET 0.9: https://github.com/Microsoft/NimbusML/blob/e1004720ec0c252ba87f02c190c33739d9c00f20/src/DotNetBridge/Bridge.cs#L314

cc: @TomFinley @yaeldekel @shmoradims

@montebhoover montebhoover changed the title How should EntryPoint consumers to register ML.NET assemblies? How should EntryPoint consumers register ML.NET assemblies? Jan 7, 2019
@eerhardt
Copy link
Member

eerhardt commented Jan 8, 2019

We may have gone too far internalizing things w.r.t. IHostEnvironment and ComponentCatalog.

As it currently sits, it is not easy to implement IHostEnvironment outside of ML.NET. This is because IHostEnvironment has a member:

        /// <summary>
        /// The catalog of loadable components (<see cref="LoadableClassAttribute"/>) that are available in this host.
        /// </summary>
        ComponentCatalog ComponentCatalog { get; }

However, ComponentCatalog has an internal constructor - meaning projects outside of ML.NET cannot instantiate it.

The one way to instantiate it publicly would be to create an MLContext, and use its ComponentCatalog instance.

So I guess it begs the same kinds of questions that @TomFinley is asking on #1959: Why does NimbusML need to implement IHostEnvironment and/or inherit from HostEnvironmentBase? Why can't it just use MLContext, like other public consumers do?

@montebhoover
Copy link
Contributor Author

Thanks for the details. It sounds like MLContext may be sufficient after all. The two requirements for HostEnvironmentBase/MLContext in NimbusML are registering assemblies and getting access to an IChannel, and it looks like we can do both through MLContext.

@artidoro artidoro closed this as completed Jul 2, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants