Repository navigation
Conversation
…ights reads either's tensors by name One owner for the choice the Metal open and the CUDA side both make. Under a split the bytes are the mapped run (no new copy); under a folder they are the folder's normalised part. An unknown name or an empty directory is refused by name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…as downloaded The loader reads each site through Weights (a split's mapped bytes, or the folder's parts) and writes its spans straight into the site's buffer. Session::open_model and instance_of_model are new; open and instance_of wrap them over a path. The e2e gate's m_mlx_folder clause holds each fixture row's MLX folder to its prepared split (plan lines, 24 ids, the first step's logits bit for bit), and lab-metal-e2e runs model-hf's fixture tests first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-m or --hf, with no prepare step model_arg owns the naming: -m, --hf and BLOOMERY_REF_MODEL name a model once, --hf resolves a repo into the hub cache, and the served alias defaults to the folder's or the repo's name. docs/mac.md gives the MLX path as --hf or -m and leaves prepare as the way to write a split. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ates' fetch reads it Co-Authored-By: Claude Opus 5.5 <[email protected]>
…0.3.10 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: CLEAN: I built no failure path that the code does not block, and I found no proven duplicate, unneeded element or moved gate.
Non-blocking
⚠ Fetch events are hand-formatted as record lines: crates/metal/src/model_arg.rs:82 prints hf set …, hf checkpoint …, hf file … and the others as strings. crates/gpu-gates/src/model_file/fetch.rs:40 prints the same events through the Kinds HF_SET, HF_CHECKPOINT and the rest. If a Kind changes its keys, the Metal lines drift with no gate noticing. Direction: use the Kinds if bloomery-metal can take that dependency without CUDA. If it cannot, say so in the module doc.
⚠ A second owner of "path is a split or a folder": crates/model-hf/src/model_file.rs:63 decides is_dir(), then folder::open or Split::open, with the error texts checkpoint folder {path}: … and open {path}: …. crates/gpu-gates/src/model_file.rs:77 (header, read_folder) makes the same decision with the same texts. The PR body calls ModelFile "one owner". Direction: a later change moves header onto ModelFile::open, or a sentence says why the two stay apart.
⚠ crates/metal/src/bin/generate_metal.rs:826 lists "--ctx", "-m", "--hf" as a literal beside PATH_FLAGS. A new path spelling would be refused as a generation flag under --plan. Build the list from PATH_FLAGS.
⚠ Question: Sources::GgufOrCheckpoint (crates/metal/src/model_arg.rs:67) fetches any safetensors repo before the Metal check can refuse its architecture. Does --hf <bf16 repo> download the whole repo first and then refuse by name?
Checked
- Duplicates: 14 new items checked. Hits: the two ⚠ above. dryer found 0 pairs.
- Complexity:
open_model_as(new, 17) is the oldopen_asbody moved.generate,plan_runandopeneach gain one branch.mac::main+1 is one match arm. No split needed. - Silent failure: 7 sites followed. Each ends in a named refusal or a bounds check.
- Hot path: load time only. No performance finding.
- Tests: for
m_mlx_folder, a loader that drops a span or reorders planes turns the bit-exact logits clause red. Fora_split_lends_its_mapped_bytes, a copy turnsptr::eqred. - Gates: no pin moved. The new
hw_a_tests are#[ignore]d. Escape catalog: no match.
Notes
- Evidence is from an M1 Pro, not an NVIDIA card. The PR changes no CUDA path.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
…ias is the model's name Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Verdict: CLEAN: the new commit only lowers two model-tax counts, and both new counts match the code.
Since the last review:
- ⚠ Fetch events hand-formatted in
model_arg.rs: still open. The new commit does not touch it. - ⚠ Second owner of "split or folder" (
model_file.rsandgpu-gates): still open. - ⚠
--ctx,-m,--hfliteral besidePATH_FLAGSingenerate_metal.rs: still open. - ⚠ Question on
GgufOrCheckpointfetching a whole repo before the architecture refusal: no answer yet.
Checked
- Duplicates: no new items in this commit.
- Gates: tools/model-tax.tsv:136 and :137 fall (3 to 1, 2 to 1). The ratchet is two-sided, and a fall needs no PIN. I counted the family token lines in the PR tree.
bloomery_serve_metal.rshas 1 code line (line 51).generate_metal.rshas 1 (line 115). Both match. - Complexity: no code change in this commit.
- Silent failure, hot path, escape catalog: nothing in scope.
Notes
- Evidence is from an M1 Pro, not an NVIDIA card. The PR changes no CUDA path.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
What
On a Mac,
bloomery-serve-metalandgenerate_metalopen an mlx-community 4-bit folder as downloaded, with nobloomery-preparestep:--hf mlx-community/<repo>or-m <folder>. This is the CUDA side's principle (a checkpointfolder as downloaded) applied to Metal.
model_hf::ModelFile/Weights(new): one owner for "this path is a GGUF split or a checkpoint folder".Weights::bytes(name)lends a split's mapped bytes (no new copy) or gives the folder's normalised part. An unknownname or an empty directory is refused by name.
Weightsand writes its spans straight into the site's buffer.Session::open_modelandinstance_of_modelare new;open(path)andinstance_of(path)wrap them.model_argnames the model once (-m,--hf,BLOOMERY_REF_MODEL). The served alias defaults to thefolder's or the repo's name instead of a fixed
qwen35moe.docs/mac.md,docs/contrib/mac.mdand README give the MLX path as--hfor-m.preparestays, towrite one split.
Mapping the folder in place is not possible. The folder stores codes, scales and biases as three planes, and the kernels
read 36-byte interleaved blocks; the tensors' offsets are also unaligned. So the open repacks once, the same bytes
preparewrites.Evidence (second M1 Pro, [dev])
m_mlx_folder. On both fixture rows (qwen35moe, qwen3moe), the MLX folder gives the same plan lines,24 ids and first-step logits, bit for bit, as its prepared split. Mutants M-a, M-b and M-c are each red on both rows.
model-hf'shw_a_*tests hold every tensor's bytes from the folder equal to its split's.lab-metal-e2enow runsthem.
just lab-metalandjust lab-metal-e2erc 0. Clippy-D warningson the three builds. Metal lib 82 passed,model-hf lib 81 passed.
-mand--hf(from the hubcache).
bloomery-serve-metal -m <folder>chat reply equalsgenerate_metal's text on the same prompt.is 17.4 GB.
--round-ledger:gate-model-hf,gate-prepareandgate-prepare-corpus, red 0.tools/recipes.py reachfinds no gate that readsmodel_file.rsorlib.rsthrough a dependency. The two read it as their own target.check-leversis ok.AI use: written and checked with Claude Code.
🤖 Generated with Claude Code