This reduces CUDA cpp_wrapper cold compile time by avoiding CPU vec-ISA setup when the generated wrapper does not need CPU vectorized helpers.
Most CUDA cpp_wrapper code is host-side glue: CUDA/Triton launches, stream handling, allocation, fallback calls, and pybinding glue. It runs on the CPU, but it usually does not contain generated CPU vectorized kernels. Before this PR, the wrapper build path could still call pick_vec_isa(), which triggers CPU ISA dry-compiles and makes otherwise device-only wrapper artifacts more machine-specific than necessary.
This change threads explicit vec-ISA requirements through CppWrapperCodeCache:
- device-only CUDA wrappers use
invalid_vec_isa - wrappers with generated host vectorized code still request a real CPU vec ISA
cpp_wrapper_build_separate=Truecan keep the main wrapper TU portable while the separate generated CPU-kernel TU independently requests vec ISA
Cold compile-time benchmarks for cpp_wrapper=True:
| Workload | No cpp_wrapper | cpp_wrapper before | Gap before | cpp_wrapper after | Gap after | cpp_wrapper speedup |
|---|---|---|---|---|---|---|
| Simple pointwise (Triton only) | 2.276s | 12.444s | +10.168s | 4.199s | +1.923s | 2.96x |
| Matmul + pointwise (ATen + Triton) | 2.299s | 12.225s | +9.926s | 4.198s | +1.899s | 2.91x |
The gap to no-cpp-wrapper drops from about 10s to about 1.9s on both a Triton-only graph and a mixed ATen + Triton graph.
Test coverage added:
- CUDA device-only wrapper skips vec ISA
- CUDA wrapper with host vectorized code still keeps vec ISA
- separate-build cpp_wrapper splits main-wrapper and generated-kernel vec-ISA requirements
Test plan:
python test/inductor/test_gpu_cpp_wrapper.py TestGpuWrapper.test_cuda_cpp_wrapper_skips_vec_isa_for_device_only_code TestGpuWrapper.test_cuda_cpp_wrapper_keeps_vec_isa_for_host_vectorized_code TestGpuWrapper.test_cuda_cpp_wrapper_build_separate_splits_vec_isa_requirements
Used GPT-5.5
Pull Request resolved:
Community-Analysen & Experten-Meinungen 0
Verwandte Story-Cluster & Quellen (Vektor-KI)
Ähnliche Beiträge
Auch interessante Nachrichten trunk/a92ae7c56a19fab03e34bf940440ce489e624cab: [Inductor] Skip CPU vec ISA setup for device-only cpp_wrapper (#182089)
Thematisch verwandte Begriffe: trunka92ae7c56a19fab03e34bf940440ce489e624cab, Inductor, Skip, setup · 6 Treffer
ICEDID Configuration Extractor
Self-hosted Coder: check whether you pulled a registry module on Aug 31. no CVE, so nothing will flag it for you
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
SOCIAL SHARE CARD GENERATOR