Problem
The TritonShared pybind plugin target in the root CMakeLists.txt includes triton-shared/Dialect/TPtr/IR/TPtrDialect.h (via triton_shared.cc:20), which requires the tablegen-generated TPtrDialect.h.inc. However, the TritonShared target has no CMake dependency on TPtrTableGen or TPtrIR.
This causes a flaky build failure with parallel builds (-j8): sometimes the .cc.o compilation of triton_shared.cc is scheduled before TPtrDialect.h.inc is generated.
Error
FAILED: third_party/triton_shared/CMakeFiles/TritonShared.dir/triton_shared.cc.o
triton-shared/Dialect/TPtr/IR/TPtrDialect.h:20:10: fatal error: 'triton-shared/Dialect/TPtr/IR/TPtrDialect.h.inc' file not found
Dependency chain
triton_shared.cc includes TPtrDialect.h
TPtrDialect.h includes TPtrDialect.h.inc (tablegen-generated)
TPtrDialect.h.inc is generated by the TPtrTableGen target (defined in include/triton-shared/Dialect/TPtr/IR/CMakeLists.txt)
- The
TPtrIR library correctly depends on TPtrTableGen (in lib/Dialect/TPtr/IR/CMakeLists.txt)
- But
TritonShared (the plugin target in root CMakeLists.txt) only links TritonSharedAnalysis and TritonTilingExtIR — neither depends on TPtrTableGen
Suggested fix
Add TPtrIR to the LINK_LIBS of the TritonShared plugin target, or at minimum add TPtrTableGen to its dependencies:
add_triton_plugin(TritonShared ${CMAKE_CURRENT_SOURCE_DIR}/triton_shared.cc
LINK_LIBS TritonSharedAnalysis TritonTilingExtIR TPtrIR ${conversion_libs} ...)
Reproduction
The failure is non-deterministic. It depends on ninja's scheduling of parallel tasks. In our CI (GitHub Actions, ubuntu-latest, -j8), it fails approximately 1 in 5 runs. The same commit passes or fails depending on task ordering.
Observed on commit 1850a7be4e147b8279ff25bbbd26d0dc08e2cb56.
Problem
The
TritonSharedpybind plugin target in the rootCMakeLists.txtincludestriton-shared/Dialect/TPtr/IR/TPtrDialect.h(viatriton_shared.cc:20), which requires the tablegen-generatedTPtrDialect.h.inc. However, theTritonSharedtarget has no CMake dependency onTPtrTableGenorTPtrIR.This causes a flaky build failure with parallel builds (
-j8): sometimes the.cc.ocompilation oftriton_shared.ccis scheduled beforeTPtrDialect.h.incis generated.Error
Dependency chain
triton_shared.ccincludesTPtrDialect.hTPtrDialect.hincludesTPtrDialect.h.inc(tablegen-generated)TPtrDialect.h.incis generated by theTPtrTableGentarget (defined ininclude/triton-shared/Dialect/TPtr/IR/CMakeLists.txt)TPtrIRlibrary correctly depends onTPtrTableGen(inlib/Dialect/TPtr/IR/CMakeLists.txt)TritonShared(the plugin target in rootCMakeLists.txt) only linksTritonSharedAnalysisandTritonTilingExtIR— neither depends onTPtrTableGenSuggested fix
Add
TPtrIRto theLINK_LIBSof theTritonSharedplugin target, or at minimum addTPtrTableGento its dependencies:Reproduction
The failure is non-deterministic. It depends on ninja's scheduling of parallel tasks. In our CI (GitHub Actions, ubuntu-latest,
-j8), it fails approximately 1 in 5 runs. The same commit passes or fails depending on task ordering.Observed on commit
1850a7be4e147b8279ff25bbbd26d0dc08e2cb56.