ROCm / triton

Development repository for the Triton language and compiler
MIT License
80 stars 22 forks source link

Add llvm flag #547

Open zhanglx13 opened 3 months ago

zhanglx13 commented 3 months ago

This PR allows us to set llvm backend flags, e.g. -mllvm --print-after-all, using an env var TRITON_LLVM_FLAG.

Example usage:

export TRITON_LLVM_FLAG=---amdgpu-enable-max-ilp-scheduling-strategy=1
python perf-kernels/06-fused-attention-fwd-transV.py

Don't forget to unset the flag if you don't need it anymore by export TRITON_LLVM_FLAG=

scxiao commented 2 months ago

Can we rename as TRITON_LLVM_FLAG? basically, I think it would be better env var for triton have prefix TRITON_.

scxiao commented 2 months ago

Can we rename as TRITON_LLVM_FLAG? basically, I think it would be better env var for triton have prefix TRITON_.

Thanks. Another question, can we use multiple flags together? if true, what is the format for that?

zhanglx13 commented 2 months ago

Can we rename as TRITON_LLVM_FLAG? basically, I think it would be better env var for triton have prefix TRITON_.

Thanks. Another question, can we use multiple flags together? if true, what is the format for that?

I think so, the value processed as a string. You can do something like TRITON_LLVM_FLAG="--flag1 --flag2"