Repository navigation
Python writer: Qwen2.5-Coder-0.5B on Core ML + live demo - #35
Open
Alex-Wengg wants to merge 2 commits into
Open
Alex-Wengg wants to merge 2 commits into
Alex-Wengg wants to merge 2 commits into
Conversation
CodeWriterManager writes Python from a plain-English request with Qwen2.5-Coder-0.5B-Instruct on Core ML (HF FluidInference/qwen2.5-coder-0.5b-coreml, pinned @48abc2c5). One 944 MB multifunction package: `prefill` (448-token prompt, Neural Engine, 1,451/1,456 ops) and `decode` (stateful 1,024-slot KV cache, GPU), same split and K/V hand-off as ShortReplyManager. Greedy decode streams the text after every token; extractCode pulls the first fenced block. - CodeWriterModelStore: checksummed download of the pinned snapshot. - CodeWriterCheck: replays HumanEval through the Swift host, compares token streams with a reference run, runs the tests with python3 (`hf` = download via the store). - CodeWriterDemo: ten MBPP tasks (one per Python feature) written live into an editor, then each task's asserts run with python3; type-your-own bar; demo.sh opens macmon + the live log. Numbers (M5 Pro, macOS 27): HumanEval pass@1 89/164 Core ML vs 90/164 PyTorch fp32, 142/164 token streams identical; prefill ~52 ms, decode 36-51 tok/s. The demo list is hand-picked (Mbpp/12 failed and was replaced by Mbpp/397); all ten pass.
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.
A 0.5B model on the Mac writes Python from plain-English requests and the code runs. Qwen2.5-Coder-0.5B-Instruct on Core ML (FluidInference/qwen2.5-coder-0.5b-coreml): the prompt runs on the Neural Engine, the writing on the GPU (same split as
ShortReplyManager).CodeWriterManager— loads the multifunction package (prefill448 tokens on the ANE,decodewith a 1,024-slot KV cache on the GPU), greedy decode, streams text after every token.CodeWriterModelStore— checksummed download pinned to48abc2c5.CodeWriterDemo— ten MBPP tasks (one per Python feature) written live into an editor, thenpython3runs each task's asserts;demo.shadds macmon + the live log.CodeWriterCheck— HumanEval through the Swift host, token-stream parity against a reference run.Notes: the ANE carries ~1% of a task by time (prompt only; the stateful decoder runs on the GPU). Running the model's code needs
python3on the PATH. Conversion code lives outside this repo.🤖 Generated with Claude Code