Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
8 changes: 4 additions & 4 deletions src/llmcompressor/pipelines/sequential/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,14 @@ def topological_partition(graph: GraphModule, targets: Set[Module]) -> List[List
while len(queue) > 0:
node = queue.popleft()

# assign to partition
partitions[partition_index].append(node)

# guarantee targets are assigned to disjoint partitions
if node in target_nodes:
if node in target_nodes and len(partitions[partition_index]) > 0:
partition_index += 1
partitions.append([])

# assign to partition
partitions[partition_index].append(node)

# recurse on last indegree only in order to guarantee that
# the node is assigned to maximal partition
for user in node.users:
Expand Down
8 changes: 8 additions & 0 deletions tests/llmcompressor/transformers/tracing/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Qwen2_5_VLForConditionalGeneration,
Qwen2VLForConditionalGeneration,
WhisperForConditionalGeneration,
Cohere2VisionForConditionalGeneration,
)

from llmcompressor.pipelines.sequential.helpers import match_modules
Expand Down Expand Up @@ -87,6 +88,13 @@
"vision",
["torchvision"],
),
(
"CohereLabs/command-a-vision-07-2025",
Cohere2VisionForConditionalGeneration,
["Cohere2DecoderLayer"],
"vision",
[],
)
(
"Qwen/Qwen2-VL-2B-Instruct",
Qwen2VLForConditionalGeneration,
Expand Down
Loading