Open6
Triton で遊びたい

PyTorch から呼ばれている部分を辿って行った方がよいのか、普通にリポジトリを見ながらビルド&テスト走らせてみた方が良いのかすらわからない。

とりあえず README 通りにやる
python -m venv env
source env/bin/activate
pip install scipy numpy torch pytest lit && pip install -e python
python -m pytest python/test/unit

ビルド中にリンクエラーが出てしまった。
....
ld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()
>>> referenced by basic_string.h:671 (/usr/include/c++/10/bits/basic_string.h:671)
>>> AccelerateMatmul.cpp.o:(_GLOBAL__sub_I_AccelerateMatmul.cpp) in archive lib/Dialect/TritonGPU/Transforms/libTritonGPUTransforms.a
>>> referenced by basic_string.h:671 (/usr/include/c++/10/bits/basic_string.h:671)
>>> Utility.cpp.o:(_GLOBAL__sub_I_Utility.cpp) in archive lib/Analysis/libTritonAnalysis.a
>>> referenced by basic_string.h:671 (/usr/include/c++/10/bits/basic_string.h:671)
>>> Pipeline.cpp.o:(_GLOBAL__sub_I_Pipeline.cpp) in archive lib/Dialect/TritonGPU/Transforms/libTritonGPUTransforms.a
>>> referenced 131 more times
....
LLVM/MLIR は手元でビルドして使った方が良いかしら

これでリンクエラーは消えた
export TRITON_BUILD_WITH_CLANG_LLD=true
export TRITON_BUILD_WITH_CCACHE=true

さて、どうやって遊べばいいか