Repository navigation
feat: support stream - #4
Conversation
Signed-off-by: kerthcet <kerthcet@gmail.com>
|
/kind feature |
There was a problem hiding this comment.
Pull request overview
This PR introduces a first-class Stream abstraction to the safe mlx crate API and wires stream selection into common array operations, enabling explicit CPU/GPU scheduling while keeping operator ergonomics via the default stream.
Changes:
- Add a safe
Streamwrapper with CPU/GPU constructors,Default, andset_as_default. - Extend
Arraywith eval + scalar/vec extraction helpers and add stream-aware arithmetic/unary/reduction ops. - Add operator overloads that run on the current default stream; update the
helloexample accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/mlx/src/stream.rs | Introduces Stream wrapper + default-stream management API. |
| crates/mlx/src/lib.rs | Exposes Stream from the crate root. |
| crates/mlx/src/dtype.rs | Extends ArrayElement to support typed scalar reads and typed data pointers. |
| crates/mlx/src/array.rs | Adds stream-aware ops, evaluation helpers, and operator overloads using the default stream. |
| crates/mlx/examples/hello.rs | Demonstrates default-stream behavior and per-op explicit stream control. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
crates/mlxcore-sys/build.rs:17
- The panic message says "macOS on Apple Silicon", but the guard only checks
target_os = "macos". Building on macOS x86_64 will proceed until later failures. Prefer checkingtarget_arch = "aarch64"too so the early error matches the supported platform.
README.md:39 cargo run --example hellowon't work from a virtual workspace root (this repo's rootCargo.tomlhas no[package]). You need to specify the package that owns the example, otherwise Cargo errors due to missing default package selection.
Runnable examples live in `crates/mlxcore/examples`:
```sh
cargo run --example hello
</details>
Signed-off-by: kerthcet <kerthcet@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
crates/mlxcore-sys/build.rs:17
- The platform guard only checks
target_os = "macos", but the panic message claims Apple Silicon only. Either enforcetarget_arch = "aarch64"as well, or adjust the message so it matches what the code actually checks.
crates/mlxcore/src/lib.rs:2 - This intra-doc link likely won’t resolve because Cargo crate names use hyphens (
mlxcore-sys), but Rust paths/intra-doc links use underscores (mlxcore_sys). Use the Rust crate identifier in the link target.
|
/lgtm |
InftyAI-Agent
left a comment
There was a problem hiding this comment.
Approved: PR has both lgtm and approved labels
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?