abrown opened PR #6895 from abrown:switch-tests
to bytecodealliance:main
:
Previously, all wasi-nn testing was performed by a
ci/run-wasi-nn-example.sh
Bash script. This was inadequate for testing thewasmtime-wasi-nn
crate. This change attempts to remedy that by (1) switching the "check the environment" logic of that script over to Rust and (2) writing some more tests. The tests all perform the same MobileNet inference but at different levels of abstraction; I would prefer to test other scenarios but this involves even more infrastructure and seems to be more the responsibility of the ML backend in question. At least this change makes it easier to test more ML backends as they are added and for developers to run tests directly withcargo test
. Note that part of this infrastructure code is a way to skip tests when the environment is not ready for wasi-nn; developers should not seecargo test
failures if they are not interested in thewasmtime-wasi-nn
crate.
abrown requested pchickey for a review on PR #6895.
abrown requested wasmtime-default-reviewers for a review on PR #6895.
abrown requested wasmtime-core-reviewers for a review on PR #6895.
abrown updated PR #6895.
alexcrichton created PR review comment:
I think it's ok to remove this as it's no longer in the repo
alexcrichton submitted PR review:
Seems reasonable to me!
alexcrichton submitted PR review:
Seems reasonable to me!
alexcrichton created PR review comment:
To avoid pulling in this dependency, could this perhaps assume that
curl
is an executable on the system and useCommand
to spawn curl to download things? (if it's only used for testing anyway in theory that should be ok)
alexcrichton created PR review comment:
Is the
test-check
feature here primarily for thereqwest
dependency? If that goes away could this part go away to and unconditionally usecfg(test)
for thetest_check
stuff?
abrown submitted PR review.
abrown created PR review comment:
Yeah, that's a better idea; I'll switch to that.
abrown submitted PR review.
abrown created PR review comment:
Well, kind of. I need to be able to use the
test_check
module from various places: unit tests, integration tests, Wasmtime CLI tests... When I was trying to make this work I observed that I could#[cfg(test)]
thetest_check
module and still use it for unit tests but not for the other cases. I actually need this logic available (somehow) in the public interface of the crate. Or perhaps not "_the_ crate" but rather "_a_ crate": I could move this logic to a separate crate likewasmtime-wasi-nn-test
and create adev-dependency
on that?
abrown updated PR #6895.
abrown updated PR #6895.
abrown updated PR #6895.
abrown updated PR #6895.
alexcrichton submitted PR review.
alexcrichton created PR review comment:
Ah ok yeah makes sense, and yes if it's required outside this crate then
#[cfg(test)]
won't work. That being said though since there's no dependencies behind this implementation any more withreqwest
replaced I think it'd be fine to unconditionally include this functionality in the crate and other embedders would largely just ignore it.
abrown updated PR #6895.
abrown updated PR #6895.
abrown updated PR #6895.
This has been superseded by #7679.
abrown closed without merge PR #6895.
Last updated: Dec 23 2024 at 13:07 UTC