MCPcopy
hub / github.com/apache/tvm / downloadCache

Method downloadCache

web/src/runtime.ts:1373–1388  ·  view source on GitHub ↗
(start: number, end: number)

Source from the content-addressed store, hash-verified

1371
1372 // First download all shards to cache parallely if not yet in cache
1373 const downloadCache = async (start: number, end: number) => {
1374 // Download params [start, end) from `list`
1375 for (let i = start; i < end; i++) {
1376 const shard = list[i];
1377 const dataUrl = new URL(shard.dataPath, tensorCacheUrl).href;
1378 try {
1379 await artifactCache.addToCache(dataUrl, "arraybuffer", signal);
1380 } catch (err) {
1381 this.env.logger("Error: Cannot fetch " + dataUrl + " err= " + err);
1382 throw err;
1383 }
1384 timeElapsed = Math.ceil((perf.now() - tstart) / 1000);
1385 fetchedBytes += shard.nbytes;
1386 reportCallback(++fetchedShards, /*loading=*/false);
1387 }
1388 }
1389 // We launch 4 parallel for loops to limit the max concurrency to 4 download
1390 if (!cacheOnly) {
1391 const loopSize = Math.floor(list.length / 4);

Callers

nothing calls this directly

Calls 1

addToCacheMethod · 0.65

Tested by

no test coverage detected