Skip to content
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

LAI [wip] #15122

Closed
wants to merge 243 commits into from
Closed
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
8bcfe51
CI: add pytest for LAI
Borda Oct 12, 2022
80f11ee
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2022
c119c8c
placeholder
Borda Oct 12, 2022
d656c7f
Merge branch 'master' into ci/pytest-lai
Borda Oct 12, 2022
5f5b554
replace
Borda Oct 12, 2022
5071871
-tqdm
Borda Oct 12, 2022
abc92b4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2022
52f6333
adjust
Borda Oct 12, 2022
575a44d
pt
Borda Oct 12, 2022
41c4179
pt
Borda Oct 12, 2022
deccee7
req
Borda Oct 12, 2022
e864a69
req
Borda Oct 12, 2022
820ddff
install
Borda Oct 12, 2022
44efebb
-oldest
Borda Oct 12, 2022
d2c627b
app
Borda Oct 12, 2022
7863972
fsspec
Borda Oct 12, 2022
832f2b1
pl
Borda Oct 12, 2022
9071927
typing
Borda Oct 12, 2022
2e6d7b5
names
Borda Oct 12, 2022
46d79af
encode
Borda Oct 12, 2022
348f3ad
fix imports
Borda Oct 12, 2022
ba8f500
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 12, 2022
00fc2a7
matrix
Borda Oct 13, 2022
bf5b64c
Merge branch 'ci/pytest-lai' of https://github.com/PyTorchLightning/p…
Borda Oct 13, 2022
dbbdb29
more general replace imports
Oct 13, 2022
d1fa7dc
proper import
Oct 13, 2022
ce1ea5a
ensure PROJECT_ROOT is correct
Oct 13, 2022
1d178ed
mirror + prune
Borda Oct 13, 2022
19a6917
makedir
Borda Oct 13, 2022
a73ce2f
setup
Borda Oct 13, 2022
40d1db8
wtf, windows?
Oct 13, 2022
873847f
update testing
justusschock Oct 13, 2022
dfbf32b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2022
e1ab776
missing '
justusschock Oct 13, 2022
dff7b2c
only sanity check pytorch deps when running pytorch tests
justusschock Oct 13, 2022
52154ff
proper package pruning
Oct 13, 2022
3e62c64
I'm stupid again
justusschock Oct 13, 2022
721ca3c
messing with requirements
justusschock Oct 13, 2022
d152da9
Revert "wtf, windows?"
Oct 13, 2022
7ea449b
messing with requirements part 2
justusschock Oct 13, 2022
414055f
comment out doctests for now as there are only imports
justusschock Oct 13, 2022
6a39110
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2022
fc01887
ci
Borda Oct 13, 2022
df8794a
ci
Borda Oct 13, 2022
ccbe4fd
name
Borda Oct 13, 2022
11744df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 13, 2022
c6d4d91
ci clean
Borda Oct 13, 2022
f6feaaa
Merge branch 'pkg/lai-source' of https://github.com/PyTorchLightning/…
Borda Oct 13, 2022
36e9c04
empty
Borda Oct 13, 2022
972b509
py
Borda Oct 13, 2022
4acc2df
parallel
Borda Oct 13, 2022
47f0386
yolo
Oct 13, 2022
d4294b6
doctest
Borda Oct 13, 2022
b7a6469
flake8
Borda Oct 13, 2022
4fc4fc5
ci
Borda Oct 13, 2022
f03aa13
typo
Borda Oct 13, 2022
170858d
Merge branch 'master' into pkg/lai-source
Borda Oct 13, 2022
7c8f1c4
Merge branch 'ci/pytest-lai' into LAI
Borda Oct 13, 2022
3110638
replace
Borda Oct 13, 2022
c7b4c69
replace
Borda Oct 13, 2022
3b4b535
clean
Borda Oct 13, 2022
d3d838d
Apply suggestions from code review
Borda Oct 13, 2022
8575b6d
rename files with .in
Borda Oct 13, 2022
f5c947b
resolve circular
Oct 13, 2022
a433400
Revert "rename files with .in"
Borda Oct 13, 2022
50cbe84
OTA!
Borda Oct 13, 2022
81462e8
first part
Oct 13, 2022
64b8949
another one
Oct 13, 2022
70a2c77
Update __init__.py
justusschock Oct 13, 2022
2d99119
Revert "Update __init__.py"
Oct 13, 2022
13904e9
JUSTUS!
Oct 13, 2022
254d474
Merge branch 'master' into pkg/lai-source
Borda Oct 13, 2022
b7227a3
Update ci-lai-test-full.yml
justusschock Oct 13, 2022
155274e
replace everything, all the time
Oct 13, 2022
6d1831f
rename offending things
Oct 13, 2022
947247f
fix app pytest
Oct 13, 2022
b7c0432
rename offenders
Oct 13, 2022
b2af92b
maybe last offender?
Oct 13, 2022
5559f76
maybe last offender?
Oct 13, 2022
935434f
re.sub
Borda Oct 13, 2022
2e62e7e
fix UI path
Borda Oct 13, 2022
0a7e804
re.sub
Borda Oct 13, 2022
c181544
fix UI path
Borda Oct 13, 2022
c33482c
full replace
Borda Oct 13, 2022
aca890b
ci: cleaning
Borda Oct 13, 2022
2285871
full replace
Borda Oct 13, 2022
d69301e
ui path?
Borda Oct 13, 2022
d7f3c8a
ui path?
Borda Oct 13, 2022
9ee65d6
test pkg
Borda Oct 18, 2022
cdc7ae7
comment out doctests for now as there are only imports
justusschock Oct 18, 2022
0442cdc
ignore?
Borda Oct 18, 2022
d942e53
fix assistant.py
justusschock Oct 18, 2022
739822c
hide app state, so that it doesn't triggereed on import and we don't …
Oct 18, 2022
cb5dc71
Merge branch 'master' into LAI
justusschock Oct 18, 2022
04bce78
package tests passing
Oct 18, 2022
ccc04f7
properly guard bagua
Oct 18, 2022
1214a93
compile byte-code
Oct 18, 2022
59e428e
Merge branch 'master' into LAI
Oct 18, 2022
9f35f9a
force ompile byte-code
Oct 18, 2022
e150b97
remove bytecompiling
Oct 18, 2022
c2b06b1
no offenders on app side
Oct 18, 2022
9fdc68d
ugly hacks, ugly hack everywhere
Oct 18, 2022
2e28045
we need to copy everything, including templates
Oct 18, 2022
bdbd621
fix assistant.py
justusschock Oct 18, 2022
0f262ba
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 18, 2022
4b667af
why, assistant, why
Oct 18, 2022
2f18c18
jsonargparse in actions requirements
Oct 18, 2022
a73d572
underscore
Oct 18, 2022
8ecb680
fix assistant
Oct 18, 2022
5218ab2
copy only if different
Oct 18, 2022
631cc94
i'm stupid
Oct 18, 2022
c42fd99
fix assistant
Oct 18, 2022
71eb6e3
fix paths
Oct 18, 2022
146f776
I feel stupid
Oct 18, 2022
f7b2290
I feel stupid, vol2
Oct 18, 2022
1b92fc6
panel <0.12.7 is broken due to jinja https://github.com/holoviz/panel…
Oct 18, 2022
ae7bfc0
redis==4.0.0 is broken for tests
Oct 19, 2022
9bf0698
Merge branch 'master' into LAI
justusschock Oct 19, 2022
1471d4c
prune packages correctly
Oct 19, 2022
8bb8c00
remove offending test
Oct 19, 2022
cde5a37
JIRKA!!!
justusschock Oct 19, 2022
6370fd9
revert init logger names
justusschock Oct 19, 2022
dbfafb4
adapt offending test
Oct 19, 2022
14780a1
comment
Oct 19, 2022
c20f581
collective barriers
Oct 19, 2022
c06db3d
Merge branch 'master' into LAI
Oct 19, 2022
14d7e53
Revert "collective barriers"
Oct 19, 2022
6d14d93
explicit backend for cpu stuff
justusschock Oct 19, 2022
66f2979
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 19, 2022
5f200ab
no barrier at all
Oct 19, 2022
36b2ba3
next try
justusschock Oct 19, 2022
3b7fb78
run lite tests
Oct 19, 2022
c75ec8f
DEBUG - run groups test separately
carmocca Oct 19, 2022
0db2e13
readd barrier
justusschock Oct 19, 2022
98c2e73
Barrier Comment
carmocca Oct 19, 2022
554d852
Merge branch 'master' into LAI
Borda Oct 19, 2022
0be666b
Merge branch 'master' into LAI
justusschock Oct 20, 2022
85b04d1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 20, 2022
f31153f
Merge branch 'master' into pkg/lai-source
Borda Oct 20, 2022
0a17aba
replace
Borda Oct 20, 2022
c553d50
Merge branch 'master' into LAI
otaj Oct 20, 2022
597b91a
lite
Borda Oct 20, 2022
311cbb2
app
Borda Oct 20, 2022
e6698b7
pytorch
Borda Oct 20, 2022
2f8072e
Merge branch 'master' into ci/monolitic
Borda Oct 20, 2022
9cebc1e
LAI
Borda Oct 20, 2022
202e9a9
Merge branch 'ci/monolitic' of https://github.com/PyTorchLightning/py…
Borda Oct 20, 2022
83c9aed
prune
Borda Oct 20, 2022
6d2f762
cache
Borda Oct 20, 2022
162e68f
adjust
Borda Oct 20, 2022
349597a
Merge branch 'master' into LAI
otaj Oct 20, 2022
823a4a0
Merge branch 'master' into ci/monolitic
Borda Oct 20, 2022
c3a11b9
Merge branch 'master' into LAI
Oct 20, 2022
50d5e71
do all the things automatic merge didn't finish
Oct 20, 2022
d606e0c
fire
Borda Oct 20, 2022
61569db
Revert "fire"
Borda Oct 20, 2022
ee46182
silly jsonparser
Borda Oct 20, 2022
1b4fc76
if
Borda Oct 20, 2022
ac2e4e9
''
Borda Oct 20, 2022
ea446f8
Merge branch 'master' into LAI
awaelchli Oct 21, 2022
77504c8
Merge branch 'master' into ci/monolitic
otaj Oct 21, 2022
74d0898
Merge branch 'master' into LAI
Oct 21, 2022
e86f347
finalize merge
Oct 21, 2022
9aed564
iff
Borda Oct 21, 2022
4f114aa
devel
Borda Oct 21, 2022
4689ddb
splits
Borda Oct 21, 2022
7343218
str
Borda Oct 21, 2022
0482d0a
kwargs
Borda Oct 21, 2022
2c33c80
fsspec
Borda Oct 21, 2022
1f2cb5b
ifff
Borda Oct 21, 2022
29c835c
bash
Borda Oct 21, 2022
ff713d8
skip
Borda Oct 21, 2022
a203d28
cache
Borda Oct 21, 2022
717e209
group
Borda Oct 21, 2022
98d107a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
ad95f9e
sanity
Borda Oct 21, 2022
24299db
Merge branch 'ci/monolitic' of https://github.com/PyTorchLightning/py…
Borda Oct 21, 2022
d8acded
type
Borda Oct 21, 2022
c46b733
docs
Borda Oct 21, 2022
4a3d0ed
import
Borda Oct 21, 2022
672920a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
b763f64
PL
Borda Oct 21, 2022
90a4db6
Merge branch 'ci/monolitic' of https://github.com/PyTorchLightning/py…
Borda Oct 21, 2022
aebaa8e
CI: apps
Borda Oct 21, 2022
67d5251
fix imports
Borda Oct 21, 2022
29bc29c
req
Borda Oct 21, 2022
80314df
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
eb67adc
Apply suggestions from code review
Borda Oct 21, 2022
740c6e3
url
Borda Oct 21, 2022
172d1b8
Merge branch 'ci/monolitic' of https://github.com/PyTorchLightning/py…
Borda Oct 21, 2022
69b3961
doctest
Borda Oct 21, 2022
b00fa8f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
1fce8e6
pytest
Borda Oct 21, 2022
2f742ef
Merge branch 'ci/app' of https://github.com/PyTorchLightning/pytorch-…
Borda Oct 21, 2022
e4a9c6d
pytest
Borda Oct 21, 2022
6ae1da7
app
Borda Oct 21, 2022
a733b98
SQLModel
Borda Oct 21, 2022
ee3fb8e
pl
Borda Oct 21, 2022
c1bbf4a
pkg
Borda Oct 21, 2022
ecf80ff
pkg
Borda Oct 21, 2022
7a47ddc
-
Borda Oct 21, 2022
26ef213
fsspec
Borda Oct 21, 2022
e769be4
ci
Borda Oct 21, 2022
042da03
tp
Borda Oct 21, 2022
fab0bc1
Merge branch 'ci/app' into ci/monolitic
Borda Oct 21, 2022
d91ce64
drop test
Borda Oct 21, 2022
e619571
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2022
39e8121
Merge branch 'master' into ci/app
Borda Oct 21, 2022
02e6fc8
azure
Borda Oct 21, 2022
2d9fe23
Merge branch 'ci/app' of https://github.com/PyTorchLightning/pytorch-…
Borda Oct 21, 2022
227ba27
docs
Borda Oct 21, 2022
68574f9
falek8
Borda Oct 21, 2022
7be8754
Merge branch 'ci/app' into ci/monolitic
Borda Oct 21, 2022
646807c
url
Borda Oct 21, 2022
22f5fe6
cat
Borda Oct 21, 2022
b4186dc
!=
Borda Oct 21, 2022
9264861
drop
Borda Oct 21, 2022
1ff3c6e
Merge branch 'ci/monolitic' into LAI
Borda Oct 21, 2022
92cbfd7
bash
Borda Oct 21, 2022
102aa26
Merge branch 'pkg/lai-source' into LAI
Borda Oct 21, 2022
afdcbda
Merge branch 'master' into pkg/lai-source
Borda Oct 21, 2022
8218752
Merge branch 'master' into ci/monolitic
Borda Oct 22, 2022
0e1ce58
Merge branch 'master' into pkg/lai-source
Borda Oct 22, 2022
f574a75
order
Borda Oct 22, 2022
73e0051
TO
Borda Oct 22, 2022
7c12f82
LAI
Borda Oct 22, 2022
12899be
Merge branch 'master' into pkg/lai-source
Borda Oct 22, 2022
c57b767
Merge branch 'ci/monolitic' into LAI
Borda Oct 22, 2022
35b4495
Merge branch 'pkg/lai-source' into LAI
Borda Oct 22, 2022
dcfb222
scope
Borda Oct 22, 2022
cf28463
Merge branch 'ci/monolitic' into LAI
Borda Oct 22, 2022
8d072df
scope
Borda Oct 22, 2022
6d7d867
run
Borda Oct 22, 2022
63eb2df
flag
Borda Oct 22, 2022
7e633e4
Merge branch 'ci/monolitic' into LAI
Borda Oct 22, 2022
995c6e9
Merge branch 'master' into pkg/lai-source
Borda Oct 23, 2022
c2b88b8
Merge branch 'master' into LAI
Borda Oct 23, 2022
128b577
updates
Borda Oct 23, 2022
5b1acfc
regex
Borda Oct 23, 2022
ac20d05
ci
Borda Oct 23, 2022
3272080
Merge branch 'pkg/lai-source' into LAI
Borda Oct 23, 2022
ba4d216
fix
Borda Oct 23, 2022
9bebf19
Merge branch 'master' into LAI
Oct 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 48 additions & 6 deletions .actions/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@
from packaging.version import parse as version_parse

REQUIREMENT_FILES = {
"app": (
"requirements/app/base.txt",
"requirements/app/cloud.txt",
"requirements/app/ui.txt",
),
"pytorch": (
"requirements/pytorch/base.txt",
"requirements/pytorch/extra.txt",
"requirements/pytorch/loggers.txt",
"requirements/pytorch/strategies.txt",
"requirements/pytorch/examples.txt",
)
),
}
REQUIREMENT_FILES_ALL = tuple(chain(*REQUIREMENT_FILES.values()))
PACKAGE_MAPPING = {"app": "lightning-app", "pytorch": "pytorch-lightning"}
Expand Down Expand Up @@ -68,10 +73,10 @@ def prepare_nightly_version(proj_root: str = _PATH_ROOT) -> None:
now_date = now.strftime("%Y%m%d")

print(f"prepare init '{path_info}' - replace version by {now_date}")
with open(path_info) as fp:
with open(path_info, encoding="utf-8") as fp:
init = fp.read()
init = re.sub(r'__version__ = [\d\.\w\'"]+', f'__version__ = "{now_date}"', init)
with open(path_info, "w") as fp:
with open(path_info, "w", encoding="utf-8") as fp:
fp.write(init)

@staticmethod
Expand All @@ -88,14 +93,23 @@ def _prune_packages(req_file: str, packages: Sequence[str]) -> None:
path = Path(req_file)
assert path.exists()
text = path.read_text()
final = [str(req) for req in pkg_resources.parse_requirements(text) if req.name not in packages]
lines = text.splitlines()
final = []
for line in lines:
ln_ = line.strip()
if not ln_ or ln_.startswith("#"):
final.append(line)
continue
req = list(pkg_resources.parse_requirements(ln_))[0]
if req.name not in packages:
final.append(line)
pprint(final)
path.write_text("\n".join(final))

@staticmethod
def _replace_min(fname: str) -> None:
req = open(fname).read().replace(">=", "==")
open(fname, "w").write(req)
req = open(fname, encoding="utf-8").read().replace(">=", "==")
open(fname, "w", encoding="utf-8").write(req)

@staticmethod
def replace_oldest_ver(requirement_fnames: Sequence[str] = REQUIREMENT_FILES_ALL) -> None:
Expand Down Expand Up @@ -163,6 +177,34 @@ def mirror_pkg2source(pypi_folder: str, src_folder: str) -> None:
shutil.rmtree(py_dir2, ignore_errors=True)
shutil.copytree(py_dir, py_dir2)

@staticmethod
def copy_replace_imports(
source_dir: str, source_import: str, target_import: str, target_dir: Optional[str] = None
) -> None:
"""Recursively replace imports in given folder."""
ls = glob.glob(os.path.join(source_dir, "**", "*.py"), recursive=True)
for fp in ls:
with open(fp, encoding="utf-8") as fo:
py = fo.readlines()
for i, ln in enumerate(py):
# ln_ = ln.lstrip()
should_replace = True
# if ln_.startswith("import"):
# should_replace = True
# elif re.search(r"from [\w_\.\d]+ import ", ln_):
# should_replace = True
# elif "sys.modules[" in ln_:
# should_replace = True
# elif "importlib" in ln_:
# should_replace = True

if should_replace:
py[i] = ln.replace(source_import, target_import)
if target_dir:
fp = fp.replace(source_dir, target_dir)
with open(fp, "w", encoding="utf-8") as fo:
fo.writelines(py)


if __name__ == "__main__":
fire.Fire(AssistantCLI)
Loading