Repository navigation
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Findings (6): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/203390
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 82415eb with merge base 2299a47 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
2b7252e to
7118f09
Compare
7118f09 to
a96b79d
Compare
Every Linux test job installs the wheel the build job produced, so no test has ever run against the redirect-mode editable layout, where the Python sources come from the checkout and the CMake artifacts from an install tree beside the distribution. That is how the __file__-derived lookups tracked in pytorch#195887 went unnoticed: each one resolves correctly in a wheel install and wrongly in an editable one. This adds an `editable` config to the linux-jammy-py3.11-gcc11 matrix. The test job uninstalls the wheel, runs `pip install -e . --no-build-isolation` in the same container, asserts that the Python sources come from the checkout and torch._C from the install tree, and runs the suites that resolve installed files: the resolution helpers (test_utils, test_testing), cpp_extension (the two cpp_extensions suites), package data (test_serialization) and the public-API import sweep (test_public_bindings). test_fx and test_license are in the list for pytorch#195891, see below. Target determination is off for the config, as for test_dynamo_cpython: the list is the point, and the whole of it runs in a few minutes. The rebuild in the test job follows the backwards_compat precedent, including the submodule checkout the test job skips. It sets WERROR=1 as build.sh does, so that the compile commands match and the rebuild can reuse the sccache the build job filled, and prints the sccache statistics afterwards. The list was verified against an editable install of a fresh clone (Python 3.12, scikit-build-core 1.1.2, CPU): all of it passes. Two gaps it does not yet close are left for pytorch#195891: find_library_location only finds the test libraries through its build/lib fallback, which exists because the editable build runs in-tree, and test_license's distinfo test skips itself because it globs the dist-info next to torch.__file__, i.e. the checkout. test_fx (torchbind) and test_license stay in the list so that they start testing the layout once that issue is fixed. Test Plan: Local, against the editable install of the fresh clone on a shared Linux box: ``` python -m pip install --no-build-isolation -v -e . for t in test_utils test_license test_type_hints test_testing test_public_bindings \ test_cpp_extensions_jit test_cpp_extensions_aot_ninja test_fx test_serialization \ test_import_stats; do python test/run_test.py --include "$t" --verbose; done spin lint ``` The list in the job is shorter than the one run locally. pytorch#203621 removed test_jit, which had supplied `-k TestBackends`. test_type_hints and test_import_stats were dropped after review: the only test of the former is skipped on Linux, and the latter asserts nothing. test_testing and test_public_bindings failed locally for environment reasons only (pytest 9 instead of the pinned 7.3, missing tabulate, onnxscript and tensorboard); the CI image has the pinned versions. The job itself is exercised by this PR's own CI run. Fixes pytorch#195888 Drafted with an AI assistant; reviewed by the author. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
a96b79d to
82415eb
Compare
There was a problem hiding this comment.
Automated review of 82415eb: nothing blocking; ready for human review.
The PR adds an editable config to the linux-jammy-py3.11-gcc11 matrix in pull.yml. Its test_editable function in test.sh rebuilds torch as a redirect-mode pip install -e ., checks that the import layout really is editable, and runs eight suites that depend on install paths. Recommendation: Approve. The earlier blocking sccache finding is fixed, and the review labels every remaining point non-blocking.
⚪ 6 non-blocking findings
Line 462 in 82415eb
Non-blocking: sccache --show-stats || true hides the very misconfiguration the stats are there to reveal. print_sccache_stats (common_utils.sh:421-443, used at build.sh:506) fails loudly when SCCACHE_BUCKET is set but sccache is missing, and linux-test.yml:303 sets the bucket in this job. Printing right after the rebuild is still the right place to do it, because the EXIT epilogue also counts the test_cpp_extensions* compiles and can't isolate the rebuild's hit rate. Fix: call print_sccache_stats there, or drop || true.
Line 474 in 82415eb
Non-blocking: test_serialization can't catch an editable-layout regression, so "package data" in the comment overstates what it tests. Its only lookups based on __file__ (test/test_serialization.py:989,1004) use get_file_path_2, a plain os.path.join, to read torch/testing/_internal/data/network{1,2}.py, which are identical in the checkout and in the wheel. Nothing else in the suite depends on the install layout, and the default shards already run it. Fix: drop it, or narrow it with -k to the container tests and correct the comment.
Line 467 in 82415eb
Non-blocking: the comment admits that test_fx and test_license add no layout coverage until # 195891 is fixed, yet the job still runs all of test_fx with NO_TD=1. In CI the build/lib fallback is also filled by the downloaded build artifact (_linux-build.yml:253 zips build/lib), so libtorchbind_test.so resolves even if the editable build never produced it. test_distinfo_license is a skipIf that won't start running on its own once the issue is fixed; that fix has to edit test_license.py:34-35 anyway. Suggestion: add these two suites in the PR that fixes # 195891, or narrow test_fx to the torchbind cases with -k.
pytorch/.github/workflows/pull.yml
Line 100 in 82415eb
Non-blocking, carried over (REVIEW.md advisory): a new config with no run history now gates every PR. It rebuilds PyTorch, fetches all submodules and runs whole suites with NO_TD=1, and the build and test wall times from a green run that the last review asked for have not been posted yet. It also rebuilds every night: on the 29 8 * * * schedule, filter_test_configs.py:691-694 turns editable into a rerun_disabled_tests run (_linux-test.yml:307). test_editable never checks PYTORCH_TEST_RERUN_DISABLED_TESTS, and in that mode run_test.py:2772-2774 never exits 1, so that nightly run can only catch a broken build or a failed layout check. backwards_compat sets a precedent, and @ atalman approved the placement. Optional fix: return early when PYTORCH_TEST_RERUN_DISABLED_TESTS=1, or stage the job in unstable.yml first.
Line 456 in 82415eb
Non-blocking: the comment "WERROR=1 matches build.sh" still leaves out the numpy difference. build.sh:320-323 installs numpy==2.0.2 before building on py3.11, but the test image pins numpy==1.26.4 (requirements-ci.txt:152). So the torch_python translation units that use the numpy headers miss the cache, and the editable torch is built against numpy 1.x, unlike the wheel the other configs test. Building against the numpy the tests use is defensible; one clause in the comment saying so would do.
Line 451 in 82415eb
Non-blocking: the PR description no longer matches the code. It still lists test_type_hints and test_import_stats, and "Everything listed passes there" refers to that older, longer list. It says the job prints torch.__path__, but the job now prints torch._C.__file__ and fails unless the install is editable. It still says the sccache "makes it cheap" and doesn't mention WERROR=1.
This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review
Withdrawn: the automated review of 82415eb found nothing blocking.
|
Wall times from the green run on 82415eb, as asked for in the automated review. With Numbers (collected from the job logs with an AI assistant)
The layout check passes: The remaining non-blocking points ( |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Linked issue or supporting maintainer
Fixes #195888
Supported by @atalman
BC-breaking?
No
Summary (human written only)
Editable installs (pip install -e) are a crucial tool for developers locally. However, up to now we are not exercising it in the CI at all. This PR adds an editable install to the test matrix along with selected tests that are likely to be affected by subtle differences in install layout between editable and non-editable installs.
Agent details (if applicable)
Adds an
editableconfig to thelinux-jammy-py3.11-gcc11test matrix inpull.yml, one shard on the 8-vCPU runner, and atest_editablefunction in.ci/pytorch/test.sh. The function uninstalls the wheel the test workflow just installed, runsWERROR=1 pip install --no-build-isolation --no-deps -v -e .in the test container (same shape asbackwards_compat, which also builds from source in its test job;WERROR=1matches the build job so that the rebuild can reuse the sccache it filled, and the sccache statistics are printed afterwards), asserts fromtest/thattorch.__file__is in the checkout andtorch._Cin the install tree underbuild/install/, and runs the suites that resolve installed files:test_utils,test_license,test_testing,test_public_bindings,test_cpp_extensions_jit,test_cpp_extensions_aot_ninja,test_fx, andtest_serialization. The list first also hadtest_jit -k TestBackends(#203621 has since removedtest_jit),test_type_hints(its only test is skipped on Linux) andtest_import_stats(asserts nothing); all three are dropped.The test job checks out without submodules, so the function runs the same submodule update
backwards_compatdoes before its source build; and target determination is off for the config (NO_TD=1, astest_dynamo_cpythondoes), because the list is the point of the job and TD trimmed it to a quarter on the first green run.The list was chosen by running candidates against an editable install of a fresh clone (Python 3.12, scikit-build-core 1.1.2, CPU-only). Everything listed passes there;
test_testingandtest_public_bindingsfailed locally only for environment reasons (pytest 9 instead of the pinned 7.3.2 changes the junit outcome counts; tabulate, onnxscript and tensorboard were not installed) and are expected to pass in the CI image.Two layout gaps the job does not close yet, left for #195891:
find_library_locationfindslibtorchbind_test.soonly through itsbuild/libfallback, which exists because the editable build runs in-tree; andtest_license.test_distinfo_licenseskips itself under an editable install because it globstorch-*dist-infonext totorch.__file__, which is the checkout under redirect mode.test_fxandtest_licensestay in the list so that they start testing the layout once that issue is fixed.The config name
editablecontains none of the substrings the dispatch chain intest.shmatches before the exact names (*backward*,*inductor*,*cpu*, ...). The function ends withassert_git_not_dirty; the editable build writes only gitignored paths (build/, generated.pyi,torch/version.py).🤖 Generated with Claude Code