Skip to content

implement DynamicQuantizeMatMul#16757

Merged
zhangxiang1993 merged 5 commits intoDmlPrototypefrom
user/xianz/DynMM
Jul 21, 2023
Merged

implement DynamicQuantizeMatMul#16757
zhangxiang1993 merged 5 commits intoDmlPrototypefrom
user/xianz/DynMM

Conversation

@zhangxiang1993
Copy link
Copy Markdown
Contributor

@zhangxiang1993 zhangxiang1993 commented Jul 19, 2023

Description

This PR implement com.microsoft.DynamicQuantizeMatMul

image

operatorGraphDesc.nodesAsOpDesc = opDescs.data();

// set input edges
std::pair<uint32_t, uint32_t> nodeToNodeInputIndex[5] {{0, 0}, {1, 3}, {1, 4}, {1, 5}, {1, 6}};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since you're using OnnxInputIndex::Count below, we should be probably do it here as well instead of hardcoding a 5

Comment on lines +111 to +112
operatorGraphDesc.nodeCount = 2;
std::vector<const DML_OPERATOR_DESC*> opDescs{&opDesc1, &opDesc2};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest inverting those 2 lines and use opDescs.size() for the nodeCount instead.

@PatriceVignola
Copy link
Copy Markdown
Contributor

LGTM, just a few nits. Do you need to enable tests are are they already enabled?

@zhangxiang1993
Copy link
Copy Markdown
Contributor Author

Yeah, the tests were already enabled, I did nothing for the tests, the PR tile is confusing


In reply to: 1642765909

@zhangxiang1993 zhangxiang1993 merged commit 0790b05 into DmlPrototype Jul 21, 2023
@zhangxiang1993 zhangxiang1993 deleted the user/xianz/DynMM branch July 21, 2023 21:18
constexpr static std::array<SupportedTensorDataTypes, 2> supportedTypeListDynamicQuantizeLinear = {
SupportedTensorDataTypes::Float32,
SupportedTensorDataTypes::UInt8,
SupportedTensorDataTypes::Int8|SupportedTensorDataTypes::UInt8
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I notice your other change used SupportedTensorDataTypes::Ints8Bit. Consider using that here too in the future.

AnaghaRaoAMD added a commit that referenced this pull request Nov 6, 2023
[Cherry Pick Reviewed]
This PR implement

[com.microsoft.DynamicQuantizeMatMul](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#commicrosoftdynamicquantizematmul)


![image](https://github.com/microsoft/onnxruntime/assets/17421593/c8ab927a-5d69-40e5-a08b-79b89becf937)

### Description
<!-- Describe your changes. -->



### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

Co-authored-by: Xiang Zhang <xianz@microsoft.com>
AnaghaRaoAMD added a commit that referenced this pull request Mar 4, 2024
[Cherry Pick Reviewed]
This PR implement

[com.microsoft.DynamicQuantizeMatMul](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#commicrosoftdynamicquantizematmul)

![image](https://github.com/microsoft/onnxruntime/assets/17421593/c8ab927a-5d69-40e5-a08b-79b89becf937)

<!-- Describe your changes. -->

<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

Co-authored-by: Xiang Zhang <xianz@microsoft.com>
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.

3 participants