Mousius commented on a change in pull request #10565:
URL: https://github.com/apache/tvm/pull/10565#discussion_r827824993



##########
File path: python/tvm/relay/testing/tf.py
##########
@@ -216,32 +216,43 @@ def get_workload_official(model_url, model_sub_path):
     model_sub_path:
         Sub path in extracted tar for the ftozen protobuf file.
 
+    retries: int
+        The number of retries to attempt downloading and uncompressing
+        the model in the CI, due to possible network and CI node issues.
+
     Returns
     -------
     model_path: str
         Full path to saved model file
 
     """
-
-    model_tar_name = os.path.basename(model_url)
-    model_path = download_testdata(model_url, model_tar_name, module=["tf", 
"official"])
-    dir_path = os.path.dirname(model_path)
-
-    if model_path.endswith("tgz") or model_path.endswith("gz"):
-        import tarfile
-
-        tar = tarfile.open(model_path)
-        tar.extractall(path=dir_path)
-        tar.close()
-    elif model_path.endswith("zip"):
-        import zipfile
-
-        zip_object = zipfile.ZipFile(model_path)
-        zip_object.extractall(path=dir_path)
-        zip_object.close()
-    else:
-        raise RuntimeError("Could not decompress the file: " + model_path)
-    return os.path.join(dir_path, model_sub_path)
+    attempts = retries + 1
+    error = None
+    for current_attempt_idx in range(attempts):

Review comment:
       `download_testdata` eventually calls into `download`:
   
https://github.com/apache/tvm/blob/1fd1b794fe3b50075ce45418546ee6999a36bc73/python/tvm/contrib/download.py#L174
   which already implements a `retries` flag:
   
https://github.com/apache/tvm/blob/1fd1b794fe3b50075ce45418546ee6999a36bc73/python/tvm/contrib/download.py#L29
   
   What's the reason for implementing retries again here?




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