Skip to content

Commit a8d0dc1

Browse files
committed
Drop Python 3.10 and restore JAX 0.9 XLA coverage
1 parent 9d6dbb8 commit a8d0dc1

12 files changed

Lines changed: 69 additions & 22 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Check out our [arXiv paper](https://arxiv.org/abs/2206.10558) for more details!
4343

4444
### PyPI
4545

46-
EnvPool is currently hosted on [PyPI](https://pypi.org/project/envpool/). It supports Python 3.10-3.13.
46+
EnvPool is currently hosted on [PyPI](https://pypi.org/project/envpool/). It supports Python 3.11-3.13.
4747

4848
You can simply install EnvPool with the following command:
4949

docs/content/build.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ EnvPool requires **GCC/G++ version >= 9.0** to build the source code. To install
7979
# to change the default cc to gcc-9:
8080
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
8181
82-
It also requires **Python version >= 3.10**:
82+
It also requires **Python version >= 3.11**:
8383

8484
.. code-block:: bash
8585

docs/content/new_env.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ If we want to add ``tianshou`` as a build dependency, in ``setup.cfg``:
716716
717717
[options]
718718
packages = find:
719-
python_requires = >=3.10
719+
python_requires = >=3.11
720720
install_requires =
721721
dm-env>=1.4
722722
gym>=0.18

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Installation
4747
------------
4848

4949
EnvPool is currently hosted on `PyPI <https://pypi.org/project/envpool/>`_.
50-
It supports Python 3.10-3.13.
50+
It supports Python 3.11-3.13.
5151

5252
You can install EnvPool with the following command:
5353

envpool/python/xla_template.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
"""xla template on python side."""
1515

1616
from collections import namedtuple
17-
from typing import Any, Callable, List, Tuple, Union, cast
17+
from typing import Any, Callable, List, Tuple, cast
1818

1919
import numpy as np
2020
from jax import ShapeDtypeStruct, dtypes, ffi
21-
from jax import numpy as jnp
2221

2322

2423
def _normalize_specs(
@@ -71,7 +70,9 @@ def _make_xla_function(
7170
tuple(_layout(shape) for shape, _ in out_specs)
7271
if len(out_specs) > 1 else _layout(out_specs[0][0])
7372
),
74-
custom_call_api_version=0,
73+
# JAX target registration uses api_version=0 for the legacy untyped
74+
# handler, but StableHLO custom_call uses API_VERSION_ORIGINAL == 1.
75+
custom_call_api_version=1,
7576
legacy_backend_config=cast(Any, handle),
7677
)
7778

envpool/vizdoom/vizdoom_pretrain_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_d3(self) -> None:
186186
try:
187187
# Full bazel runs may overlap this spawned evaluation with other
188188
# long-running pretrain tests on shared devbox CPUs.
189-
reward, length = result_queue.get(timeout=240)
189+
reward, length = result_queue.get(timeout=360)
190190
except queue.Empty:
191191
proc.terminate()
192192
proc.join(timeout=5)

gh/wf/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release PyPI Wheel
2+
3+
# on: [push, pull_request]
4+
on:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- v*
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
container: trinkle23897/envpool-release:2023-01-02-5f1a5fd
15+
strategy:
16+
matrix:
17+
python-version: ["3.11", "3.12", "3.13"]
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python ${{ matrix.python-version }}
21+
run: |
22+
ln -sf /root/.cache $HOME/.cache
23+
ln -sf /root/.pyenv $HOME/.pyenv
24+
pyenv global ${{ matrix.python-version }}-dev
25+
- name: Build
26+
run: |
27+
make pypi-wheel
28+
pip3 install dist/*.whl --force-reinstall
29+
- name: Test
30+
run: |
31+
make release-test
32+
- name: Upload artifact
33+
uses: actions/upload-artifact@main
34+
with:
35+
name: wheel
36+
path: wheelhouse/
37+
38+
publish:
39+
runs-on: ubuntu-latest
40+
needs: [release]
41+
steps:
42+
- uses: actions/download-artifact@v3
43+
with:
44+
path: artifact
45+
- name: Move files so the next action can find them
46+
run: |
47+
mkdir dist && mv artifact/wheel/* dist/
48+
ls dist/
49+
- name: Publish distribution to PyPI
50+
if: startsWith(github.ref, 'refs/tags')
51+
uses: pypa/gh-action-pypi-publish@release/v1
52+
with:
53+
password: ${{ secrets.PYPI_API_TOKEN }}

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ project_urls =
1111
Bug Tracker = https://github.com/sail-sg/envpool/issues
1212
classifiers =
1313
Programming Language :: Python :: 3
14-
Programming Language :: Python :: 3.10
1514
Programming Language :: Python :: 3.11
1615
Programming Language :: Python :: 3.12
1716
Programming Language :: Python :: 3.13
@@ -21,7 +20,7 @@ classifiers =
2120

2221
[options]
2322
packages = find:
24-
python_requires = >=3.10
23+
python_requires = >=3.11
2524
install_requires =
2625
dm-env>=1.4
2726
gym>=0.18

third_party/pip_requirements/requirements-dev-lock.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ gymnasium==1.2.3
2424
h5py==3.16.0
2525
idna==3.11
2626
imageio==2.37.3
27-
jax==0.6.2; python_version < "3.11"
28-
jax==0.9.2; python_version >= "3.11"
29-
jaxlib==0.6.2; python_version < "3.11"
30-
jaxlib==0.9.2; python_version >= "3.11"
27+
jax==0.9.2
28+
jaxlib==0.9.2
3129
jinja2==3.1.6
3230
labmaze==1.0.6
3331
llvmlite==0.46.0

third_party/pip_requirements/requirements-dev.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ dm-env>=1.6
55
gym>=0.26.2
66
gymnasium>=1.2.3
77
optree>=0.19.0
8-
jax[cpu]>=0.6.2,<0.7; python_version<'3.11'
9-
jax[cpu]>=0.9.2,<0.10; python_version>='3.11'
8+
jax[cpu]>=0.9.2,<0.10
109
absl-py
1110
packaging>=26.0
1211
tqdm

0 commit comments

Comments
 (0)