Skip to content

Remove pattern matching based ATen evaluation for matmul#2268

Merged
Priya2698 merged 5 commits intomainfrom
pm/rm_pattern_matching
May 21, 2024
Merged

Remove pattern matching based ATen evaluation for matmul#2268
Priya2698 merged 5 commits intomainfrom
pm/rm_pattern_matching

Conversation

@Priya2698
Copy link
Collaborator

We are removing pattern matching based evaluation since we are now using new IR nodes MatmulOp / LinearOp (Issue #2149). Removing pattern matching, and setting the disable option to clean the codebase.

@Priya2698
Copy link
Collaborator Author

!build

Copy link
Collaborator

@jacobhinkle jacobhinkle left a comment

Choose a reason for hiding this comment

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

Nice cleanups!

at::Tensor t0 = at::randn({M, K}, options);
at::Tensor t1 = at::randn({K, N}, options);
at::Tensor aten_output = matmul(t0.to(at::kDouble), t1.to(at::kDouble));
at::Tensor aten_output = at::matmul(t0.to(at::kDouble), t1.to(at::kDouble));
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this working currently? There's no using namespace at; anywhere that I can see, and those are definitely at::Tensors.

Copy link
Collaborator Author

@Priya2698 Priya2698 May 20, 2024

Choose a reason for hiding this comment

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

It calls ATen matmul:

Thread 1 "nvfuser_tests" hit Breakpoint 2, at::matmul (self=..., other=...) at /usr/local/lib/python3.10/dist-packages/torch/include/ATen/ops/matmul.h:26
26      inline at::Tensor matmul(const at::Tensor & self, const at::Tensor & other) {
          return at::_ops::matmul::call(self, other);

I wasn't aware it could be used without the namespace either. I changed it to remove any confusion with our matmul API although the input types will distinguish the two.

@Priya2698 Priya2698 marked this pull request as ready for review May 20, 2024 23:19
@Priya2698 Priya2698 merged commit 3cffd20 into main May 21, 2024
@Priya2698 Priya2698 deleted the pm/rm_pattern_matching branch May 21, 2024 16:48
Priya2698 added a commit that referenced this pull request May 21, 2024
We are removing pattern matching based evaluation since we are now using
new IR nodes `MatmulOp` / `LinearOp` (Issue #2149). Removing pattern
matching, and setting the disable option to clean the codebase.
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