Run frontier MoE models on hardware you already own — pure C, zero deps, experts streamed from disk. Tiny engine, immense model. 🐦
C
fix(download): finish FP8 queues with unknown shard sizes
Rudy Celeklia6a0ebd9c6e4
diff --git a/c/download_fp8.py b/c/download_fp8.pyindex fd2707ef..80352f41 100644--- a/c/download_fp8.py+++ b/c/download_fp8.py@@ -229,7 +229,8 @@ def main():completed.append(fn)elapsed = time.time() - t0have = sum(sizes.get(f,0) for f in completed)- pct = 100.0 * have / total_bytes+ pct = (100.0 * have / total_bytes if total_bytes > 0+ else 100.0 * len(completed) / total)speed = (have - sum(sizes[f] for f in done_set)) / max(elapsed, 1)eta = (total_bytes - have) / speed if speed > 0 else 0print(f" {C.grn}✓{C.r} {fn} {C.dim}— {len(completed)}/{total} · "diff --git a/c/tests/test_download_fp8.py b/c/tests/test_download_fp8.pyindex 7c342c3f..f039b86b 100644--- a/c/tests/test_download_fp8.py+++ b/c/tests/test_download_fp8.py@@ -83,6 +83,22 @@ class DownloadExitStatusTests(unittest.TestCase):mock.patch.object(download_fp8, "download_file_hf"):self.assertEqual(self.run_main(dest, "--source", "hf"), 1)+ def test_unknown_shard_sizes_do_not_terminate_worker(self):+ names = ["model-00001.safetensors", "model-00002.safetensors"]+ manifest = (names, {name: 0 for name in names})+ with tempfile.TemporaryDirectory() as dest, \+ mock.patch.object(download_fp8, "get_shard_list_ms", return_value=manifest), \+ mock.patch.object(download_fp8.threading, "excepthook") as failed_worker:+ def download(name):+ with open(os.path.join(dest, name), "wb") as output:+ output.write(b"data")+ with mock.patch.object(download_fp8, "download_file_ms", side_effect=download):+ self.assertEqual(self.run_main(dest, "--source", "ms", "--parallel", "1"), 0)+ failed_worker.assert_not_called()+ for name in names:+ with open(os.path.join(dest, name), "rb") as shard:+ self.assertEqual(shard.read(), b"data")+def test_empty_manifest_returns_nonzero(self):with tempfile.TemporaryDirectory() as dest, \mock.patch.object(download_fp8, "get_shard_list_hf",