Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/196757
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8166326 with merge base 335414f ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Sep 11, 2026
ngimel
approved these changes
Sep 11, 2026
Collaborator
|
Starting merge as part of PR stack under #190899 |
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 14, 2026
…e2e tests (#190899) Human Notes: Finally do a thing! Add `topk` as an AOT-provided override in libtorch_cuda. Claude: Declares a 48-point grid (fp32/bf16 x N{2048..16384} x K{64,128,256} x both determinism modes) over the radix-select kernel. The det specialization (stable prefix-sum gather + lex (ord, -idx) sort) is bit-exact vs aten including tie resolution, so det-mode calls are served AOT too; the dispatch chain keys on deterministicAlgorithms(). The kernel gains in_dtype and index_dtype compile parameters; the AOT route writes int64 indices directly (no widening copy). build(spec) lives beside the JIT wrappers, so both routes compile the same class. fp16 and off-grid shapes keep their JIT eligibility, as do calls the prelude declines: a non-last dim, largest/sorted false, sub-full-wave M, or a base pointer less aligned than the kernels were compiled for. ARCHS is stated rather than defaulted, and covers Hopper as well as Blackwell: measured on an H100, the AOT kernels beat aten on 48/48 of the grid, median 2.16x (min 1.26x at M=4096/N=2048, max 2.99x at M=256/N=4096 fp32). Both spellings of each capability are listed -- archs_from_cuda_arch_list maps 9.0 and 9.0a to different nvcc targets, and a wheel built with the plain list would otherwise export trees generation then filters out. CI: a native_aot test config (test.sh) asserts the wheel actually embeds the kernels -- a silently artifact-free wheel would make every routing test vacuously pass on the JIT/aten fallbacks -- then runs the python_native suites. One build+test pair per capability in native-aot.yml: cuda-arch-list 9.0a tested on linux.aws.h100 and 10.0a on linux.dgx.b200, both built on a GPU-less builder (path-triggered + nightly). test_uncovered_fp32_served_by_jit_layer skips below sm_100, since the JIT topk override is gated there while these AOT kernels are not. This lands with the first op so the AOT path is exercised in CI from this commit onward. covered_axes() and cpp_covers() decline a dim other than the last, largest=False and sorted=False, matching the stub's gates. Coverage wider than the stub is not wrong -- the stub declines and stock aten serves -- but it costs those calls their JIT route, since coverage subtracts them from it (review: #190899). Authored with an AI assistant (Claude Code). Test Plan: ``` .venv/bin/python test/python_native/test_native_aot.py # incl. det-mode routing + bit-exact-with-ties tests # (test_deterministic_mode_routes_to_aot_bit_exact, # test_deterministic_ties_bit_exact) .venv/bin/python test/python_native/test_topk_radix_kernel.py .venv/bin/python test/python_native/test_topk_cutedsl.py ``` On an H100, against the kernels a `spin develop` embedded: ``` .venv/bin/python test/python_native/test_native_aot.py # 11 tests, 1 skipped .venv/bin/python test/python_native/test_aot_manifest.py # 18 tests .venv/bin/python test/python_native/test_registry.py # 35 tests ``` Pull Request resolved: #190899 Approved by: https://github.com/MatthiasKohl, https://github.com/ngimel ghstack dependencies: #196747, #196757
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Human Notes:
Necessary to make 3.10 builds not fail CI when AOT ops come in.
Note: We could change schema behavior to be consistent across 3.10 onwards, but
that feels like a much bigger risk than this..
Codex:
Installing CuTeDSL on Python 3.10 made the vendored QuACK import tests execute
there for the first time. QuACK's custom-op signatures use IntEnum defaults,
whose symbolic Python 3.10 string form produces invalid inferred dispatcher
schemas before any test body can run.
This is independent of native-AOT and its Python 3.10 support. Skip only the
QuACK import and operator-registration tests below Python 3.11; the patch-series
and vendoring reproducibility tests remain enabled. Normalizing IntEnum defaults
in torch.library would also make these imports work, but would change core
Python 3.10 behavior for an unrelated compatibility check.
Authored with assistance from an AI coding assistant.
Test Plan: