Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support unpadded shapes in matmul1d w/ gather_in0 #16626

Closed
avoraTT opened this issue Jan 10, 2025 · 0 comments
Closed

Support unpadded shapes in matmul1d w/ gather_in0 #16626

avoraTT opened this issue Jan 10, 2025 · 0 comments
Assignees

Comments

@avoraTT
Copy link
Contributor

avoraTT commented Jan 10, 2025

Problem

Currently, Matmul1D with gather_in0=True does not handle shapes (K, N) that do not divide by the number of cores in the ring. In the current use case in the Llama models, the activations and weights need to be padded in order to use the matmul. However, this results in significant overhead caused by padding/slicing. Therefore, this matmul must support shapes that do not divide with the number of cores, and handle the padding implicitly.

@avoraTT avoraTT added the metal tt-metal issue label Jan 10, 2025
@avoraTT avoraTT self-assigned this Jan 10, 2025
avoraTT added a commit that referenced this issue Jan 24, 2025
…6627)

### Ticket
- #16626

### Problem description
In the current use case of Matmul1D with gather_in0 in the Llama models,
the activations and weights need to be padded. This results in
significant overhead.

### What's changed
- Added support to skip part of in0_block_w that is padding information
- Pad the Kt and Nt in the host code for gather_in0

### Checklist
- [x] Post commit CI passes
(https://github.com/tenstorrent/tt-metal/actions/runs/12893880800)
- [x] New/Existing tests provide coverage for changes
(https://github.com/tenstorrent/tt-metal/actions/runs/12893883783)
@avoraTT avoraTT closed this as completed Jan 24, 2025
patrickroberts pushed a commit that referenced this issue Jan 25, 2025
…6627)

### Ticket
- #16626

### Problem description
In the current use case of Matmul1D with gather_in0 in the Llama models,
the activations and weights need to be padded. This results in
significant overhead.

### What's changed
- Added support to skip part of in0_block_w that is padding information
- Pad the Kt and Nt in the host code for gather_in0

### Checklist
- [x] Post commit CI passes
(https://github.com/tenstorrent/tt-metal/actions/runs/12893880800)
- [x] New/Existing tests provide coverage for changes
(https://github.com/tenstorrent/tt-metal/actions/runs/12893883783)
ubcheema pushed a commit that referenced this issue Jan 28, 2025
…6627)

### Ticket
- #16626

### Problem description
In the current use case of Matmul1D with gather_in0 in the Llama models,
the activations and weights need to be padded. This results in
significant overhead.

### What's changed
- Added support to skip part of in0_block_w that is padding information
- Pad the Kt and Nt in the host code for gather_in0

### Checklist
- [x] Post commit CI passes
(https://github.com/tenstorrent/tt-metal/actions/runs/12893880800)
- [x] New/Existing tests provide coverage for changes
(https://github.com/tenstorrent/tt-metal/actions/runs/12893883783)
yieldthought pushed a commit that referenced this issue Jan 31, 2025
…6627)

### Ticket
- #16626

### Problem description
In the current use case of Matmul1D with gather_in0 in the Llama models,
the activations and weights need to be padded. This results in
significant overhead.

### What's changed
- Added support to skip part of in0_block_w that is padding information
- Pad the Kt and Nt in the host code for gather_in0

### Checklist
- [x] Post commit CI passes
(https://github.com/tenstorrent/tt-metal/actions/runs/12893880800)
- [x] New/Existing tests provide coverage for changes
(https://github.com/tenstorrent/tt-metal/actions/runs/12893883783)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant