abrown opened PR #6893 from abrown:remove-backend-kind
to bytecodealliance:main
:
One improvement that came from discussions with @geekbeast is that
BackendKind
, the enum used for differentiating between ML implementation, is no longer necessary. Instead, we can use the generatedGraphEncoding
type as the key to map to the right implementation.Also, this PR adopts the
Wrapper(Box<dyn ...>)
pattern everywhere, which now includes backends and registries. Since wasi-nn accepts multiple implementations for all of these things, we need a way to virtually dispatch to the right implementation. Previously we used theBox<dyn ...>
type explicitly in many places but this change opts to use a wrapper around this, expecting users to create the wrapper viaFrom
andInto
and internally accessing the implementation viaDeref
andDerefMut
. The idea is to eliminate some of the "type clutter;" let me know if you agree.
abrown requested wasmtime-core-reviewers for a review on PR #6893.
abrown requested fitzgen for a review on PR #6893.
abrown updated PR #6893.
abrown updated PR #6893.
alexcrichton submitted PR review:
Nothing looks obviously wrong here to me but I'm not super familiar with the NN stuff of wasi-nn. It sounds like you're ok with that though so feel free to merge with my cursory review of "seems fine"
abrown merged PR #6893.
Last updated: Dec 23 2024 at 12:05 UTC