-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[AMD] Option to use custom scheduler in LLVM backend #8326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AMD] Option to use custom scheduler in LLVM backend #8326
Conversation
de08064 to
cfe234b
Compare
This PR: - generalize flags in translate_to_asm function, so now it accepts bool and string flags - introduces new case to HIPOptions.schedule_hint which enables iterative-ilp scheduler
c259e3e to
7c78175
Compare
| for hint in options.schedule_hint.split(","): | ||
| if hint == 'attention': | ||
| flags.append(('sink-insts-to-avoid-spills', True)) | ||
| if hint == 'memory-bound-attention': | ||
| flags.append(('amdgpu-sched-strategy', 'iterative-ilp')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having llvm dynamic llvm flags will cause multi-threading problems and is going to be a serious problem in real life scenario.
I think we need a different solution here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point; missed that part. Sorry about it. Yeah we can revert this and find a better way--maybe like using some attributes attached to llvm module or something. BTW, the whole schedule hint was meant to be experiemental--more a way to help making trying different LLVM features easier in workloads so we can better work them into LLVM properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, it's probably fine as experimental but we have to be a bit careful as it breaks in a very subtle way. (usually cause non deterministic cache to be generated)
Attributes would be much better if it is possible
Reverts #8326 given changing flags makes multi-threading difficult.
This is thread safe implementation of #8326. This PR changed to use function attributes instead of global flags. It also deletes other existing global flag usage along the way.
…on-lang#8326) This PR: - generalize flags in translate_to_asm function, so now it accepts bool and string flags - introduces new case to HIPOptions.schedule_hint which enables iterative-ilp scheduler --------- Co-authored-by: Alexander Efimov <efimov.alexander@gmail.com>
…-lang#8685) Reverts triton-lang#8326 given changing flags makes multi-threading difficult.
This is thread safe implementation of triton-lang#8326. This PR changed to use function attributes instead of global flags. It also deletes other existing global flag usage along the way.
This PR: