Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backends/cuda/cuda_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Partitioner,
PartitionResult,
)
from executorch.exir.backend.utils import tag_constant_data
from executorch.exir.backend.utils import tag_constant_data, tag_mutated_buffer
from torch.export.exported_program import ExportedProgram


Expand Down Expand Up @@ -54,6 +54,7 @@ def partition(self, exported_program: ExportedProgram) -> PartitionResult:
partition_tags[tag] = self.delegation_spec

tag_constant_data(exported_program)
tag_mutated_buffer(exported_program)
Copy link
Contributor

@mergennachin mergennachin Oct 3, 2025

Choose a reason for hiding this comment

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

Make inline comment, something like this

  # Tag mutated buffers (e.g., KV caches) to avoid unnecessary copies.
  # Buffers that are mutated in-place within the delegated subgraph
  # don't need to be returned as outputs.


return PartitionResult(
tagged_exported_program=exported_program, partition_tags=partition_tags
Expand Down
Loading