Humuhumu33 commited on
Commit
139e306
·
verified ·
1 Parent(s): 81c5d37

Upload holo-load2bit.mjs with huggingface_hub

Browse files
Files changed (1) hide show
  1. holo-load2bit.mjs +5 -4
holo-load2bit.mjs CHANGED
@@ -110,10 +110,11 @@ export async function loadKappaObject(baseUrl, opts = {}) {
110
  // hash the on-GPU verifier reproduces; else SHA-256 (SRI axis, default). Untrusted-CDN-safe either way.
111
  let got;
112
  if (man.hash === "blake3") {
113
- // DEFAULT: re-derive on the GPU (2.74 GB/s, no CPU hash on the hot path) whenever WebGPU is present;
114
- // set globalThis.__gpuVerify=false to force the CPU path. CPU BLAKE3 is the automatic fallback.
115
- if (gpuBlake3Available() && (typeof globalThis === "undefined" || globalThis.__gpuVerify !== false)) {
116
- try { got = "blake3:" + await gpuBlake3Hex(gz); }
 
117
  catch (e) { got = "blake3:" + blake3hex(gz); }
118
  } else got = "blake3:" + blake3hex(gz);
119
  } else got = "sha256:" + hex(await crypto.subtle.digest("SHA-256", gz));
 
110
  // hash the on-GPU verifier reproduces; else SHA-256 (SRI axis, default). Untrusted-CDN-safe either way.
111
  let got;
112
  if (man.hash === "blake3") {
113
+ // OPT-IN (?verify=gpu → globalThis.__gpuVerify): re-derive on the GPU. Default = CPU BLAKE3 (the proven,
114
+ // working path). GPU verify wired here fails during engine construction (2-device conflict — see note);
115
+ // needs a single-device refactor before it can be default. On any GPU error, fall back to CPU.
116
+ if (typeof globalThis !== "undefined" && globalThis.__gpuVerify && gpuBlake3Available()) {
117
+ try { const h = await gpuBlake3Hex(gz); got = "blake3:" + h; }
118
  catch (e) { got = "blake3:" + blake3hex(gz); }
119
  } else got = "blake3:" + blake3hex(gz);
120
  } else got = "sha256:" + hex(await crypto.subtle.digest("SHA-256", gz));