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

[SVE] Support splitting by vscale in tir::split and te::split #16862

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

lhutton1
Copy link
Contributor

@lhutton1 lhutton1 commented Apr 9, 2024

This commit adds support for splitting via the compile-time unknown constant vscale. Two main changes are introduced; they are described below.

The split scheduling primitive has a new parameter disable_predication that allows the user to avoid introducing a block-level predicate when splitting with a factor of vscale. This feature is useful when schedule writers know that the loop they're splitting is a factor of the scalable vector length for their target. Otherwise, a predicate must be introduced due to the nature of vscale.

CanProve has been extended to prove expressions that use multiple instances of vscale. Known possible scalar values of the vscale intrinsic are iterated over and substituted into the expression. If the expression holds true for each possible value, we can conclude the expression true. Currently only support for an SVE target has been added, but it is possible to extend to other targets as/when needed. If the analyzer becomes more powerful in the future and is able to deal with multiple instances of a symbolic value in an expression, this feature can be removed.

Co-authored-by: Elen Kalda elen.kalda@arm.com
Co-authored-by: Neil Hickey neil.hickey@arm.com

lhutton1 and others added 3 commits April 9, 2024 13:55
This commit adds support for splitting via the compile-time unknown
constant `vscale`. Two main changes are introduced; they are described
below.

The split scheduling primitive has a new parameter disable_predication
that allows the user to avoid introducing a block-level predicate when
splitting with a factor of `vscale`. This feature is useful when schedule
writers know that the loop they're splitting is a factor of the scalable
vector length for their target. Otherwise, a predicate must be introduced
due to the nature of `vscale`.

CanProve has been extended to prove expressions that use multiple
instances of `vscale`. Known possible scalar values of the `vscale`
intrinsic are iterated over and substituted into the expression. If
the expression holds true for each possible value, we can conclude the
expression true. Currently only support for an SVE target has been
added, but it is possible to extend to other targets as/when needed. If
the analyzer becomes more powerful in the future and is able to deal
with multiple instances of a symbolic value in an expression, this
feature can be removed.

Co-authored-by: Elen Kalda <elen.kalda@arm.com>
Co-authored-by: Neil Hickey <neil.hickey@arm.com>
Change-Id: I734e14190967c5e35002759f037b38eb0755380e
Change-Id: I7f7ac4103126470ef3389d19192faa27e9831201
Change-Id: Ic61769228f4c9aaafbd2c57440e0745ef630053b
@lhutton1 lhutton1 marked this pull request as ready for review April 10, 2024 12:58
@lhutton1
Copy link
Contributor Author

Copy link
Contributor

@ekalda ekalda left a comment

Choose a reason for hiding this comment

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

Thanks @lhutton1, looks good to me! Just some low impact suggestions.

tests/python/tir-schedule/test_tir_schedule_split_fuse.py Outdated Show resolved Hide resolved
tests/python/arith/test_arith_simplify.py Outdated Show resolved Hide resolved
src/arith/scalable_expression.h Show resolved Hide resolved
src/arith/scalable_expression.cc Show resolved Hide resolved
Change-Id: I506bb622065e516b4e7111d461e3dac6ee821889
@lhutton1 lhutton1 force-pushed the p5-sve-split-support branch from 7f7f844 to d200c79 Compare April 12, 2024 13:23
Copy link
Contributor

@ekalda ekalda left a comment

Choose a reason for hiding this comment

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

Thanks @lhutton1, very nice work!

@ekalda ekalda merged commit d4056ca into apache:main Apr 15, 2024
19 checks passed
@ekalda
Copy link
Contributor

ekalda commented Apr 15, 2024

Thanks @lhutton1 :)

@lhutton1 lhutton1 deleted the p5-sve-split-support branch April 15, 2024 21:09
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.

2 participants