Skip to content

Commit

Permalink
fix backward kernel selection
Browse files Browse the repository at this point in the history
  • Loading branch information
liuanji committed Jan 12, 2024
1 parent 08c9130 commit bb9aca6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pyjuice/layer/sum_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ def _backward(self, node_flows: torch.Tensor, element_flows: torch.Tensor,
elif params.dim() == 1 and self.group_size >= 16 and num_edges >= 16 and batch_size >= 16:
# In this case, we should definitely use the block-sparse implementation
mode = self.BLOCK_SPARSE
elif (cs_group_size == 1 or self.group_size == 1) and num_edges < 16384:
elif (cs_group_size == 1 or self.group_size == 1) and num_edges <= 32768:
# In this case, we should definitely use the sparse implementation
mode = self.SPARSE
elif self.group_size * batch_size < 32:
Expand Down

0 comments on commit bb9aca6

Please sign in to comment.