pytorch / pytorch/pytorch

Pytorch needs Kineto even when using USE_KINETO=OFF

Open
#178,939 1 comment 0 reactions 1 assignee Claimed by @malfet View on GitHub
bot-mislabeled bot-triaged module: build module: regression triaged
Dominant language
Python
Stars
103k
Forks
29.7k
PR merge metrics
PR metrics pending

Description

### 🐛 Describe the bug

Pytorch 2.10 and 2.11

I'm at Gentoo, so it prefers system libraries instead of bundled ones (kineto is removed from third_party to prioritize the local library)

Said that, I'm working on an optional Kineto feature for anyone who doesn't need it.

Please see this compilation error:

```
FAILED: [code=1] caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/autograd/profiler_kineto.cpp.o
/usr/lib/llvm/22/bin/clang++ -DAT_PER_OPERATOR_HEADERS -DCAFFE2_BUILD_MAIN_LIB -DGFLAGS_IS_A_DLL=0 -DGLOG_CUSTOM_PREFIX_SUPPORT -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_POSIX_FALLOCATE=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx -DPROTOBUF_USE_DLLS -DROCM_VERSION=70200 -DTORCH_HIP_VERSION=702 -DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DUSE_LAYERNORM_FAST_RECIPROCAL -DUSE_ROCM -DUSE_RPC -D_FILE_OFFSET_BITS=64 -D__HIP_PLATFORM_AMD__ -Dtorch_cpu_EXPORTS -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0_build/aten/src -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/aten/src -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0_build -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0 -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/moodycamel -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/torch/csrc/api -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/torch/csrc/api/include -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/caffe2/aten/src/TH -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0_build/caffe2/aten/src/TH -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0_build/caffe2/aten/src -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0_build/caffe2/../aten/src -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/torch/csrc -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/torch/headeronly -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/third_party/miniz-3.0.2 -I/usr/include/kineto -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/aten/src/ATen/.. -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/c10/.. -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/aten/src/ATen/native/quantized/cpu/qnnpack/include -I/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/aten/src/ATen/native/quantized/cpu/qnnpack/src -isystem /usr/include/eigen3 -isystem /usr/include/rocblas -isystem /tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/INTERFACE -isystem /tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/third_party/concurrentqueue -isystem /tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/caffe2 -O2 -pipe -glldb -Wno-deprecated-declarations -Wno-unused-result -Wno-unused-value -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DUSE_FBGEMM -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -DC10_NODEPRECATED -Wall -Wextra -Werror=non-virtual-dtor -Werror=braced-scalar-init -Werror=range-loop-construct -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-unused-parameter -Wno-strict-overflow -Wno-strict-aliasing -Wvla-extension -Wsuggest-override -Wnewline-eof -Winconsistent-missing-override -Winconsistent-missing-destructor-override -Wno-pass-failed -Wno-error=old-style-cast -Wconstant-conversion -Qunused-arguments -faligned-new -fno-math-errno -fno-trapping-math -Werror=format -DHAVE_AVX512_CPU_DEFINITION -DHAVE_AVX2_CPU_DEFINITION -fPIC -fcolor-diagnostics -Wall -Wextra -Wdeprecated -Wunused -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds -Wno-unknown-pragmas -Wno-strict-overflow -Wno-strict-aliasing -Wmove -fvisibility=hidden -Wmissing-prototypes -Werror=missing-prototypes -fopenmp=libomp -MD -MT caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/autograd/profiler_kineto.cpp.o -MF caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/autograd/profiler_kineto.cpp.o.d -o caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/autograd/profiler_kineto.cpp.o -c /tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/torch/csrc/autograd/profiler_kineto.cpp
In file included from /tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/torch/csrc/autograd/profiler_kineto.cpp:12:
In file included from /tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/torch/csrc/profiler/collection.h:20:
/tmp/portage/sci-ml/caffe2-2.11.0-r1/work/pytorch-2.11.0/torch/csrc/profiler/kineto_shim.h:15:10: fatal error: 'ActivityType.h' file not found
15 | #include
| ^~~~~~~~~~~~~~~~
1 error generated.
```

CMakeFile flags:

```
-- USE_ROCM_CK_SDPA : OFF
-- USE_ROCM_CK_GEMM : ON
-- USE_LAYERNORM_FAST_RECIPROCAL : ON
-- BUILD_NVFUSER :
-- USE_EIGEN_FOR_BLAS :
-- USE_EIGEN_FOR_SPARSE : OFF
-- USE_FBGEMM : ON
-- USE_MSLK : OFF
-- USE_KINETO : no
-- USE_GFLAGS : ON
-- USE_GLOG : ON
-- USE_LITE_PROTO : OFF
-- USE_PYTORCH_METAL : OFF
-- USE_PYTORCH_METAL_EXPORT : OFF
-- USE_MPS : OFF
-- CAN_COMPILE_METAL :
-- USE_MKL :
-- USE_MKLDNN : no
-- USE_PRIORITIZED_TEXT_FOR_LD : OFF
-- USE_UCC : OFF
-- USE_ITT : OFF
-- USE_XCCL : OFF
-- USE_NCCL : no
-- Found NVSHMEM :
-- USE_NNPACK : no
-- USE_NUMPY : ON
-- USE_OBSERVERS : ON
-- USE_OPENCL : no
-- USE_OPENMP : yes
-- USE_MIMALLOC : no
-- USE_VULKAN : OFF
-- USE_PROF : OFF
-- USE_PYTORCH_QNNPACK : yes
-- USE_XNNPACK : yes
-- USE_DISTRIBUTED : yes
-- USE_MPI : no
-- USE_GLOO : no
-- USE_GLOO_WITH_OPENSSL : OFF
-- USE_GLOO_IBVERBS : OFF
-- USE_TENSORPIPE : no
-- Public Dependencies :
-- Private Dependencies : Threads::Threads;pthreadpool;cpuinfo;pytorch_qnnpack;XNNPACK;microkernels-prod;fbgemm;fp16;caffe2::openmp;onnx_proto;onnx;rt;fmt;dl
-- Public CUDA Deps. :
-- Private CUDA Deps. :
-- USE_COREML_DELEGATE : OFF
-- BUILD_LAZY_TS_BACKEND : ON
-- USE_ROCM_KERNEL_ASSERT : OFF
```

I do understand it fails looking for Kineto's ActivityType.h, but this shouldn't happen if I'm disabling Kineto, am I wrong?

### Versions

Collecting environment information...
PyTorch version: 2.10.0a0
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 7.2.53210

OS: linux (x86_64)
GCC version: (Gentoo 15.2.1_p20260214 p5) 15.2.1 20260214
Clang version: 22.1.2+libcxx
CMake version: version 4.3.1
Libc version: glibc-2.43

Python version: 3.13.12 (main, Feb 6 2026, 12:19:12) [Clang 21.1.8+libcxx ] (64-bit runtime)
Python platform: Linux-6.19.9-dist-x86_64-AMD_RYZEN_AI_MAX+_395_w-_Radeon_8060S-with-glibc2.43
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to:
GPU models and configuration: Radeon 8060S Graphics (gfx1151)
Nvidia driver version: Could not collect
cuDNN version: Could not collect
Is XPU available: False
HIP runtime version: 7.2.53210
MIOpen runtime version: 3.5.1
Is XNNPACK available: True
Caching allocator config: N/A

CPU:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Vendor ID: AuthenticAMD
Model name: AMD RYZEN AI MAX+ 395 w/ Radeon 8060S
CPU family: 26
Model: 112
Thread(s) per core: 2
Core(s) per socket: 16
Socket(s): 1
Stepping: 0
Frequency boost: enabled
CPU(s) scaling MHz: 41%
CPU max MHz: 5187.5000
CPU min MHz: 625.0000
BogoMIPS: 5990.82
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpuid_fault cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk avx_vnni avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid bus_lock_detect movdiri movdir64b overflow_recov succor smca fsrm avx512_vp2intersect flush_l1d amd_lbr_pmc_freeze
Virtualization: AMD-V
L1d cache: 768 KiB (16 instances)
L1i cache: 512 KiB (16 instances)
L2 cache: 16 MiB (16 instances)
L3 cache: 64 MiB (2 instances)
NUMA node(s): 1
NUMA node0 CPU(s): 0-31
Vulnerability Gather data sampling: Not affected
Vulnerability Ghostwrite: Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Mmio stale data: Not affected
Vulnerability Old microcode: Not affected
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed: Not affected
Vulnerability Spec rstack overflow: Mitigation; IBPB on VMEXIT only
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; STIBP always-on; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds: Not affected
Vulnerability Tsa: Not affected
Vulnerability Tsx async abort: Not affected
Vulnerability Vmscape: Mitigation; IBPB on VMEXIT

Versions of relevant libraries:
[pip3] mypy==1.19.1
[pip3] mypy_extensions==1.1.0
[pip3] numpy==2.4.4
[pip3] onnx==1.20.1
[pip3] torch==2.10.0
[pip3] torchaudio==2.10.0
[pip3] torchvision==0.25.0
[pip3] triton==3.6.0
[conda] Could not collect

cc @malfet @seemethere @robieta @chaekit @guotuofeng @guyang3532 @dzhulgakov @davidberard98 @briancoutinho @sraikund16 @sanrise @mwootton @divyanshk @jiannanWang @scotts @ryanzhang22

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.