Repository navigation
[xegpu] Remove reduction_schedule #313
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
Changes from all commits
3586331
6b6cf23
3299cd5
6605f05
87174e8
149a534
a91107d
c411f90
115e195
87cb600
38f45e4
5a993f1
4356461
f440a9d
f034601
917e42b
3face47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ | |
| from lighthouse.ingress.mlir_gen import get_mlir_elem_type | ||
| from lighthouse.ingress.mlir_gen.gpu_softmax_payload import generate_gpu_softmax_payload | ||
| from lighthouse.schedule.parameters import ScheduleParameters | ||
| from lighthouse.schedule.xegpu import reduction_schedule, xegpu_to_binary | ||
| from lighthouse.schedule import xegpu | ||
|
|
||
|
|
||
| def softmax_complexity(M: int, N: int, nbytes: int): | ||
|
|
@@ -138,20 +138,13 @@ def schedule_modules( | |
| """Generate transform schedule for softmax.""" | ||
| schedules = [] | ||
| schedules.append(Runner.get_bench_wrapper_schedule(self.payload_function_name)) | ||
|
|
||
| schedules.append( | ||
| reduction_schedule( | ||
| payload_func_name=self.payload_function_name, | ||
| schedules.extend( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. out of curiosity, how do we fully automate things like layout decisions number of prefetches etc?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good question. I'm hoping we can implement heuristics for setting valid prefetch tile size configs (e.g., if we know the shape of the tile to be fetched and have (constraints for) thread layout, it's doable). This already exists for gemm kernels. But to get best performance I think we'll have run autotuner (also already exists for gemms). |
||
| xegpu.get_xegpu_pipeline( | ||
| parameters=parameters[0], | ||
| stop_at_stage=stop_at_stage, | ||
| params=parameters, | ||
| disable_multi_reduction_to_contract=True, | ||
| ) | ||
| ) | ||
|
|
||
| if stop_at_stage and stop_at_stage != "final": | ||
| return schedules | ||
|
|
||
| schedules.append(xegpu_to_binary()) | ||
|
|
||
| return schedules | ||
|
|
||
| def shared_libs(self) -> list[str]: | ||
|
|
@@ -182,12 +175,6 @@ def parse_cli(): | |
| default=8, | ||
| help="Number of rows per subgroup.", | ||
| ) | ||
| parser.add_argument( | ||
| "--subgroup-size", | ||
| type=int, | ||
| default=16, | ||
| help="Subgroup size.", | ||
| ) | ||
| parser.add_argument( | ||
| "--reduction-step-size", | ||
| type=int, | ||
|
|
@@ -250,11 +237,9 @@ def parse_cli(): | |
| [ | ||
| { | ||
| "layer_kind": "reduction", | ||
| "sizes": args.sizes, | ||
| "wg_tile": [args.wg_rows, 0], | ||
| "sg_tile": [args.sg_rows, 0], | ||
| "reduction_tile": [0, args.reduction_step_size], | ||
| "subgroup_size": args.subgroup_size, | ||
| } | ||
| ] | ||
| ) | ||
|
|
@@ -329,7 +314,6 @@ def list2str(a): | |
| f"dt={dtype} " | ||
| f"wg-rows={args.wg_rows} " | ||
| f"sg-rows={args.sg_rows} " | ||
| f"subgroup-size={args.subgroup_size} " | ||
| f"time(us): {elapsed:.2f} " | ||
| f"GFLOPS: {gflops:.2f} " | ||
| ) | ||
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.
does this also use the reduction schedule? is then worth updating the PR desc (it does not mention about fused attention?)
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.
No, previously fused_attention defined its own
get_xegpu_pipelinefunction. In this PR it's updated to use the common one defined inxegpu_pipeline.py. There no change in the attention lowering.