Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ jobs:
TRITON_INSTALL_DIR="${{ steps.build-triton.outputs.triton_install_dir }}"
EXTRA_CMAKE_ARGS="-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"

- name: Smoke test plugin import
# `make test` only runs lit/FileCheck tests, which exercise MLIR passes
# but never load the plugin into Python. Regressions in the plugin's
# static init (e.g. PluginInfo fields read by libtriton's loader) slip
# through unless we actually `import triton` with TRITON_PLUGIN_PATHS
# pointing at the freshly-built libutlx.so.
env:
TRITON_PLUGIN_PATHS: ${{ github.workspace }}/build/lib/libutlx.so
run: |
test -f "$TRITON_PLUGIN_PATHS" || { echo "libutlx.so missing at $TRITON_PLUGIN_PATHS"; exit 1; }
python3 -c "import triton; print('triton', triton.__version__, 'loaded with utlx plugin from', '$TRITON_PLUGIN_PATHS')"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a decent test: "does the plugin load?" But this would be more valuable as an integration test (e.g., using pytest) that loads every plugin registered in this repository to make sure each plugin can be loaded. Then whatever command is necessary to run the test could be added to make test.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and I guess from the CI failure that we don't really have a virtual environment set up with Triton installed, so that might be needed as well.


- name: Run tests
run: >
make test LLVM_INSTALL_DIR="${{ steps.build-llvm.outputs.llvm_install_dir }}"
Expand Down
6 changes: 6 additions & 0 deletions extensions/utlx/uTLXPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
#include "triton/Dialect/TritonNvidiaGPU/IR/Dialect.h"
#include "triton/Tools/PluginUtils.h"
#include "triton/Version.h"

// TLX dialect headers
#include "tlx/dialect/include/IR/Dialect.h"
Expand Down Expand Up @@ -803,6 +804,11 @@ TRITON_PLUGIN_API plugin::PluginInfo *tritonGetPluginInfo() {
1, // numDialects
ops,
48, // numOps
// Triton commit `8497c845a` (#9937) added `isTritonAndPluginsVersionsMatch`
// which dereferences `info->tritonVersion` unconditionally — leaving this
// field nullptr crashes libtriton's import with `basic_string::_M_construct
// null not valid` before any Python-side workaround can run.
TRITON_VERSION,
Comment thread
wychi marked this conversation as resolved.
};
return &info;
}
Loading