Skip to content
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

[XPU] Enable reduction optimization by default #2846

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

victor-eds
Copy link
Contributor

Add reduction optimization pass to the pipeline by default.

Add reduction optimization pass to the pipeline by default.
@victor-eds victor-eds self-assigned this Nov 27, 2024
@victor-eds
Copy link
Contributor Author

Performance gains can be seen under vicenableredopt tag.

@chengjunlu I'd say we go with this for now. You can disable it when doing your current work. This is giving performance now and having this would make testing the followups we have in mind easier. WDYT?

@victor-eds victor-eds marked this pull request as ready for review November 27, 2024 16:35
@victor-eds
Copy link
Contributor Author

Looks like the wide vector flag is giving some better performance, but this is noticeable enough. Just a minor bump from that flag.

@victor-eds
Copy link
Contributor Author

#2748

@victor-eds victor-eds linked an issue Nov 28, 2024 that may be closed by this pull request
@chengjunlu
Copy link
Contributor

Performance gains can be seen under vicenableredopt tag.

@chengjunlu I'd say we go with this for now. You can disable it when doing your current work. This is giving performance now and having this would make testing the followups we have in mind easier. WDYT?

LGTM.

if os.getenv("TRITON_INTEL_OPTIMIZE_REDUCTION_LOCALITY", "0") == "1":
intel.passes.ttgpuir.add_optimize_reduction_locality(pm)
intel.passes.ttgpuir.add_optimize_elementwise_parallelism(pm)
intel.passes.ttgpuir.add_optimize_reduction_locality(pm)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use if os.getenv("TRITON_INTEL_OPTIMIZE_REDUCTION_LOCALITY", "1") == "1": to allow the user to disable it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course. I'll add that when I finish the investigation

@whitneywhtsang
Copy link
Contributor

From https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/12061551469, it appears that the reduction optimization has a negative geomean impact to FA (causal=false, dhead=64) with the new IGC driver (improved instruction scheduling). Can we investigate it further before enabling it by default?

@victor-eds
Copy link
Contributor Author

From https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/12061551469, it appears that the reduction optimization has a negative geomean impact to FA (causal=false, dhead=64) with the new IGC driver (improved instruction scheduling). Can we investigate it further before enabling it by default?

Yes! I can look into that.

@victor-eds victor-eds marked this pull request as draft November 28, 2024 09:22
@victor-eds
Copy link
Contributor Author

Waiting till regressions are fixed. #2907 is the best attempt we have currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable -tritonintelgpu-optimize-reduction-locality by default
3 participants