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

[UMA RFC] Discussion beyond UMA_v1.0 #86

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
97 changes: 97 additions & 0 deletions rfcs/0060_UMA_Unified_Modular_Accelerator_Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,100 @@ Below is a list of currently planned configuration parameters for the initial ve
|Parameter|Type|Description|
|---------|----|-----------|
|merge_compiler_regions|bool (default: True)|Enables/disables the `MergeCompilerRegions` pass during partitioning.|


## TVMC integration

Proposals:
- Add uma_cli functionality that is currently only used for the tutorial
- possibility to compile with tvmc
Copy link
Contributor

Choose a reason for hiding this comment

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

One detail that will make the API to be more CLI-auto-generated friendly for UMA targets would actually be offering a description field while adding new target.

# Target configuration
        self._register_target_attr("dimension", description="Some description string.", default=8)

- integrate the UMA targets with the tvmc run command

## Tutorial

Three mock-accelerators: see $TVM_HOME/gallery/tutorial/uma.py for details

### Vanilla
See tutorial

### Strawberry

differences to Vanilla:
- show how a TIR pass is implemented and used in UMA

Propose hardware architecture:

![](assets/0060/uma_strawberry.png)


Pseudo-code of run.py example:

```
main(){
layer1();
layer2();
layer3-conv2d-uma();
layer4();
}

layer3-conv2d-uma(){
dma_copy(ifmap);
dma_copy(weights);
strawberry_calculate();
dma_copy(ofmap);
}
```



### UMA chocolate

Proposed topics to be covered in Chocolate part of tutorial:
- tiling
- tuning
- configuration (via configure_stub)
- irq handling / polling

Propose hardware architecture:

TDB

Pseudo-code of run.py example:
```
main{
layer1();
layer2();
layer3-conv2-uma();
layer4();
}

layer3-conv2d-uma(){
for (tilex){
for (tiley){
dma_copy(ifmap);
dma_copy(weights);
strawberry_conv2d_calculate();
dma_copy(ofmap);
}
}
}

strawberry_conv2d_calculate(*ifmap,*weight,*ofmap, kx, ky, ci, ...){
configure_stub();
exeucute_stub(**args);
irq_stub();
}

exucute_stub(){
//c implementation of conv2d
}

configure_stub(){
//empty for first shot
}

irq_stub(){
//empty for first shot
}
```

1 change: 1 addition & 0 deletions rfcs/assets/0060/uma_strawberry.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="app.diagrams.net" modified="2022-08-04T11:51:27.374Z" agent="5.0 (Windows)" etag="Jeb4wgW3YBTc5_V_aQxJ" version="20.2.3" type="device"><diagram id="ACOg41SwzcYdof_oHiYl" name="Page-1">5VjbcpswEP0aHusRV8Njgp2kM/U0LdMmfVSQAswAokI2uF9fqQhzkR07GdtxW48fVmd13XPYFWimn9W3FBbxgiCcagZAtWbONMPQLcPQxB+gdYNMbQlENEGyUwcEyS8sQSDRZYJwOejICElZUgzBkOQ5DtkAg5SSatjtmaTDVQsYYQUIQpiq6EOCWNygrg06/A4nUdyurAPpyWDbWQJlDBGpepA510yfEsIaK6t9nIrgtXFpxt3s8G42RnHODhkw979k6OdddZVnnz775c1376vzQZdsrGC6lCeWu2XrNgR844Uwn1NcX4mQauY1zpE0Z2EKyzIJOVgySJkKxyxLOaBzk5JljrDYEOAt9QTyUBgNSJHnucUkw4yueYeqo2IT8LhPQwtSnEKWrIZkQqmJaDPhZo17kvC9GEDq13TsZohUr9uS2U5RkiUNsRzVD/6eiSx3NBEPXYSZMhE3egfvoD/cvoZnU+HZv/+mUN3xI9iq4oThoICh8Fb8+R6SuZO+FaYM1y8S2Ho9MAiLDWSY+gQbWwh2wG4qB7F7daCsLQ+Ek/Jlr1Gy4mYkzIBRWD1hKhZsnHyxnn/LkBZ6omPkMoZemBKcluF9StBPJwVnf248Sh7kUaPrx37jh2hM7LY5q/vO2fqY+dPeElP7SNlzOuLU8iZe//e2XGpZo2ntM+fS6bl0USfsUXqE3VMFb3WiEI29mmiie0CJuBDxWGDEsmu/tfSOaoxpvaTCU4vH/TfFY/0f4pla5801hlqDgpjzgzi2wBmRZe49K/c4HdsHV+7xHfholdtQM/RscfXukVJuu+6BkTrZFcf4K7PRhSQZUx8lGeBNpkfKM44OJsZorlOnGk/RwsecYZrDVH2LCEIKWRgXEKm+C8lLBhin7i3vlts+Hoyvkwc8bbzZfchpCOk+h5nz3w==</diagram></mxfile>
Binary file added rfcs/assets/0060/uma_strawberry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions rfcs/assets/0060/uma_vanilla.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="app.diagrams.net" modified="2022-08-04T11:52:03.899Z" agent="5.0 (Windows)" etag="VvwA21F-8b3_EBde1fuC" version="20.2.3" type="device"><diagram id="ACOg41SwzcYdof_oHiYl" name="Page-1">5VdNc5swEP01HNsBCez4mGInOTTTtJ6myVGDNkYzAlEhG+ivryjCIIiLncnXtDM+7D5JK+m9x2IcHCblpSRZfC0ocAe5tHTw0kHI8xFy6p9LqwaZBwbYSEbNpA5Ys19gQNegW0YhtyYqIbhimQ1GIk0hUhZGpBSFPe1BcHvXjGxgBKwjwsfoD0ZV3KBngdvhV8A2cbuz55qRhLSTDZDHhIqiB+GVg0MphGqipAyB1+S1vDTrLg6M7g8mIVXHLFiFXxP686o4T5PPX8L84nbxbfbBVNkRvjUXNodVVcuAPndWhw8cyvOaUQd/gpSacBlxkucs0mCuiFRjOFYJ14CnQym2KYX6PK7OxhcwpwFqaWKucwkiASUrPaHolNjzHfdVaEEJnCi2s7UkxhKbfcH9HjeC6bMg19gXz4JmiTGvjwK7RC62MgKzqs/9RCHkDQpp6jagRoV00Lt4B/2R9gSZ0Ujm8Ob7SOlOnlqsImYK1hmJ6tFCP922lgfV24FUUP5Vv3Z04dqs+Cbv64se0XfmHlbSou5UnvCIp1uSMs7Ju+MKB2/NlT/iah3rG1KNXUMizA5vyZnvD/yFj+TMO3sp0ubT/fZZeqsmTVZ3/eS+Tj4Gbbos+4PLaqonNw1q2g6n9O7gEeqDZ+rc88HjggaKHtu5/WBQaD4o9MKde/FahimZujMjddyzi846t9TJpFkacqffR+/ELL5ra+w/1Sx4Nmg4r2yW9k/zP+YW/H+4BQ/fOk92i06774pmevd1hle/AQ==</diagram></mxfile>
Binary file added rfcs/assets/0060/uma_vanilla.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.