VivekPanyam/carton

[Rust] Quick start example throw Broken pipe error via WSL

Closed this issue ยท 11 comments

katopz commented

Source

https://carton.run/quickstart

Error

{"tokens": String([["day"]], shape=[1, 1], strides=[1, 1], layout=CFcf (0xf), dynamic ndim=2), "scores": Float([[14.551311]], shape=[1, 1], strides=[1, 1], layout=CFcf (0xf), dynamic ndim=2)}
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }', /app/source/carton-runner-interface/src/do_not_modify/framed.rs:71:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: SendError(RPCResponse { id: 0, complete: true, data: LogMessage { record: LogRecord { metadata: LogMetadata { level: Trace, target: "mio::poll" }, args: "deregistering event source from poller", module_path: Some("mio::poll"), file: Some("/root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-0.8.5/src/poll.rs"), line: Some(663) } } })', /app/source/carton-runner-interface/src/server.rs:299:36

Any hint?

Hi! This is #148. The fix has already landed and should be released when the nightly runner builds happen. See the linked issue for more details.

In the meantime, your program is actually working correctly; the error message is from the runner process while it's shutting down. Although it's not a good experience, it doesn't affect the main process or the correctness of the model inference. As mentioned, it should be fixed tonight and I'll post another comment when the release is out.

katopz commented

Cool thx!, anyway it's not support on Windows am i right? I can see plenty of unix specific there.

   Compiling sendfd v0.4.3
error[E0433]: failed to resolve: could not find `unix` in `os`
 --> C:\Users\katop\.cargo\registry\src\index.crates.io-6f17d22bba15001f\sendfd-0.4.3\src\lib.rs:7:14
  |
7 | use std::os::unix::io::{AsRawFd, RawFd};
  |              ^^^^ could not find `unix` in `os`

error[E0432]: unresolved import `std::os::unix`
 --> C:\Users\katop\.cargo\registry\src\index.crates.io-6f17d22bba15001f\sendfd-0.4.3\src\lib.rs:8:14
  |
8 | use std::os::unix::net;
  |              ^^^^ could not find `unix` in `os`

   Compiling tracing-subscriber v0.3.17

Correct, Windows is not currently supported. I'm open to it if there's interest (or if someone wants to help), but I don't have plans to implement Windows support myself at the moment.

katopz commented

I'm not a big fan of Windows either ๐Ÿ˜… but i think i will take a look if it's not much patch needed.

I suspect it'll be fairly involved, but you're welcome to take a look!

Among other things, the runner interface may be somewhat complex to get working on Windows. We use Unix domain sockets and file descriptor passing on Linux and macOS. You'll probably need to implement an alternative for Windows.

If the core library, the runner interface, and the noop runner work, that's a big step towards Windows support. After that, each of the runners will require some work, but that can be done incrementally.

katopz commented

That seems far from my hobby ๐Ÿ˜…, maybe this related ๐Ÿ‘‰ tokio-rs/tokio#2201 JIC someone passing by

There are plenty of other places to help out if you're interested! See here.

Depending on what you want to spend time on, you could work on:

  • creating bindings for a new language
  • creating a runner for a new ML framework
  • cleaning up existing code (search for todo in the codebase)
  • exploring performance and optimization stuff
  • speeding up CI builds
  • ...

Do any of those sound interesting to you?

katopz commented

My hobby is Rust/Wasm/Cloudflare Workers related (try to avoid js/ts as possible but still), anyway i do have 4090 here so i think i can help on perf/benchmark and maybe optimization pretty much later. ๐Ÿ™Œ

One thing that would be super useful is if you could explore creating a wonnx runner. I built scaffolding for being able to run inference from the WASM bindings, but haven't had a chance to create a runner that can run in WASM.

Does that sound like something you'd enjoy working on?

katopz commented

Cool, i will take a look. ๐Ÿง

Sounds good.

The nightly builds are complete and new runners have been released that solve the problem. See #148 (comment) for instructions on updating.

I'll go ahead and close this issue since the original task is fixed. I'll create another issue about wonnx sometime tomorrow