Skip to content

Conversation

@yaoyaoding
Copy link
Member

@yaoyaoding yaoyaoding commented Sep 18, 2025

This PR adds three tcgen05 instructions:

  • tcgen05.alloc
  • tcgen05.dealloc
  • tcgen05.relinquish_alloc_permit

In IR,

  • add TensorMemoryTensor tensor

In codegen,

  • add Tcgen05Context context
  • update the way to access codegen context

Signed-off-by: Yaoyao Ding <dingyaoyao.cs@gmail.com>
Signed-off-by: Yaoyao Ding <dingyaoyao.cs@gmail.com>
Signed-off-by: Yaoyao Ding <dingyaoyao.cs@gmail.com>
@yaoyaoding yaoyaoding changed the title [Instruction][tcgen05] Add alloc, dealloc and relinquish_alloc_permit instructions [Instruction][tcgen05] Add alloc, dealloc and relinquish instructions Sep 18, 2025
Signed-off-by: Yaoyao Ding <dingyaoyao.cs@gmail.com>
@yaoyaoding yaoyaoding requested a review from Copilot September 18, 2025 05:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds three new tcgen05 instructions (alloc, dealloc, and relinquish_alloc_permit) to the tilus framework, along with the necessary infrastructure to support tensor memory operations on SM100 GPU architectures.

  • Introduces TensorMemoryTensor class for handling tensor memory allocations
  • Adds Tcgen05EmitContext to track CTA group state across tcgen05 instructions
  • Refactors codegen context access pattern from dictionary-based to singleton pattern

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/instructions/test_tcgen_alloc_free.py Test case demonstrating tcgen05 instruction usage
python/tilus/testing/requires.py Adds nvgpu_sm100 target requirement for testing
python/tilus/lang/transpiler.py Updates to use new builder setter method
python/tilus/lang/script.py Adds TensorMemoryTensor support and tcgen05 instruction group
python/tilus/ir/tensor.py Defines new TensorMemoryTensor class for tensor memory
python/tilus/ir/instructions/cuda/tcgen05.py Core tcgen05 instruction implementations
python/tilus/backends/emitters/cuda/tcgen05.py Code generation for tcgen05 instructions
python/tilus/backends/contexts/tcgen05_ctx.py New context for tracking tcgen05 state
python/tilus/backends/codegen.py Refactors context access to singleton pattern

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yaoyaoding yaoyaoding merged commit c0c066d into main Sep 18, 2025
8 checks passed
@yaoyaoding yaoyaoding mentioned this pull request Sep 20, 2025
17 tasks
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