Skip to content

[TMTensor] Add is_causal attribute to aid mask dematerialisation.#4520

Open
keshavvinayak01 wants to merge 2 commits intollvm:mainfrom
keshavvinayak01:users/keshavvinayak01/TMTensor-causal-mask-attr
Open

[TMTensor] Add is_causal attribute to aid mask dematerialisation.#4520
keshavvinayak01 wants to merge 2 commits intollvm:mainfrom
keshavvinayak01:users/keshavvinayak01/TMTensor-causal-mask-attr

Conversation

@keshavvinayak01
Copy link
Copy Markdown
Contributor

@keshavvinayak01 keshavvinayak01 commented Apr 2, 2026

Adding the is_causal hint removes unnecessary buffer allocations and enables fusion opportunities downstream. (Optionally, the downstream lowering can let the mask be allocated, preserving previous behaviour)(Example: iree-org/iree#23999)

keshavvinayak01 and others added 2 commits April 6, 2026 17:13
Add OptionalAttr<BoolAttr>:$is_causal to signal that the materialized
mask is a causal mask. Downstream consumers can use this to replace
the mask with a fused index computation.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha@gmail.com>
Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha@gmail.com>
@keshavvinayak01 keshavvinayak01 force-pushed the users/keshavvinayak01/TMTensor-causal-mask-attr branch from 2ab61c0 to 51e62e7 Compare April 6, 2026 17:18
@keshavvinayak01 keshavvinayak01 marked this pull request as ready for review April 6, 2026 17:25
@keshavvinayak01 keshavvinayak01 requested review from Yu-Zhewen and zjgarvey and removed request for zjgarvey April 6, 2026 17:25
@keshavvinayak01 keshavvinayak01 changed the title [TMTensor] Remove Materialization of causal_masks; add attribute instead [TMTensor] Add is_causal attribute to aid mask dematerialisation. Apr 6, 2026
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.

1 participant