Downloads · 30 days
1
50% of all-time downloads
pkhairkh/ANE-sha256d
ANE-sha256d is a machine learning model from pkhairkh. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
proving a point of emulation — making the ANE do pure bit-twiddling with nothing but fp16 and conv perms.
Downloads · 30 days
1
50% of all-time downloads
All-time downloads
2
Public
Repo size
9.9 MB
Likes
0
Public
Click a slice to open those files.
.mlmodel9.8 MB · 99%
From the Hugging Face model README
proving a point of emulation — making the ANE do pure bit-twiddling with nothing but fp16 and conv perms.
gather).hashlib.This is not a miner. It’s an ANE stress test that shows you can emulate integer crypto on a matrix engine…and that you probably shouldn’t, performance-wise. That contrast is the point.
model.py — builds and converts the Core ML package (bitlot.mlpackage).test.py — correctness + throughput harness (H/s, MH/s reporting).Repo name: ANE-Hash. Model artifact name in scripts is
bitlot.mlpackage—keep or rename to taste.
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install coremltools numpy
Build:
python model.py # produces bitlot.mlpackage
Verify on NIST-style strings (runs entirely on device, compares to hashlib):
python test.py --verify --cu CPU_AND_NE
Benchmark (prints mean/p50/p90 and hash rate):
python test.py --bench --batches 1,2,4,8,16,32,64,128,256,512,1024 \
--iters 10 --warmup 3 --cu CPU_AND_NE --verbose
mlprogram, opset targeting iOS 18 / macOS 15.CPU_AND_NE (or CPU_ONLY for sanity checks).If you want to nudge flexible-shape models toward ANE on newer OS builds, load with:
import coremltools as ct
mlmodel = ct.models.MLModel(
"bitlot.mlpackage",
compute_units=ct.ComputeUnit.CPU_AND_NE,
optimization_hints={"reshapeFrequency": ct.ReshapeFrequency.Infrequent},
)
(32,1,1) column of {0,1} in fp16, batched as (N,32,1,L).AND = mul, XOR = abs(a-b), OR = maximum, CH, MAJ are expressed via those primitives.Everything stays fp16; there are no fp32 constants and nothing that triggers batch-norm folding.
Not intended for mining or production crypto. If you want real speed, use:
uint math on GPU.RangeDim(1, 1024); best throughput often at batch 16–64.See LICENSE in this repo.
To everyone who looks at a matrix engine and says: “yeah, let’s make it do bitwise crypto.”
ANE-Hash is that energy.