Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .github/scripts/update_executorch_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"docker/MODULE.bazel.docker": frozenset({"version", "commit"}),
"docker/MODULE.bazel.ngc": frozenset({"version", "commit"}),
"justfile": frozenset({"version"}),
"pyproject.toml": frozenset({"version"}),
"py/torch-tensorrt-executorch-runtime/README.md": frozenset({"version"}),
"py/torch-tensorrt-executorch-runtime/pyproject.toml": frozenset({"version"}),
"toolchains/ci_workspaces/MODULE.bazel.tmpl": frozenset({"version", "commit"}),
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ jobs:
# message rather than a configure error about a missing extension.
${CONDA_RUN} python -m pip install pyyaml patchelf "wheel>=0.40" \
--extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" \
"executorch==1.6.0.dev20260915"
"executorch==1.6.0.dev20260923"
# Give the companion wheel the same channel/date and CUDA local-version
# suffix as torch-tensorrt, while retaining its independent base version.
main_version="$(sed 's/a0$//' version.txt)"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/executorch-test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
# --pre would apply to every other requirement in the same command too.
python -m pip install pyyaml "wheel>=0.40" \
--extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" \
"executorch==1.6.0.dev20260915"
"executorch==1.6.0.dev20260923"

# The shared artifact carries the matching core and companion wheels.
shopt -s nullglob
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
# Resolve the user-facing range without reusing the build's installed pin.
python -m venv "${RUNNER_TEMP}/range-check-venv"
# pin-check: range-ok
"${RUNNER_TEMP}/range-check-venv/bin/python" -m pip install --no-deps --extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" "executorch>=1.6.0.dev20260915,<1.7"
"${RUNNER_TEMP}/range-check-venv/bin/python" -m pip install --no-deps --extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" "executorch>=1.6.0.dev20260923,<1.7"

source tests/py/utils/ci_helpers.sh
trt_tier_executorch
Expand Down
4 changes: 2 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ local_torch = use_repo_rule("//toolchains:local_torch.bzl", "local_torch")
new_git_repository(
name = "executorch",
build_file = "@//third_party/executorch:BUILD",
# executorch==1.6.0.dev20260915
commit = "1b421c43d3ff6495ab52977c1c8ada11568b1314",
# executorch==1.6.0.dev20260923
commit = "7677aa22a4cf0298db9783b37e808e9350c2c59d",
patch_cmds = [
"find . -mindepth 2 \\( -name BUILD -o -name BUILD.bazel \\) -delete",
"mkdir executorch && find . -mindepth 1 -maxdepth 1 ! -name executorch ! -name BUILD ! -name BUILD.bazel ! -name REPO.bazel -exec cp -a {} executorch/ \\;",
Expand Down
4 changes: 2 additions & 2 deletions dev_dep_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ __cuda_version__: "13.4"
__tensorrt_version__: "11.3.0"
__tensorrt_rtx_version__: "1.6.1"
__tensorrt_llm_version__: "0.17.0.post1"
__executorch_version__: "1.6.0.dev20260915"
__executorch_commit__: "1b421c43d3ff6495ab52977c1c8ada11568b1314"
__executorch_version__: "1.6.0.dev20260923"
__executorch_commit__: "7677aa22a4cf0298db9783b37e808e9350c2c59d"
4 changes: 2 additions & 2 deletions docker/MODULE.bazel.docker
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ new_local_repository(
new_git_repository(
name = "executorch",
build_file = "@//third_party/executorch:BUILD",
# executorch==1.6.0.dev20260915
commit = "1b421c43d3ff6495ab52977c1c8ada11568b1314",
# executorch==1.6.0.dev20260923
commit = "7677aa22a4cf0298db9783b37e808e9350c2c59d",
patch_cmds = [
"find . -mindepth 2 \\( -name BUILD -o -name BUILD.bazel \\) -delete",
"mkdir executorch && find . -mindepth 1 -maxdepth 1 ! -name executorch ! -name BUILD ! -name BUILD.bazel ! -name REPO.bazel -exec cp -a {} executorch/ \\;",
Expand Down
4 changes: 2 additions & 2 deletions docker/MODULE.bazel.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ new_local_repository(
new_git_repository(
name = "executorch",
build_file = "@//third_party/executorch:BUILD",
# executorch==1.6.0.dev20260915
commit = "1b421c43d3ff6495ab52977c1c8ada11568b1314",
# executorch==1.6.0.dev20260923
commit = "7677aa22a4cf0298db9783b37e808e9350c2c59d",
recursive_init_submodules = True,
patch_cmds = [
"find . -mindepth 2 \\( -name BUILD -o -name BUILD.bazel \\) -delete",
Expand Down
2 changes: 1 addition & 1 deletion examples/executorch_reference_runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ torch_tensorrt/bin/example_executorch_runner
```bash
# Get the ExecuTorch source snapshot this package is built against. Keep this in sync
# with the executorch commit pinned in MODULE.bazel.
EXECUTORCH_REF="${EXECUTORCH_REF:-1b421c43d3ff6495ab52977c1c8ada11568b1314}"
EXECUTORCH_REF="${EXECUTORCH_REF:-7677aa22a4cf0298db9783b37e808e9350c2c59d}"
git clone --filter=blob:none --no-checkout \
https://github.com/pytorch/executorch.git executorch
pushd executorch
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ install-test-ext:
# compiled from the commit this version pairs with.
uv pip install pyyaml patchelf \
--extra-index-url https://download.pytorch.org/whl/nightly/cu130 \
"executorch==1.6.0.dev20260915"
"executorch==1.6.0.dev20260923"

# ── Linting ───────────────────────────────────────────────────────────────────

Expand Down
2 changes: 1 addition & 1 deletion py/torch-tensorrt-executorch-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ worse off than when you started.
python -m pip install pyyaml patchelf tensorrt-cu13 \
--extra-index-url "https://download.pytorch.org/whl/nightly/${CU_VERSION}" \
--extra-index-url https://pypi.nvidia.com/ \
"executorch==1.6.0.dev20260915"
"executorch==1.6.0.dev20260923"
export TORCH_TENSORRT_EXECUTORCH_RUNTIME_VERSION="0.2.0.dev0+${CU_VERSION}"
python -m pip wheel --no-build-isolation --no-deps \
--wheel-dir dist py/torch-tensorrt-executorch-runtime
Expand Down
2 changes: 1 addition & 1 deletion py/torch-tensorrt-executorch-runtime/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ requires = [
# environment.
# Builds must use --no-build-isolation; see README.md.
"torch",
"executorch==1.6.0.dev20260915",
"executorch==1.6.0.dev20260923",
]
build-backend = "setuptools.build_meta"
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ cache-keys = [
{ file = "setup.cfg" },
{ file = "dev_dep_versions.yml" },
]
environments = ["sys_platform == 'linux'", "sys_platform == 'win32'"]
environments = [
"sys_platform == 'linux'",
"sys_platform == 'win32' and platform_machine == 'AMD64'",
]
required-environments = [
"sys_platform == 'linux' and python_version >= '3.10' and python_version <= '3.13' and platform_machine == 'x86_64'",
"sys_platform == 'linux' and python_version >= '3.10' and python_version <= '3.13' and platform_machine == 'aarch64'",
Expand All @@ -203,7 +206,6 @@ conflicts = [
]
constraint-dependencies = [
"transformers>=5.14.1",
"executorch==1.6.0.dev20260915",
]

[tool.uv.sources]
Expand Down
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,16 @@ def load_dep_info():
EXECUTORCH_RUNTIME_REQUIREMENT = (
"torch-tensorrt-executorch-runtime; platform_system == 'Linux'"
)
# The companion is the only thing named here. It pins the exact ExecuTorch it was
# compiled against, so naming a range beside it states the version twice, and the
# two statements cannot both hold on the day the pin moves: the range asks for the
# new build while every published companion still asks for the previous one, and a
# resolver has nothing left to choose. Leaving the companion as the single source
# of the version keeps a bump resolvable, and a mismatch is still refused, by the
# companion itself at import rather than by a range here.
EXTRAS_REQUIRE = {
"executorch": [EXECUTORCH_REQUIREMENT, EXECUTORCH_RUNTIME_REQUIREMENT],
"all": [EXECUTORCH_REQUIREMENT, EXECUTORCH_RUNTIME_REQUIREMENT],
"executorch": [EXECUTORCH_RUNTIME_REQUIREMENT],
"all": [EXECUTORCH_RUNTIME_REQUIREMENT],
}

if "--ci" in sys.argv:
Expand Down
9 changes: 4 additions & 5 deletions tests/py/dynamo/executorch/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2415,12 +2415,11 @@ def test_packaging_declares_executorch_extra():
assert extra_name in extras_by_name
requirements = extras_by_name[extra_name]
assert isinstance(requirements, ast.List)
# Both halves, since finding the delegate by hand is what this extra saves.
# The delegate, since finding it by hand is what this extra saves. It carries the
# ExecuTorch version, so a range beside it would state that version twice and the
# two cannot agree on the day the pin moves.
named = [e.id for e in requirements.elts if isinstance(e, ast.Name)]
assert named == [
"EXECUTORCH_REQUIREMENT",
"EXECUTORCH_RUNTIME_REQUIREMENT",
], named
assert named == ["EXECUTORCH_RUNTIME_REQUIREMENT"], named

setup_call = next(
node
Expand Down
121 changes: 61 additions & 60 deletions tests/py/dynamo/executorch/test_executorch_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def _requirement_disagrees(actual: str, expected: str, version: str) -> str:
"docker/MODULE.bazel.docker": 1,
"docker/MODULE.bazel.ngc": 1,
"justfile": 1,
"pyproject.toml": 1,
# Require the fenced install command; prose cannot replace it.
"py/torch-tensorrt-executorch-runtime/README.md": 1,
"py/torch-tensorrt-executorch-runtime/pyproject.toml": 1,
Expand Down Expand Up @@ -519,9 +518,15 @@ def test_derived_requirements_match_the_pin(monkeypatch) -> None:
for element in getattr(value, "elts", [])
if isinstance(element, ast.Name)
]
assert named.count("EXECUTORCH_REQUIREMENT") == 1, (
assert named.count("EXECUTORCH_RUNTIME_REQUIREMENT") == 1, (
f"extra {getattr(key, 'value', key)!r} does not reference "
f"EXECUTORCH_REQUIREMENT exactly once: {named}"
f"EXECUTORCH_RUNTIME_REQUIREMENT exactly once: {named}. The companion "
"carries the ExecuTorch version, so every published extra has to name it."
)
assert "EXECUTORCH_REQUIREMENT" not in named, (
f"extra {getattr(key, 'value', key)!r} states the ExecuTorch version a second "
f"time: {named}. The companion pins the exact build it was compiled against, and "
"a range here cannot agree with it on the day the pin moves."
)

# The doc build reads the pin through shell substitution, outside the literal scan.
Expand Down Expand Up @@ -1204,47 +1209,51 @@ def record(argv, **kwargs):


def _assert_development_lock_matches_pin(lock: dict, version: str) -> None:
from packaging.markers import Marker
from packaging.specifiers import SpecifierSet
from packaging.version import Version
"""The lock must leave the ExecuTorch version to the companion.

refresh = (
"Regenerate uv.lock with PYTHON_ONLY=1 uv lock --refresh --prerelease=allow."
)
constraints = [
It deliberately does not have to match the pin. The companion carries the exact
ExecuTorch it was compiled against, and on the day the pin moves no published
companion carries the new one yet, so requiring the pin here is what stopped the
nightly bump from ever landing. Agreement on the version is enforced by the
resolution itself: the companion asks for one build, so that is the one recorded.
"""
constrained = [
entry
for entry in lock.get("manifest", {}).get("constraints", [])
if entry["name"] == "executorch"
]
assert constraints == [{"name": "executorch", "specifier": f"=={version}"}], refresh
assert constrained == [], (
f"the lock constrains the ExecuTorch version: {constrained}. The companion "
"carries that version, so a constraint here cannot agree with it on a bump day."
)

resolved = [p for p in lock.get("package", []) if p["name"] == "executorch"]
assert resolved and all(
Version(p["version"]).public == version for p in resolved
), refresh
assert resolved, "the lock records no ExecuTorch at all"

companions = [
p
for p in lock.get("package", [])
if p["name"] == "torch-tensorrt-executorch-runtime"
]
assert companions, "the lock records no companion, so nothing carries the version"
assert all(
any(d["name"] == "executorch" for d in c.get("dependencies", []))
for c in companions
), "a companion in the lock does not depend on ExecuTorch"

roots = [p for p in lock["package"] if p["name"] == "torch-tensorrt"]
assert len(roots) == 1, refresh
assert len(roots) == 1, "the lock does not record this project exactly once"
recorded = [
r
for r in roots[0].get("metadata", {}).get("requires-dist", [])
if r["name"] == "executorch"
]
major, minor = _release_line(version)
expected = SpecifierSet(f">={version},<{major}.{int(minor) + 1}")
assert len(recorded) == 2 and all(
SpecifierSet(r["specifier"]) == expected for r in recorded
), refresh
for platform in ("linux", "win32", "darwin"):
for extra in ("all", "executorch", ""):
selected = sum(
Marker(r.get("marker", "")).evaluate(
{"sys_platform": platform, "extra": extra}
)
for r in recorded
)
assert selected == int(platform == "linux" and extra != ""), refresh
assert recorded == [], (
f"the project records an ExecuTorch requirement of its own: {recorded}. The "
"companion is the only place that version belongs."
)


@pytest.mark.unit
def test_the_lockfile_executorch_matches_the_pin():
import tomllib

Expand All @@ -1259,42 +1268,31 @@ def test_the_lockfile_executorch_matches_the_pin():
)
def test_development_lock_guard_rejects_drift(local, mutation):
version = "1.5.0.dev1"
constraint = {"name": "executorch", "specifier": f"=={version}"}
package = {"name": "executorch", "version": version + local}
requirements = [
{
"name": "executorch",
"specifier": f">={version},<1.6",
"marker": f"sys_platform == 'linux' and extra == '{extra}'",
}
for extra in ("all", "executorch")
]
lock = {
"manifest": {"constraints": [constraint]},
"package": [
package,
{
"name": "torch-tensorrt",
"metadata": {
"requires-dist": requirements,
},
},
],
companion = {
"name": "torch-tensorrt-executorch-runtime",
"dependencies": [{"name": "executorch"}],
}
root = {"name": "torch-tensorrt", "metadata": {"requires-dist": []}}
lock = {"manifest": {"constraints": []}, "package": [package, companion, root]}
if mutation == "constraint":
constraint["specifier"] = ">=1.4.1"
lock["manifest"]["constraints"] = [
{"name": "executorch", "specifier": f"=={version}"}
]
elif mutation == "resolved":
package["version"] = "1.4.1"
elif mutation == "missing":
lock["package"].remove(package)
elif mutation == "missing":
lock["package"].remove(companion)
elif mutation == "range":
requirements[0]["specifier"] = ">=1.4.1,<1.5"
root["metadata"]["requires-dist"] = [
{"name": "executorch", "specifier": f">={version},<1.6"}
]
elif mutation == "marker":
requirements[0]["marker"] = "extra == 'all'"
companion["dependencies"] = []
if mutation is None:
_assert_development_lock_matches_pin(lock, version)
else:
with pytest.raises(AssertionError, match="Regenerate uv.lock"):
with pytest.raises(AssertionError):
_assert_development_lock_matches_pin(lock, version)


Expand Down Expand Up @@ -2321,16 +2319,19 @@ def test_update_workflow_requires_manual_downgrade_authority(tmp_path, allow):


@pytest.mark.unit
def test_development_lock_constraint_matches_the_pin():
def test_development_lock_does_not_constrain_executorch():
import tomllib

config = tomllib.loads((REPO_ROOT / "pyproject.toml").read_text())
requirements = [
Requirement(value) for value in config["tool"]["uv"]["constraint-dependencies"]
]
constraints = [r for r in requirements if r.name == "executorch"]
assert len(constraints) == 1
assert str(constraints[0].specifier) == f'=={_versions()["__executorch_version__"]}'
named = [r.name for r in requirements if r.name == "executorch"]
assert named == [], (
f"a constraint names the ExecuTorch version a second time: {named}. The companion "
"carries that version, and a constraint here cannot agree with it on the day the "
"pin moves."
)


@pytest.mark.unit
Expand Down
Loading
Loading