-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Download model weights in parallel for prototype CI #4772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
57ad254
54e88ca
603f615
35a7a46
df386b9
96b7411
adf0c24
0fc0bdd
b9335aa
7bebe1a
a134e03
c6bdeea
f443f2a
d497f21
4a9f1c1
bd4c84d
b5bf51a
b030fdd
fe4537b
0e76cf9
7c652b7
a1086b7
9d2bb9c
0a7d1f6
a6f0eb1
cfe4a71
df2097a
ff3d39b
789446e
3d1eac3
ef21703
037aeb1
70b09b0
a45f56d
a9eb425
0c81611
8b1ebaf
133933e
60b2716
0a247d4
7ed8fe3
a2f9758
fe3e128
31f26a6
4f3ddb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import pathlib | ||
import re | ||
import sys | ||
|
||
MODEL_URL_PATTERN = re.compile(r"https://download[.]pytorch[.]org/models/.*?[.]pth") | ||
|
||
|
||
def main(root): | ||
model_urls = set() | ||
pmeier marked this conversation as resolved.
Show resolved
Hide resolved
|
||
for path in pathlib.Path(root).glob("**/*"): | ||
if path.name.startswith("_") or not path.suffix == ".py": | ||
continue | ||
|
||
with open(path, "r") as file: | ||
for line in file: | ||
model_urls.update(MODEL_URL_PATTERN.findall(line)) | ||
|
||
print("\n".join(sorted(model_urls))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This approach is a bit hacky, though admittedly you can't do much else prior compiling torchvision. If TorchVision was compiled, we could rely on the upcoming registration mechanism to get all available models and weights and then fetch their URLs. Since this is not possible for speed reasons, we might be forced to do something like that. The good thing is even if this fails, we will download the weights properly one-by-one later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seeing how fast the download is, we could also do it in the foreground after the installation. Still much faster than downloading sequentially during the tests. Both variants are fine by me. You pick. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 13 seconds sounds pretty good to me. It's your call. I don't mind either way. |
||
|
||
|
||
if __name__ == "__main__": | ||
main(sys.argv[1]) |
Uh oh!
There was an error while loading. Please reload this page.