akaashrp commented on code in PR #18450:
URL: https://github.com/apache/tvm/pull/18450#discussion_r2529605042
##########
web/src/runtime.ts:
##########
@@ -1421,6 +1421,12 @@ export class Instance implements Disposable {
throw err;
}
}
+ if (i === 0) {
+ // Reset for the loading phase to avoid double counting with download
phase.
+ fetchedBytes = 0;
Review Comment:
@insertmike I think it would be clearer to move this before the loop.
Something like this:
```
fetchedBytes = 0;
fetchedShards = 0;
timeElapsed = 0;
```
near L1376.
##########
web/src/runtime.ts:
##########
@@ -1421,6 +1421,12 @@ export class Instance implements Disposable {
throw err;
}
}
+ if (i === 0) {
+ // Reset for the loading phase to avoid double counting with download
phase.
+ fetchedBytes = 0;
+ }
+ fetchedBytes += shard.nbytes;
+ timeElapsed = Math.ceil((perf.now() - tstart) / 1000);
reportCallback(i + 1, /*loading=*/true);
Review Comment:
Since this is somewhat related and I don't think this necessitates a
separate PR, could we replace this with `++fetchedShards` instead (after
resetting fetchedShards to 0 before the loop)? Same change for L1362:
https://github.com/apache/tvm/pull/18450/files#diff-adf6436b29c63d8d69cbe84b652aa664e6ab7c22241806ad6e2109983f497c1eR1362.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]