Skip to content

TritonShared plugin missing dependency on TPtrTableGen #19

Description

@erwei-xilinx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions