insertmike commented on code in PR #18450:
URL: https://github.com/apache/tvm/pull/18450#discussion_r2527399594


##########
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);

Review Comment:
   I agree but I also think this is a separate issue and should be addressed 
separately. This PR is isolated to progress updating when loading from cache 
and follows best practices of single responsibility principle, solving just 1 
problem.



##########
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);

Review Comment:
   I agree but I also think this is a separate issue and should be addressed 
separately. This PR is isolated to progress updating when loading from cache 
and follows best practices of single responsibility principle, solving just 1 
problem. @gemini-code-assist 



-- 
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]

Reply via email to