Skip to content

[CoreML] more performace flag#22975

Merged
wejoncy merged 14 commits intomainfrom
jicwen/coreml_flag
Dec 10, 2024
Merged

[CoreML] more performace flag#22975
wejoncy merged 14 commits intomainfrom
jicwen/coreml_flag

Conversation

@wejoncy
Copy link
Contributor

@wejoncy wejoncy commented Nov 29, 2024

Description

refactor unsquzee's implementation
add more flags to boost peformance.
add profile flag

Motivation and Context

@wejoncy wejoncy requested review from edgchen1 and skottmckay and removed request for skottmckay November 29, 2024 12:05
@wejoncy wejoncy marked this pull request as ready for review November 29, 2024 12:05
@wejoncy wejoncy force-pushed the jicwen/coreml_flag branch from 218fe66 to bf095dd Compare December 2, 2024 05:41
@wejoncy wejoncy force-pushed the jicwen/coreml_flag branch from d64d79c to 5249880 Compare December 2, 2024 08:07
@wejoncy wejoncy force-pushed the jicwen/coreml_flag branch from 5bc1ecf to 92a7c59 Compare December 5, 2024 03:55
@wejoncy wejoncy force-pushed the jicwen/coreml_flag branch from 92a7c59 to 123a4f0 Compare December 5, 2024 04:00
@wejoncy wejoncy requested a review from skottmckay December 9, 2024 01:46
skottmckay
skottmckay previously approved these changes Dec 9, 2024
skottmckay
skottmckay previously approved these changes Dec 9, 2024
@wejoncy wejoncy merged commit e12421b into main Dec 10, 2024
@wejoncy wejoncy deleted the jicwen/coreml_flag branch December 10, 2024 01:35
ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request Dec 11, 2024
### Description
refactor unsquzee's implementation
add more flags to boost peformance.
add profile flag


### 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: jicwen <jicwen@YiMacBook-Pro.local>
Co-authored-by: wejoncy <wejoncy@.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request Dec 11, 2024
### Description
refactor unsquzee's implementation
add more flags to boost peformance.
add profile flag


### 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: jicwen <jicwen@YiMacBook-Pro.local>
Co-authored-by: wejoncy <wejoncy@.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request Dec 11, 2024
### Description
refactor unsquzee's implementation
add more flags to boost peformance.
add profile flag


### 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: jicwen <jicwen@YiMacBook-Pro.local>
Co-authored-by: wejoncy <wejoncy@.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
tarekziade pushed a commit to tarekziade/onnxruntime that referenced this pull request Jan 10, 2025
### Description
refactor unsquzee's implementation
add more flags to boost peformance.
add profile flag


### 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: jicwen <jicwen@YiMacBook-Pro.local>
Co-authored-by: wejoncy <wejoncy@.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
carzh added a commit that referenced this pull request Apr 30, 2025
### Description
Add int64 as a supported datatype for moving nodes to the CoreML EP.

We already convert constants automatically from int64 to int32 for
CoreML by calling narrow.

Adding the conversion for outputs as well.

### Motivation and Context
- More nodes supported on CoreML

### Note on the Unsqueeze op
According to #22975 there is a bug with the Unsqueeze op with scalar
inputs on x86.

I was running into a bug for unsqueezes that unsqueezed a scalar input
to a tensor of shape [1] since CoreML doesn't support scalar values for
MLProgram. I adapted the HandleX86ArchUnsqueeze method but
alternatively, can replace with an identity operator or add some
additional checks. I went with adapting the HandleX86ArchUnsqueeze
method since it seemed like the fastest solution.
ankitm3k pushed a commit to intel/onnxruntime that referenced this pull request May 12, 2025
### Description
Add int64 as a supported datatype for moving nodes to the CoreML EP.

We already convert constants automatically from int64 to int32 for
CoreML by calling narrow.

Adding the conversion for outputs as well.

### Motivation and Context
- More nodes supported on CoreML

### Note on the Unsqueeze op
According to microsoft#22975 there is a bug with the Unsqueeze op with scalar
inputs on x86.

I was running into a bug for unsqueezes that unsqueezed a scalar input
to a tensor of shape [1] since CoreML doesn't support scalar values for
MLProgram. I adapted the HandleX86ArchUnsqueeze method but
alternatively, can replace with an identity operator or add some
additional checks. I went with adapting the HandleX86ArchUnsqueeze
method since it seemed like the fastest solution.
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