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
Add support for python 3.11 #3190
Changes from 19 commits
fa4e31e
e7e6bbc
14e6fee
dd96a19
9c922b9
62c2008
cf8d153
b2aef1a
28ca9de
0d4f8a4
18fbb5f
6e626af
06b41f2
6a0387e
2e65ea8
ef9fb68
cdbd78e
4c94b71
ea9da42
88d0664
93900e4
43e4e16
7533e8a
3429b5c
6f1935d
ac8f128
8e7d838
8024a1b
cb98de7
75c13d0
650cc81
22cee55
9bd84af
a4fabd7
b94c248
7a4eef0
060a6cd
ca8d8ef
0d5519e
bee41e4
c38fe7e
9084527
f24b561
f0cbf1c
70d5745
983415b
15da1de
4081cdb
953d559
ad04285
6f1d2fd
ed3f969
07246b8
8555539
73758c2
11652e9
0524102
7228201
fba061c
6deb782
2e62c43
5227c72
84592cc
4315d6e
5586f48
681709d
c30990d
b82d137
97d9386
bd6b173
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,21 +16,23 @@ function setup_build_contrib_env { | |
} | ||
|
||
function setup_torch_gpu { | ||
# Security-patched torch. | ||
python3 -m pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116 | ||
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cu118 reinstall_torch | ||
} | ||
|
||
function setup_torch_cpu { | ||
# Security-patched torch | ||
python3 -m pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cpu | ||
PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu reinstall_torch | ||
} | ||
|
||
function setup_torch_gpu_non_linux { | ||
pip3 install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116 | ||
setup_torch_gpu | ||
} | ||
|
||
function setup_torch_cpu_non_linux { | ||
pip3 install torch==1.13.1 torchvision==0.14.1 | ||
setup_torch_cpu | ||
} | ||
|
||
function reinstall_torch { | ||
pip3 install --force-reinstall torchvision~=0.15.1 | ||
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. why 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. I think |
||
} | ||
|
||
function setup_hf_model_mirror { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
python: ["3.8", "3.9", "3.10"] | ||
python: ["3.8", "3.9", "3.10", "3.11"] | ||
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. To trigger a platform test, you should be able to do it with comment on this PR by However, our platform tests are currently failing because of other issues. @gradientsky @Innixma We'll want to fix the platform tests to unblock this PR |
||
steps: | ||
- name: Checkout repository for PR | ||
if: (github.event_name == 'workflow_dispatch') | ||
|
@@ -77,7 +77,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
python: ["3.8", "3.9", "3.10"] | ||
python: ["3.8", "3.9", "3.10", "3.11"] | ||
steps: | ||
- name: Checkout repository for PR | ||
if: (github.event_name == 'workflow_dispatch') | ||
|
@@ -109,7 +109,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
python: ["3.8", "3.9", "3.10"] | ||
python: ["3.8", "3.9", "3.10", "3.11"] | ||
steps: | ||
- name: Checkout repository for PR | ||
if: (github.event_name == 'workflow_dispatch') | ||
|
@@ -141,7 +141,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
python: ["3.8", "3.9", "3.10"] | ||
python: ["3.8", "3.9", "3.10", "3.11"] | ||
steps: | ||
- name: Checkout repository for PR | ||
if: (github.event_name == 'workflow_dispatch') | ||
|
@@ -174,7 +174,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
python: ["3.8", "3.9", "3.10"] | ||
python: ["3.8", "3.9", "3.10", "3.11"] | ||
steps: | ||
- name: Checkout repository for PR | ||
if: (github.event_name == 'workflow_dispatch') | ||
|
@@ -214,7 +214,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
python: ["3.8", "3.9", "3.10"] | ||
python: ["3.8", "3.9", "3.10", "3.11"] | ||
steps: | ||
- name: Checkout repository for PR | ||
if: (github.event_name == 'workflow_dispatch') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ pip install -U setuptools wheel | |
|
||
# CPU version of pytorch has smaller footprint - see installation instructions in | ||
# pytorch documentation - https://pytorch.org/get-started/locally/ | ||
pip install torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html | ||
pip install torchvision~=0.15.1 --force-reinstall --extra-index-url https://download.pytorch.org/whl/cpu | ||
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. I switched the docs to torch's new torchvision etc have an exact pin on a torch version, so this command is sufficient (and will reinstall cuda version if a user previously had a cpu version installed amd vice versa) |
||
|
||
pip install autogluon | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,13 +33,13 @@ | |
"evaluate>=0.2.2,<0.4.0", | ||
"accelerate>=0.9,<0.17", | ||
"timm>=0.6.12,<0.7.0", | ||
"torch>=1.9,<1.14", | ||
"torchvision<0.15.0", | ||
"torch>=1.11,<2.1", | ||
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 change makes users install torch 2.0 by default. Is the CI still testing torch 1.13.1? If so, there is some inconsistency between what we test and what users use. 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. does this thread answer your question? #3190 (comment) after this merges I think there are no explicit tests that run with pytorch 1.x anymore |
||
"torchvision>=0.12.0,<0.16", | ||
"fairscale>=0.4.5,<0.4.14", | ||
"scikit-image>=0.19.1,<0.20.0", | ||
"pytorch-lightning>=1.9.0,<1.10.0", | ||
"scikit-image>=0.19.1,<0.21.0", | ||
"pytorch-lightning>=2.0.0,<2.1", | ||
"text-unidecode>=1.3,<1.4", | ||
"torchmetrics>=0.11.0,<0.12.0", | ||
"torchmetrics~=1.0.0rc0", | ||
"transformers>=4.23.0,<4.27.0", | ||
"nptyping>=1.4.4,<2.5.0", | ||
"omegaconf>=2.1.1,<2.3.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,13 +239,13 @@ def training_step(self, batch, batch_idx): | |
|
||
def on_validation_start(self) -> None: | ||
if self.skip_final_val and self.trainer.should_stop: | ||
self.trainer.val_dataloaders = [] # skip the final validation by setting val_dataloaders empty | ||
self.log( | ||
self.validation_metric_name, | ||
self.validation_metric, | ||
on_step=False, | ||
on_epoch=True, | ||
) | ||
return None | ||
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. @suzhoum Can you verify the fast build mode still behaves well after this change? 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. more context in the commit message: 18fbb5f |
||
return super().on_validation_start() | ||
|
||
def validation_step(self, batch, batch_idx): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1429,15 +1429,15 @@ def _fit( | |
reduce_bucket_size=config.env.deepspeed_allreduce_size, | ||
) | ||
else: | ||
strategy = None | ||
strategy = "auto" | ||
else: | ||
strategy = config.env.strategy | ||
else: | ||
# we don't support running each trial in parallel without ray lightning | ||
if use_ray_lightning: | ||
strategy = hpo_kwargs.get("_ray_lightning_plugin") | ||
else: | ||
strategy = None | ||
strategy = "auto" | ||
num_gpus = min(num_gpus, 1) | ||
|
||
config.env.num_gpus = num_gpus | ||
|
@@ -1451,7 +1451,7 @@ def _fit( | |
log_filter = LogFilter(blacklist_msgs) | ||
with apply_log_filter(log_filter): | ||
trainer = pl.Trainer( | ||
accelerator="gpu" if num_gpus > 0 else None, | ||
accelerator="gpu" if num_gpus > 0 else "auto", | ||
devices=get_available_devices( | ||
num_gpus=num_gpus, | ||
auto_select_gpus=config.env.auto_select_gpus, | ||
|
@@ -1475,7 +1475,6 @@ def _fit( | |
log_every_n_steps=OmegaConf.select(config, "optimization.log_every_n_steps", default=10), | ||
enable_progress_bar=enable_progress_bar, | ||
fast_dev_run=config.env.fast_dev_run, | ||
track_grad_norm=OmegaConf.select(config, "optimization.track_grad_norm", default=-1), | ||
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. Please update the doc correspondingly: https://github.com/autogluon/autogluon/blob/master/docs/tutorials/multimodal/advanced_topics/customization.ipynb?short_path=c0bd10d#L368 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. BTW, as lightning has removed 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. ref Lightning-AI/pytorch-lightning#16745 they suggest an explicit 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.
|
||
val_check_interval=config.optimization.val_check_interval, | ||
check_val_every_n_epoch=config.optimization.check_val_every_n_epoch | ||
if hasattr(config.optimization, "check_val_every_n_epoch") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So changes from this file actually won't be reflected in our CI because we are checking the permission of the PR submission and avoid people modifying our setup scripts.
Currently there's no easy solution to enable it to run. I'm thinking of allow the script to be used if we tag this PR as something like
safe to run
in the future. For now, we might need to give @ddelange write permission to our repo briefly and revoke the permission once the PR is ready. @Innixma @gradientsky Ideas?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like good practice to keep that closed off 💪
fwiw, I don't mind if a maintainer opens a new PR in favour of this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion with the team, I'll be creating a clone of this PR once it's ready to test for changes. Once those changes are being verified, we'll merge this PR and close the clone PR.