ROCm / aotriton

Ahead of Time (AOT) Triton Math Library
MIT License
42 stars 15 forks source link

Add cmake option AOTRITON_NAME_SUFFIX to resolve name conflicts #42

Closed xinyazhang closed 2 months ago

xinyazhang commented 2 months ago

This adds suffix to namespace aotriton and the library file prefix libaotriton. For example, build with -DAOTRITON_NAME_SUFFIX=123 will generate the library with namespace aotrition123 and libaotriton123_v2.so.

This is to address potential name conflicts with PyTorch since PyTorch will bundle AOTriton shared library starting 2.4+

jithunnair-amd commented 2 months ago

Build was successful and produced following outputs:

#ls -lart /usr//lib/aotriton/lib/
total 274288
-rw-r--r-- 1 root root 280861184 Sep 27 20:40 libaotritonmy_suffix_v2.so

#grep suffix /usr//lib/aotriton/include/aotriton/ -r
/usr//lib/aotriton/include/aotriton/config.h:#define AOTRITON_NAME_SUFFIX my_suffix
/usr//lib/aotriton/include/aotriton/config.h:#define AOTRITON_NS aotritonmy_suffix