Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Swift binding for MLX’s FP8 (E4M3) → floating-point conversion to support FP8-weight inference workflows, and adjusts an upstream sync workflow to try to preserve local GitHub Actions workflows during sync.
Changes:
- Add
MLXFast.fromFp8(_:, dtype:, stream:)wrapper aroundmlx_from_fp8. - Update
.github/workflows/upstream-sync.ymlsync-branch creation logic to base onorigin/main, overlayupstream/main, and restore.github/workflowsfromorigin/main. - Switch GitHub CLI auth env var from
GITHUB_TOKENtoGH_TOKENfor PR creation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Source/MLX/MLXFast.swift | Exposes mlx_from_fp8 as MLXFast.fromFp8 with API docs. |
| .github/workflows/upstream-sync.yml | Changes upstream sync procedure and PR creation token env var. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| git reset --hard upstream/main | ||
| git checkout -B sync/upstream-latest origin/main | ||
| git checkout upstream/main -- . | ||
| git checkout origin/main -- .github/workflows |
Comment on lines
41
to
43
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | |
| /// - Returns: Array in the requested dtype with correctly converted FP8 values | ||
| public static func fromFp8( | ||
| _ x: MLXArray, dtype: DType = .bfloat16, stream: StreamOrDevice = .default | ||
| ) -> MLXArray { |
Comment on lines
+434
to
+439
| public static func fromFp8( | ||
| _ x: MLXArray, dtype: DType = .bfloat16, stream: StreamOrDevice = .default | ||
| ) -> MLXArray { | ||
| var result = mlx_array_new() | ||
| mlx_from_fp8(&result, x.ctx, dtype.cmlxDtype, stream.ctx) | ||
| return MLXArray(result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose fromFp8 for Qwen35 FP8 inference natively.