Skip to content

Commit 8379a89

Browse files
Bump python deps (#406)
This patch bumps all the python deps to more recent versions. Tensorflow is not bumped to the latest version as the last tf_agents release is only compatible with v2.15.0. We need to figure out what to do here, but this should still be an improvement that we can build off of. The lockfile here was regenerated with Python 3.10, so probably will not be compatible with anything older. This patch also contains changes related to the pytype bump.
1 parent b6ee932 commit 8379a89

File tree

9 files changed

+1184
-1119
lines changed

9 files changed

+1184
-1119
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
task: [Typecheck, Lint, Yapf, Test]
4747
include:
4848
- task: Typecheck
49-
cmd: pytype -j auto --overriding-parameter-count-checks .
49+
cmd: pytype -j auto .
5050
- task: Lint
5151
cmd: pylint --rcfile .pylintrc --recursive yes .
5252
- task: Yapf

Pipfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
absl-py = "==1.0.0"
7+
absl-py = "==2.1.0"
88
gin-config = "==0.5.0"
9-
psutil = "==5.9.0"
10-
tf-agents = "==0.16.0"
11-
tensorflow = "==2.12.0"
12-
dm-reverb = "==0.11.0"
9+
psutil = "==6.1.0"
10+
tf-agents = "==0.19.0"
11+
tensorflow = "==2.15.0"
12+
dm-reverb = "==0.14.0"
1313

1414
[dev-packages]
1515
pylint = "==3.3.2"
16-
pytest = "==7.1.2"
17-
pytype = "==2022.06.06"
16+
pytest = "==8.3.4"
17+
pytype = "==2024.10.11"
1818
yapf = "==0.43.0"
1919

2020
[ci]
21-
joblib = "==1.1.1"
22-
shap = "==0.41.0"
21+
joblib = "==1.4.2"
22+
shap = "==0.46.0"
23+

Pipfile.lock

Lines changed: 1160 additions & 1106 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler_opt/es/blackbox_learner.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
from compiler_opt.rl import policy_saver
3333
from compiler_opt.es import blackbox_evaluator # pylint: disable=unused-import
3434

35+
# Pytype cannot pick up the pyi file for tensorflow.summary. Disable the error
36+
# here as these errors are false positives.
37+
# pytype: disable=pyi-error
38+
3539
# If less than 40% of requests succeed, skip the step.
3640
_SKIP_STEP_SUCCESS_RATIO = 0.4
3741

Binary file not shown.

compiler_opt/rl/imitation_learning/generate_bc_trajectories_lib.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -947,9 +947,7 @@ def gen_trajectories(
947947
)
948948
not_done = result_futures
949949
succeeded_idx = 0
950-
succeeded: List[Optional[Tuple[Tuple[int, ProfilingDictValueType,
951-
ProfilingDictValueType],
952-
tf.train.SequenceExample]]] = []
950+
succeeded = []
953951

954952
for written_files_idx in range(num_output_files):
955953
written_per_file = 0

compiler_opt/rl/train_bc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
from absl import logging
2222
import gin
2323

24+
# Pytype cannot pick up the pyi file for tensorflow.summary. Disable the error
25+
# here as these errors are false positives.
26+
# pytype: disable=pyi-error
27+
2428
# <Internal> Using XM - flags. # pylint: disable=unused-import
2529
from compiler_opt.rl import agent_config
2630
from compiler_opt.rl import data_reader

compiler_opt/rl/trainer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,11 @@ def train(self, dataset_iter, monitor_dict, num_iterations: int):
181181
"""Trains policy with data from dataset_iter for num_iterations steps."""
182182
self._reset_metrics()
183183
# context management is implemented in decorator
184+
# pytype: disable=attribute-error
184185
# pylint: disable=not-context-manager
185186
with tf.summary.record_if(lambda: tf.math.equal(
186187
self._global_step % self._summary_export_interval, 0)):
188+
# pytype: enable=attribute-error
187189
for _ in range(num_iterations):
188190
# When the data is not enough to fill in a batch, next(dataset_iter)
189191
# will throw StopIteration exception, logging a warning message instead

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ filterwarnings =
4141

4242
# Issue #255
4343
ignore:The line search algorithm did not converge
44+
45+
ignore:Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation.

0 commit comments

Comments
 (0)