Skip to content

[language] hl.inline_ctx() for using context manager within Helion kernel device loop (e.g. for TLX async_task)#1389

Draft
yf225 wants to merge 1 commit into
mainfrom
inline_triton_ctx
Draft

[language] hl.inline_ctx() for using context manager within Helion kernel device loop (e.g. for TLX async_task)#1389
yf225 wants to merge 1 commit into
mainfrom
inline_triton_ctx

Conversation

@yf225
Copy link
Copy Markdown
Contributor

@yf225 yf225 commented Feb 5, 2026

This is for supporting usage of with tlx.async_task('default'): within Helion kernel, so that TLX kernels using that context manager can be generated by Helion DSL (important for internal customers).

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 5, 2026
@yf225 yf225 force-pushed the inline_triton_ctx branch from 2f6d133 to f110028 Compare February 5, 2026 23:48
@yf225 yf225 changed the title [language feature] hl.inline_triton_ctx() for context manager within device loop [language] hl.inline_triton_ctx() for context manager within device loop Feb 5, 2026
@yf225 yf225 force-pushed the inline_triton_ctx branch 27 times, most recently from 67bca64 to 2357265 Compare February 6, 2026 04:02
@yf225 yf225 force-pushed the inline_triton_ctx branch 2 times, most recently from 9048420 to 0027111 Compare February 6, 2026 04:08
@yf225 yf225 changed the title [language] hl.inline_triton_ctx() for context manager within device loop [language] hl.inline_ctx() for using context manager within Helion kernel Feb 6, 2026
@yf225 yf225 changed the title [language] hl.inline_ctx() for using context manager within Helion kernel [language] hl.inline_ctx() for using context manager within Helion kernel (e.g. with tlx.async_task():) Feb 6, 2026
@yf225 yf225 force-pushed the inline_triton_ctx branch 2 times, most recently from 77e3cda to 1caae70 Compare February 6, 2026 04:15
@yf225 yf225 changed the title [language] hl.inline_ctx() for using context manager within Helion kernel (e.g. with tlx.async_task():) [language] hl.inline_ctx() for using context manager within Helion kernel (e.g. for TLX async_task) Feb 6, 2026
@yf225 yf225 force-pushed the inline_triton_ctx branch 2 times, most recently from d356237 to c3e903d Compare February 6, 2026 04:44
@yf225 yf225 marked this pull request as ready for review February 6, 2026 04:54
@htyu
Copy link
Copy Markdown

htyu commented Feb 6, 2026

Thanks for working on this. Just want to share that besides tlx.async_task there is also an outer construct named tlx.async_tasks e.g., https://github.com/facebookexperimental/triton/blob/2f4eea63c11b4106f7c483cd6ecd9f8851953c09/python/test/unit/language/test_tlx.py#L2260

@yf225 yf225 marked this pull request as draft February 6, 2026 08:26
@yf225 yf225 force-pushed the inline_triton_ctx branch 4 times, most recently from 809ab22 to 0dd22b3 Compare February 6, 2026 19:55
Comment thread test/test_inline_triton.py Outdated
output_like=None,
)
val = out[tile_m, tile_n]
out[tile_m, tile_n] = val
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Diff looks good to me. Looks like we are exposing the partition and the barrier first, the semantics around "out[...] = val" is a bit unclear, does it mean storing to global memory? I saw a similar statement in the compute group.

@yf225 yf225 force-pushed the inline_triton_ctx branch 2 times, most recently from fbea0f0 to 08fa6d6 Compare February 6, 2026 21:09
@yf225 yf225 changed the title [language] hl.inline_ctx() for using context manager within Helion kernel (e.g. for TLX async_task) [language] hl.inline_ctx() for using context manager within Helion kernel device loop (e.g. for TLX async_task) Feb 6, 2026
@yf225 yf225 force-pushed the inline_triton_ctx branch from 08fa6d6 to 41d86c6 Compare February 7, 2026 22:06
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 18, 2026

Hi @yf225!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants